Skip to content

Upgrade Wildfly Swarm to Thorntail #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ These are the available container profiles:
This profile uses the special "wlp-microProfile1" distribution of Liberty, which contains the MicroProfile APIs out of the box
and start up the server per sample.
Useful for CI servers. The Liberty version that's used can be set via the ``liberty.version`` property.
* WildFly
* ``wildfly-ci-managed``
* Thorntail
* ``thorntail``

This profile is based on WildFly Swarm, and includes the MicroProfile 1.2 fragment. The actual WildFly Swarm code and thus
This profile is based on Thorntail, and includes the MicroProfile 1.2 fragment. The actual Thorntail code and thus
the WildFly code is handled internally by the Arquillian connector.
Useful for CI servers. The WildFly Swarm version that's used can be set via the ``wildfly.version`` property.
Useful for CI servers. The Thorntail version that's used can be set via the ``thorntail.version`` property.

The containers that download and install a server (the \*-ci-managed profiles) allow you to override the version used, e.g.:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
swarm:
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 3500 #MORE THAN MyAsyncBean*Level.AWAIT CONFIGURED IN TESTS
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static WebArchive createDeployment() {
return create(WebArchive.class)
.addAsLibraries(awaitability())
.addClasses(MyAsyncBeanClassLevel.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsResource("project-defaults.yml");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static WebArchive createDeployment() {
return create(WebArchive.class)
.addAsLibraries(awaitability())
.addClasses(MyAsyncBeanMethodLevel.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsResource("project-defaults.yml");
}

@Test // Runs on Server
Expand Down
12 changes: 12 additions & 0 deletions fault-tolerance/bulkhead/src/main/resources/project-defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
swarm:
hystrix:
threadpool:
default:
maximumSize: 10 #SHOULD BE >= AsynchronousBulkheadBean @Bulkead value + @Bulkhead waitingTaskQueue
allowMaximumSizeToDivergeFromCoreSize: true
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 21500 #MORE THAN (AsynchronousBulkheadBean @Bulkead value + @Bulkhead waitingTaskQueue -1) * AsynchronousBulkheadBean.AWAIT
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class AsynchronousBulkheadBeanTest {
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class)
.addClasses(AsynchronousBulkheadBean.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsResource("project-defaults.yml");
}

/**
Expand Down Expand Up @@ -104,8 +105,12 @@ public void bulkheadLimitTest() throws NoSuchMethodException {
Logger.getLogger(AsynchronousBulkheadBeanTest.class.getName()).log(Level.SEVERE, null, ie);
Assert.fail("Got an unexpected InterruptedException");
} catch (ExecutionException ex) {
Logger.getLogger(AsynchronousBulkheadBeanTest.class.getName()).log(Level.SEVERE, null, ex);
Assert.fail("Got an unexpected ExecutionException");
if (ex.getCause() instanceof BulkheadException) {
failures ++;
} else {
Logger.getLogger(AsynchronousBulkheadBeanTest.class.getName()).log(Level.SEVERE, null, ex);
Assert.fail("Got an unexpected ExecutionException");
}
} catch (BulkheadException be) {
failures ++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private List<Future<String>> executeThrowExceptionMethodAsynchronously(int itera
boolean shouldThrowException) {
List<Future<String>> futures = new ArrayList<>();

ExecutorService executorService = Executors.newFixedThreadPool(iterations);
ExecutorService executorService = Executors.newSingleThreadExecutor();

Callable<String> task = () -> {
classLevelCircuitBreakerBean.throwException(shouldThrowException);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private List<Future<String>> executeThrowExceptionMethodAsynchronously(int itera
boolean shouldThrowException) {
List<Future<String>> futures = new ArrayList<>();

ExecutorService executorService = Executors.newFixedThreadPool(iterations);
ExecutorService executorService = Executors.newSingleThreadExecutor();

Callable<String> task = () -> {
methodLevelCircuitBreakerBean.throwException(shouldThrowException);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
swarm:
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 3500 #MORE THAN AsynchronousTimeoutBean.AWAIT CONFIGURED IN TESTS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import javax.inject.Inject;

import org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
Expand All @@ -27,7 +28,8 @@ public class AsynchronousTimeoutBeanTest {
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class)
.addClasses(AsynchronousTimeoutBean.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsResource("project-defaults.yml");
}

/**
Expand All @@ -43,6 +45,10 @@ public void timeoutTest() throws InterruptedException, ExecutionException {
future.get();
} catch (TimeoutException toe) {
return;
} catch (ExecutionException ex) {
if (ex.getCause() instanceof TimeoutException) {
return;
}
}

Assert.fail();
Expand Down
9 changes: 0 additions & 9 deletions jwt-auth/jaxrs/src/main/resources/META-INF/MP-JWT-SIGNER

This file was deleted.

8 changes: 5 additions & 3 deletions jwt-auth/jaxrs/src/main/resources/project-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ swarm:
bind:
address: localhost
microprofile:
jwtauth:
jwt:
default-missing-method-permissions-deny-access: false
token:
issuedBy: "org.eclipse.microprofile12"
issued-by: "org.eclipse.microprofile12"
signer-pub-key: classpath:publicKey.pem
logging:
loggers:
io.undertow.request.security:
Expand All @@ -30,4 +32,4 @@ swarm:
code: org.wildfly.extension.undertow.security.jaspi.modules.HTTPSchemeServerAuthModule
module: org.wildfly.extension.undertow
flag: required
login-module-stack-ref: roles-lm-stack
login-module-stack-ref: roles-lm-stack
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ public static WebArchive createDeployment() {
// Payara Properties file configuring that "org.eclipse.microprofile12" is the valid issuer
"payara-mp-jwt.properties"
).addAsResource(
// WildFly file configuring that "org.eclipse.microprofile12" is the valid issuer and setting up
// Thorntail file configuring that "org.eclipse.microprofile12" is the valid issuer and setting up
// the security system (domain) such that all artifacts to support MP-Auth JWT are installed
"project-defaults.yml"
).addAsResource(
// Payara public key to verify the incoming signed JWT's signature
// Payara/Thorntail public key to verify the incoming signed JWT's signature
"publicKey.pem"
).addAsResource(
// WildFly public key to verify the incoming signed JWT's signature
"META-INF/MP-JWT-SIGNER"
).addAsResource(
// WildFly public key to verify the incoming signed JWT's signature
"jwt-roles.properties"
Expand Down
71 changes: 11 additions & 60 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<payara.version>5.182-SNAPSHOT</payara.version>
<payara.micro.version>5.182-SNAPSHOT</payara.micro.version>
<liberty.version>17.0.0.4</liberty.version>
<wildfly.version>2018.4.1</wildfly.version>
<thorntail.version>2.3.0.Final</thorntail.version>

<payara.container.version>1.0.Beta3</payara.container.version>
<payara.micro.container.version>5.Beta3-m3</payara.micro.container.version>
Expand Down Expand Up @@ -627,103 +627,54 @@



<!-- ### WildFly ### -->
<!-- ### Thorntail ### -->

<profile>
<id>wildfly-ci-managed</id>
<id>thorntail</id>

<!-- WildFly is very sensitive for the exact Arquillian version used.
If the version is not right, the Swarm connector will create 2 deployments
per test, which fails. -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.2.1.Final</version>
<groupId>io.thorntail</groupId>
<artifactId>bom</artifactId>
<version>${thorntail.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-test-api</artifactId>
<version>1.2.1.Final</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Needed for websocket tests that use ContainerProvider.getWebSocketContainer()
to connect from a the client to the websocket server. -->
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-websockets-jsr</artifactId>
<version>2.0.4.Final</version>
<scope>test</scope>
</dependency>

<!-- Needed for jaxrs tests that use ClientBuilder to connect from a
client to the JAX-RS server. -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.19.Final</version>
<scope>test</scope>
</dependency>

<!-- Without this exception will be thrown about missing tracef method -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.3.2.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>3.0.19.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-p-provider</artifactId>
<version>3.0.19.Final</version>
<scope>test</scope>
</dependency>

<!-- The actual Arquillian container, which also takes care of downloading
the server bits -->
<dependency>
<groupId>org.wildfly.swarm</groupId>
<groupId>io.thorntail</groupId>
<artifactId>arquillian</artifactId>
<version>${wildfly.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.wildfly.swarm</groupId>
<groupId>io.thorntail</groupId>
<artifactId>microprofile</artifactId>
<version>${wildfly.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- Uncomment to debug -->
<!-- <swarm.debug.port>5005</swarm.debug.port> -->
<arquillian.xml>arquillian-swarm.xml</arquillian.xml>
<!--<thorntail.debug.port>8000</thorntail.debug.port>-->
<arquillian.xml>arquillian-thorntail.xml</arquillian.xml>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>



<profile>
<id>nothing</id>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
- but arquillian.xml sets the default protocol to "Servlet 3.0" and there's no way to override that
- (see https://issues.jboss.org/browse/ARQ-579)
-->
<container qualifier="wildfly-swarm" default="true">
<container qualifier="thorntail" default="true">
<configuration>
<property name="host">localhost</property>
<property name="port">${swarm.arquillian.daemon.port:12345}</property>
<property name="port">${thorntail.arquillian.daemon.port:12345}</property>
</configuration>
</container>

Expand Down