-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup build descriptors Add integration tests Update workflows
- Loading branch information
Showing
12 changed files
with
266 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,23 +38,23 @@ jobs: | |
uses: dcarbone/[email protected] | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: ${{ env.JAVA_VERSION }} | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
path: current-repo | ||
|
||
- name: Checkout Ecosystem | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ env.ECOSYSTEM_CI_REPO }} | ||
path: ecosystem-ci | ||
|
||
- name: Setup and Run Tests | ||
run: ./ecosystem-ci/setup-and-test | ||
env: | ||
ECOSYSTEM_CI_TOKEN: ${{ secrets.ECOSYSTEM_CI_TOKEN }} | ||
ECOSYSTEM_CI_TOKEN: ${{ secrets.ECOSYSTEM_CI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.quarkiverse.sshd</groupId> | ||
<artifactId>quarkus-sshd-parent</artifactId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>quarkus-sshd-integration-tests</artifactId> | ||
<name>Quarkus Apache SSHD - Integration Tests</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkiverse.sshd</groupId> | ||
<artifactId>quarkus-sshd</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<version>3.25.3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<native.image.path>${project.build.directory}/${project.build.finalName}-runner | ||
</native.image.path> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>${maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>native-image</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skipTests>${native.surefire.skip}</skipTests> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<properties> | ||
<skipITs>false</skipITs> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
<quarkus.native.additional-build-args>--initialize-at-run-time=org.apache.activemq.artemis.api.core.ActiveMQBuffers\,org.apache.activemq.artemis.utils.RandomUtil</quarkus.native.additional-build-args> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
30 changes: 30 additions & 0 deletions
30
integration-tests/src/test/java/io/quarkiverse/sshd/SmokeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.quarkiverse.sshd; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.io.IOException; | ||
|
||
import org.apache.sshd.client.SshClient; | ||
import org.apache.sshd.client.session.ClientSession; | ||
import org.apache.sshd.client.simple.SimpleClient; | ||
import org.eclipse.microprofile.config.ConfigProvider; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
@QuarkusTestResource(value = SshdServerTestResource.class, restrictToAnnotatedClass = true) | ||
public class SmokeTest { | ||
|
||
@Test | ||
void shouldOpenSession() throws IOException { | ||
String host = ConfigProvider.getConfig().getValue("quarkiverse.sshd.host", String.class); | ||
int port = ConfigProvider.getConfig().getValue("quarkiverse.sshd.port", Integer.class); | ||
try (SimpleClient client = SshClient.setUpDefaultSimpleClient()) { | ||
try (ClientSession clientSession = client.sessionLogin(host, port, "anonymous", "anonymous")) { | ||
assertThat(clientSession).isNotNull(); | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration-tests/src/test/java/io/quarkiverse/sshd/SmokeTestIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.quarkiverse.sshd; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
public class SmokeTestIT extends SmokeTest { | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
integration-tests/src/test/java/io/quarkiverse/sshd/SshdServerTestResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.quarkiverse.sshd; | ||
|
||
import java.io.IOException; | ||
import java.io.UncheckedIOException; | ||
import java.nio.file.Files; | ||
import java.util.Map; | ||
|
||
import org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory; | ||
import org.apache.sshd.server.SshServer; | ||
import org.apache.sshd.server.auth.hostbased.AcceptAllHostBasedAuthenticator; | ||
import org.apache.sshd.server.auth.password.AcceptAllPasswordAuthenticator; | ||
import org.apache.sshd.server.auth.pubkey.AcceptAllPublickeyAuthenticator; | ||
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider; | ||
import org.apache.sshd.server.shell.UnknownCommandFactory; | ||
|
||
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; | ||
|
||
public class SshdServerTestResource implements QuarkusTestResourceLifecycleManager { | ||
|
||
private SshServer sshd; | ||
|
||
@Override | ||
public Map<String, String> start() { | ||
try { | ||
sshd = SshServer.setUpDefaultServer(); | ||
sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(Files.createTempFile("host", "key"))); | ||
sshd.setHostBasedAuthenticator(AcceptAllHostBasedAuthenticator.INSTANCE); | ||
sshd.setPasswordAuthenticator(AcceptAllPasswordAuthenticator.INSTANCE); | ||
sshd.setPublickeyAuthenticator(AcceptAllPublickeyAuthenticator.INSTANCE); | ||
sshd.setCommandFactory(UnknownCommandFactory.INSTANCE); | ||
sshd.setIoServiceFactoryFactory(new Nio2ServiceFactoryFactory()); | ||
sshd.setHost("localhost"); | ||
sshd.start(); | ||
return Map.of( | ||
"quarkiverse.sshd.host", sshd.getHost(), | ||
"quarkiverse.sshd.port", Integer.toString(sshd.getPort())); | ||
} catch (IOException e) { | ||
throw new UncheckedIOException(e); | ||
} | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
try { | ||
sshd.stop(true); | ||
} catch (IOException e) { | ||
throw new UncheckedIOException(e); | ||
} | ||
} | ||
} |
Oops, something went wrong.