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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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
Lines changed: 12 additions & 0 deletions
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

Lines changed: 8 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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);
Lines changed: 8 additions & 0 deletions
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

Lines changed: 7 additions & 1 deletion
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();

0 commit comments

Comments
 (0)