Skip to content

Commit 040cd88

Browse files
committed
Upgrade Wildfly Swarm to Thorntail
1 parent 41636ec commit 040cd88

File tree

15 files changed

+73
-91
lines changed

15 files changed

+73
-91
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ These are the available container profiles:
3838
This profile uses the special "wlp-microProfile1" distribution of Liberty, which contains the MicroProfile APIs out of the box
3939
and start up the server per sample.
4040
Useful for CI servers. The Liberty version that's used can be set via the ``liberty.version`` property.
41-
* WildFly
42-
* ``wildfly-ci-managed``
41+
* Thorntail
42+
* ``thorntail``
4343

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

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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
swarm:
2+
hystrix:
3+
command:
4+
default:
5+
execution:
6+
isolation:
7+
thread:
8+
timeoutInMilliseconds: 3500 #MORE THAN MyAsyncBean*Level.AWAIT CONFIGURED IN TESTS

fault-tolerance/asynchronous/src/test/java/org/eclipse/microprofile12/faulttolerance/asynchronous/AsyncClassBeanTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public static WebArchive createDeployment() {
3636
return create(WebArchive.class)
3737
.addAsLibraries(awaitability())
3838
.addClasses(MyAsyncBeanClassLevel.class)
39-
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
39+
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
40+
.addAsResource("project-defaults.yml");
4041
}
4142

4243
@Test

fault-tolerance/asynchronous/src/test/java/org/eclipse/microprofile12/faulttolerance/asynchronous/AsyncMethodBeanTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public static WebArchive createDeployment() {
3636
return create(WebArchive.class)
3737
.addAsLibraries(awaitability())
3838
.addClasses(MyAsyncBeanMethodLevel.class)
39-
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
39+
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
40+
.addAsResource("project-defaults.yml");
4041
}
4142

4243
@Test // Runs on Server
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
swarm:
2+
hystrix:
3+
threadpool:
4+
default:
5+
maximumSize: 10 #SHOULD BE >= AsynchronousBulkheadBean @Bulkead value + @Bulkhead waitingTaskQueue
6+
allowMaximumSizeToDivergeFromCoreSize: true
7+
command:
8+
default:
9+
execution:
10+
isolation:
11+
thread:
12+
timeoutInMilliseconds: 21500 #MORE THAN (AsynchronousBulkheadBean @Bulkead value + @Bulkhead waitingTaskQueue -1) * AsynchronousBulkheadBean.AWAIT

fault-tolerance/bulkhead/src/test/java/org/eclipse/microprofile12/faulttolerance/bulkhead/AsynchronousBulkheadBeanTest.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public class AsynchronousBulkheadBeanTest {
3333
public static WebArchive createDeployment() {
3434
return ShrinkWrap.create(WebArchive.class)
3535
.addClasses(AsynchronousBulkheadBean.class)
36-
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
36+
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
37+
.addAsResource("project-defaults.yml");
3738
}
3839

3940
/**
@@ -104,8 +105,12 @@ public void bulkheadLimitTest() throws NoSuchMethodException {
104105
Logger.getLogger(AsynchronousBulkheadBeanTest.class.getName()).log(Level.SEVERE, null, ie);
105106
Assert.fail("Got an unexpected InterruptedException");
106107
} catch (ExecutionException ex) {
107-
Logger.getLogger(AsynchronousBulkheadBeanTest.class.getName()).log(Level.SEVERE, null, ex);
108-
Assert.fail("Got an unexpected ExecutionException");
108+
if (ex.getCause() instanceof BulkheadException) {
109+
failures ++;
110+
} else {
111+
Logger.getLogger(AsynchronousBulkheadBeanTest.class.getName()).log(Level.SEVERE, null, ex);
112+
Assert.fail("Got an unexpected ExecutionException");
113+
}
109114
} catch (BulkheadException be) {
110115
failures ++;
111116
}

fault-tolerance/circuitbreaker/src/test/java/org/eclipse/microprofile12/faulttolerance/circuitbreaker/ClassLevelCircuitBreakerBeanTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private List<Future<String>> executeThrowExceptionMethodAsynchronously(int itera
116116
boolean shouldThrowException) {
117117
List<Future<String>> futures = new ArrayList<>();
118118

119-
ExecutorService executorService = Executors.newFixedThreadPool(iterations);
119+
ExecutorService executorService = Executors.newSingleThreadExecutor();
120120

121121
Callable<String> task = () -> {
122122
classLevelCircuitBreakerBean.throwException(shouldThrowException);

fault-tolerance/circuitbreaker/src/test/java/org/eclipse/microprofile12/faulttolerance/circuitbreaker/MethodLevelCircuitBreakerBeanTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private List<Future<String>> executeThrowExceptionMethodAsynchronously(int itera
141141
boolean shouldThrowException) {
142142
List<Future<String>> futures = new ArrayList<>();
143143

144-
ExecutorService executorService = Executors.newFixedThreadPool(iterations);
144+
ExecutorService executorService = Executors.newSingleThreadExecutor();
145145

146146
Callable<String> task = () -> {
147147
methodLevelCircuitBreakerBean.throwException(shouldThrowException);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
swarm:
2+
hystrix:
3+
command:
4+
default:
5+
execution:
6+
isolation:
7+
thread:
8+
timeoutInMilliseconds: 3500 #MORE THAN AsynchronousTimeoutBean.AWAIT CONFIGURED IN TESTS

fault-tolerance/timeout/src/test/java/org/eclipse/microprofile/samples12/timeout/AsynchronousTimeoutBeanTest.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.concurrent.ExecutionException;
44
import java.util.concurrent.Future;
55
import javax.inject.Inject;
6+
67
import org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException;
78
import org.jboss.arquillian.container.test.api.Deployment;
89
import org.jboss.arquillian.junit.Arquillian;
@@ -27,7 +28,8 @@ public class AsynchronousTimeoutBeanTest {
2728
public static WebArchive createDeployment() {
2829
return ShrinkWrap.create(WebArchive.class)
2930
.addClasses(AsynchronousTimeoutBean.class)
30-
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
31+
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
32+
.addAsResource("project-defaults.yml");
3133
}
3234

3335
/**
@@ -43,6 +45,10 @@ public void timeoutTest() throws InterruptedException, ExecutionException {
4345
future.get();
4446
} catch (TimeoutException toe) {
4547
return;
48+
} catch (ExecutionException ex) {
49+
if (ex.getCause() instanceof TimeoutException) {
50+
return;
51+
}
4652
}
4753

4854
Assert.fail();

jwt-auth/jaxrs/src/main/resources/META-INF/MP-JWT-SIGNER

-9
This file was deleted.

jwt-auth/jaxrs/src/main/resources/project-defaults.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ swarm:
44
bind:
55
address: localhost
66
microprofile:
7-
jwtauth:
7+
jwt:
8+
default-missing-method-permissions-deny-access: false
89
token:
9-
issuedBy: "org.eclipse.microprofile12"
10+
issued-by: "org.eclipse.microprofile12"
11+
signer-pub-key: classpath:publicKey.pem
1012
logging:
1113
loggers:
1214
io.undertow.request.security:
@@ -30,4 +32,4 @@ swarm:
3032
code: org.wildfly.extension.undertow.security.jaspi.modules.HTTPSchemeServerAuthModule
3133
module: org.wildfly.extension.undertow
3234
flag: required
33-
login-module-stack-ref: roles-lm-stack
35+
login-module-stack-ref: roles-lm-stack

jwt-auth/jaxrs/src/test/java/org/eclipse/microprofile12/jwtauth/jaxrs/JaxRsTest.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,12 @@ public static WebArchive createDeployment() {
4444
// Payara Properties file configuring that "org.eclipse.microprofile12" is the valid issuer
4545
"payara-mp-jwt.properties"
4646
).addAsResource(
47-
// WildFly file configuring that "org.eclipse.microprofile12" is the valid issuer and setting up
47+
// Thorntail file configuring that "org.eclipse.microprofile12" is the valid issuer and setting up
4848
// the security system (domain) such that all artifacts to support MP-Auth JWT are installed
4949
"project-defaults.yml"
5050
).addAsResource(
51-
// Payara public key to verify the incoming signed JWT's signature
51+
// Payara/Thorntail public key to verify the incoming signed JWT's signature
5252
"publicKey.pem"
53-
).addAsResource(
54-
// WildFly public key to verify the incoming signed JWT's signature
55-
"META-INF/MP-JWT-SIGNER"
5653
).addAsResource(
5754
// WildFly public key to verify the incoming signed JWT's signature
5855
"jwt-roles.properties"

pom.xml

+11-60
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<payara.version>5.182-SNAPSHOT</payara.version>
3636
<payara.micro.version>5.182-SNAPSHOT</payara.micro.version>
3737
<liberty.version>17.0.0.4</liberty.version>
38-
<wildfly.version>2018.4.1</wildfly.version>
38+
<thorntail.version>2.3.0.Final</thorntail.version>
3939

4040
<payara.container.version>1.0.Beta3</payara.container.version>
4141
<payara.micro.container.version>5.Beta3-m3</payara.micro.container.version>
@@ -627,103 +627,54 @@
627627

628628

629629

630-
<!-- ### WildFly ### -->
630+
<!-- ### Thorntail ### -->
631631

632632
<profile>
633-
<id>wildfly-ci-managed</id>
633+
<id>thorntail</id>
634634

635-
<!-- WildFly is very sensitive for the exact Arquillian version used.
636-
If the version is not right, the Swarm connector will create 2 deployments
637-
per test, which fails. -->
638635
<dependencyManagement>
639636
<dependencies>
640637
<dependency>
641-
<groupId>org.jboss.arquillian</groupId>
642-
<artifactId>arquillian-bom</artifactId>
643-
<version>1.2.1.Final</version>
638+
<groupId>io.thorntail</groupId>
639+
<artifactId>bom</artifactId>
640+
<version>${thorntail.version}</version>
644641
<scope>import</scope>
645642
<type>pom</type>
646643
</dependency>
647-
<dependency>
648-
<groupId>org.jboss.arquillian.container</groupId>
649-
<artifactId>arquillian-container-test-api</artifactId>
650-
<version>1.2.1.Final</version>
651-
</dependency>
652644
</dependencies>
653645
</dependencyManagement>
654646

655647
<dependencies>
656-
<!-- Needed for websocket tests that use ContainerProvider.getWebSocketContainer()
657-
to connect from a the client to the websocket server. -->
658-
<dependency>
659-
<groupId>io.undertow</groupId>
660-
<artifactId>undertow-websockets-jsr</artifactId>
661-
<version>2.0.4.Final</version>
662-
<scope>test</scope>
663-
</dependency>
664-
665-
<!-- Needed for jaxrs tests that use ClientBuilder to connect from a
666-
client to the JAX-RS server. -->
667-
<dependency>
668-
<groupId>org.jboss.resteasy</groupId>
669-
<artifactId>resteasy-client</artifactId>
670-
<version>3.0.19.Final</version>
671-
<scope>test</scope>
672-
</dependency>
673-
674-
<!-- Without this exception will be thrown about missing tracef method -->
675-
<dependency>
676-
<groupId>org.jboss.logging</groupId>
677-
<artifactId>jboss-logging</artifactId>
678-
<version>3.3.2.Final</version>
679-
<scope>test</scope>
680-
</dependency>
681-
<dependency>
682-
<groupId>org.jboss.resteasy</groupId>
683-
<artifactId>resteasy-jaxb-provider</artifactId>
684-
<version>3.0.19.Final</version>
685-
<scope>test</scope>
686-
</dependency>
687-
<dependency>
688-
<groupId>org.jboss.resteasy</groupId>
689-
<artifactId>resteasy-json-p-provider</artifactId>
690-
<version>3.0.19.Final</version>
691-
<scope>test</scope>
692-
</dependency>
693648

694649
<!-- The actual Arquillian container, which also takes care of downloading
695650
the server bits -->
696651
<dependency>
697-
<groupId>org.wildfly.swarm</groupId>
652+
<groupId>io.thorntail</groupId>
698653
<artifactId>arquillian</artifactId>
699-
<version>${wildfly.version}</version>
700654
<scope>test</scope>
701655
</dependency>
702-
703656
<dependency>
704-
<groupId>org.wildfly.swarm</groupId>
657+
<groupId>io.thorntail</groupId>
705658
<artifactId>microprofile</artifactId>
706-
<version>${wildfly.version}</version>
707659
</dependency>
708660
</dependencies>
661+
709662
<build>
710663
<plugins>
711664
<plugin>
712665
<artifactId>maven-surefire-plugin</artifactId>
713666
<configuration>
714667
<systemPropertyVariables>
715668
<!-- Uncomment to debug -->
716-
<!-- <swarm.debug.port>5005</swarm.debug.port> -->
717-
<arquillian.xml>arquillian-swarm.xml</arquillian.xml>
669+
<!--<thorntail.debug.port>8000</thorntail.debug.port>-->
670+
<arquillian.xml>arquillian-thorntail.xml</arquillian.xml>
718671
</systemPropertyVariables>
719672
</configuration>
720673
</plugin>
721674
</plugins>
722675
</build>
723676
</profile>
724677

725-
726-
727678
<profile>
728679
<id>nothing</id>
729680
</profile>

test-utils/src/main/resources/arquillian-swarm.xml renamed to test-utils/src/main/resources/arquillian-thorntail.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
- but arquillian.xml sets the default protocol to "Servlet 3.0" and there's no way to override that
99
- (see https://issues.jboss.org/browse/ARQ-579)
1010
-->
11-
<container qualifier="wildfly-swarm" default="true">
11+
<container qualifier="thorntail" default="true">
1212
<configuration>
1313
<property name="host">localhost</property>
14-
<property name="port">${swarm.arquillian.daemon.port:12345}</property>
14+
<property name="port">${thorntail.arquillian.daemon.port:12345}</property>
1515
</configuration>
1616
</container>
1717

0 commit comments

Comments
 (0)