Skip to content

Commit b48a2e3

Browse files
authored
test(tomcat10): Restore Engine Integration Tests
Context: Tomcat 10, CDI and Weld Tests Fix: This commit includes a fix for the tests to load weld under the Tomcat lib folder instead of placing it into the WEB-INF/lib folder of the individual wars used by the tests. Related-to: #4434
1 parent 58a6857 commit b48a2e3

File tree

26 files changed

+257
-62
lines changed

26 files changed

+257
-62
lines changed

qa/integration-tests-engine-jakarta/pom.xml

+1-13
Original file line numberDiff line numberDiff line change
@@ -713,20 +713,8 @@
713713
<!-- TODO Please delete the following exclusions after the Tomcat 10 issue with Arquillian -->
714714
<!-- See Relevant issue: https://github.com/camunda/camunda-bpm-platform/issues/4434 -->
715715
<exclude>**/CallActivityContextSwitchTest.java</exclude>
716-
<exclude>**/TestMultipleClasspathRoots.java</exclude>
717-
<exclude>**/TestResourceName.java</exclude>
718-
<exclude>**/TestWarDeploymentDeployChangedOnlyWithJarAsLib.java</exclude>
719-
<exclude>**/TestWarDeploymentWithDiagram.java</exclude>
720-
<exclude>**/TestWarDeploymentWithoutDiagram.java</exclude>
721-
<exclude>**/TestWarDeploymentWithoutProcessDefinitions.java</exclude>
722-
<exclude>**/TestWarDeploymentWithoutProcessesXml.java</exclude>
723716
<exclude>**/CdiBeanCallActivityResolutionTest.java</exclude>
724-
<exclude>**/CdiBeanCaseTaskResolutionTest.java</exclude>
725-
<exclude>**/CallActivityContextSwitchTest.java</exclude>
726-
<exclude>**/FailingJobBoundaryTimerWithDelegateVariablesTest.java</exclude>
727-
<exclude>**/SignalEventCatchBoundaryWithVariablesTest.java</exclude>
728-
<exclude>**/TimerRecalculationTest.java</exclude>
729-
<exclude>**/CdiProcessApplicationEventSupportTest.java</exclude>
717+
730718
<!-- TODO and weld-servlet-shaded is resolved with integration-tests-engine-jakarta -->
731719

732720
</excludes>

qa/integration-tests-engine-jakarta/src/test/resources/org/camunda/bpm/integrationtest/beans.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
44
version="4.0" bean-discovery-mode="all">
5-
</beans>
5+
</beans>

qa/integration-tests-engine/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@
554554
</goals>
555555
<configuration>
556556
<sources>
557-
<source>src/test/java-tomcat</source>
557+
<source>src/test/java-tomcat9</source>
558558
</sources>
559559
</configuration>
560560
</execution>

qa/integration-tests-engine/src/test/java-tomcat/org/camunda/bpm/integrationtest/util/TestContainer.java

+23-7
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@
2525
*/
2626
public class TestContainer {
2727

28+
/**
29+
* In some scenarios, Tomcat 10 and Weld 5 have issues when the Weld library is embedded into the WAR.
30+
* To solve these issues, Weld is added to the Tomcat server libs folder.
31+
*/
32+
public static void addContainerSpecificResourcesEmbedCdiLib(WebArchive webArchive) {
33+
addContainerSpecificResources(webArchive);
34+
webArchive.addAsLibraries(DeploymentHelper.getWeld());
35+
}
36+
2837
public static void addContainerSpecificResources(WebArchive webArchive) {
2938
webArchive
30-
.addAsManifestResource("context.xml")
31-
.addAsLibraries(DeploymentHelper.getWeld())
32-
.addClass(TestProcessApplication.class)
33-
.addAsWebInfResource("web.xml");
39+
.addAsManifestResource("context.xml")
40+
.addClass(TestProcessApplication.class)
41+
.addAsWebInfResource("web.xml");
3442
}
3543

3644
public static void addContainerSpecificResourcesWithoutWeld(WebArchive webArchive) {
@@ -40,11 +48,19 @@ public static void addContainerSpecificResourcesWithoutWeld(WebArchive webArchiv
4048
.addAsWebInfResource("web-without-weld.xml", "web.xml");
4149
}
4250

51+
/**
52+
* In some scenarios, Tomcat 10 and Weld 5 have issues when the Weld library is embedded into the WAR.
53+
* To solve these issues, Weld is added to the Tomcat server libs folder.
54+
*/
55+
public static void addContainerSpecificResourcesForNonPaEmbedCdiLib(WebArchive webArchive) {
56+
addContainerSpecificResourcesForNonPa(webArchive);
57+
webArchive.addAsLibraries(DeploymentHelper.getWeld());
58+
}
59+
4360
public static void addContainerSpecificResourcesForNonPa(WebArchive webArchive) {
4461
webArchive
45-
.addAsManifestResource("context.xml")
46-
.addAsLibraries(DeploymentHelper.getWeld())
47-
.addAsWebInfResource("web.xml");
62+
.addAsManifestResource("context.xml")
63+
.addAsWebInfResource("web.xml");
4864
}
4965

5066
public static void addContainerSpecificResourcesForNonPaWithoutWeld(WebArchive webArchive) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3+
* under one or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information regarding copyright
5+
* ownership. Camunda licenses this file to you under the Apache License,
6+
* Version 2.0; you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.camunda.bpm.integrationtest.util;
18+
19+
/**
20+
* @author Thorben Lindhauer
21+
*
22+
*/
23+
public class TestConstants {
24+
25+
public final static String APP_NAME = "";
26+
public final static String PROCESS_ENGINE_SERVICE_JNDI_NAME = "java:comp/env/ProcessEngineService";
27+
public final static String PROCESS_APPLICATION_SERVICE_JNDI_NAME = "java:comp/env/ProcessApplicationService";
28+
29+
public static String getAppName() {
30+
return APP_NAME;
31+
}
32+
33+
public String getEngineService() {
34+
return PROCESS_ENGINE_SERVICE_JNDI_NAME;
35+
}
36+
37+
public String getProcessApplicationService() {
38+
return PROCESS_APPLICATION_SERVICE_JNDI_NAME;
39+
}
40+
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3+
* under one or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information regarding copyright
5+
* ownership. Camunda licenses this file to you under the Apache License,
6+
* Version 2.0; you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.camunda.bpm.integrationtest.util;
18+
19+
import org.jboss.shrinkwrap.api.spec.WebArchive;
20+
21+
/**
22+
* Tomcat test container.
23+
*
24+
* @author Daniel Meyer
25+
*/
26+
public class TestContainer {
27+
28+
/**
29+
* In some scenarios, Tomcat 10 and Weld 5 have issues when the Weld library is embedded into the WAR.
30+
* To solve these issues, Weld is added to the Tomcat server libs folder.
31+
*/
32+
public static void addContainerSpecificResourcesEmbedCdiLib(WebArchive webArchive) {
33+
addContainerSpecificResources(webArchive);
34+
}
35+
36+
public static void addContainerSpecificResources(WebArchive webArchive) {
37+
webArchive
38+
.addAsManifestResource("context.xml")
39+
.addClass(TestProcessApplication.class)
40+
.addAsWebInfResource("web.xml")
41+
.addAsLibraries(DeploymentHelper.getWeld());
42+
}
43+
44+
public static void addContainerSpecificResourcesWithoutWeld(WebArchive webArchive) {
45+
webArchive
46+
.addAsManifestResource("context.xml")
47+
.addClass(TestProcessApplication.class)
48+
.addAsWebInfResource("web-without-weld.xml", "web.xml");
49+
}
50+
51+
/**
52+
* In some scenarios, Tomcat 10 and Weld 5 have issues when the Weld library is embedded into the WAR.
53+
* To solve these issues, Weld is added to the Tomcat server libs folder.
54+
*/
55+
public static void addContainerSpecificResourcesForNonPaEmbedCdiLib(WebArchive webArchive) {
56+
addContainerSpecificResourcesForNonPa(webArchive);
57+
}
58+
59+
public static void addContainerSpecificResourcesForNonPa(WebArchive webArchive) {
60+
webArchive
61+
.addAsManifestResource("context.xml")
62+
.addAsWebInfResource("web.xml")
63+
.addAsLibraries(DeploymentHelper.getWeld());
64+
}
65+
66+
public static void addContainerSpecificResourcesForNonPaWithoutWeld(WebArchive webArchive) {
67+
webArchive
68+
.addAsManifestResource("context.xml")
69+
.addAsWebInfResource("web-without-weld.xml", "web.xml");
70+
}
71+
72+
public static void addContainerSpecificProcessEngineConfigurationClass(WebArchive deployment) {
73+
// nothing to do
74+
}
75+
76+
public static void addSpinJacksonJsonDataFormat(WebArchive webArchive) {
77+
webArchive.addAsLibraries(DeploymentHelper.getSpinJacksonJsonDataFormatForServer("tomcat"));
78+
}
79+
80+
public static void addJodaTimeJacksonModule(WebArchive webArchive) {
81+
webArchive.addAsLibraries(DeploymentHelper.getJodaTimeModuleForServer("tomcat"));
82+
}
83+
84+
public static void addCommonLoggingDependency(WebArchive webArchive) {
85+
// nothing to do
86+
}
87+
88+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3+
* under one or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information regarding copyright
5+
* ownership. Camunda licenses this file to you under the Apache License,
6+
* Version 2.0; you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.camunda.bpm.integrationtest.util;
18+
19+
import org.camunda.bpm.application.ProcessApplication;
20+
import org.camunda.bpm.application.impl.ServletProcessApplication;
21+
22+
/**
23+
* @author Daniel Meyer
24+
*
25+
*/
26+
@ProcessApplication
27+
// Using fully-qualified class name instead of import statement to allow for automatic Jakarta transformation
28+
public class TestProcessApplication extends org.camunda.bpm.application.impl.ServletProcessApplication {
29+
30+
}

qa/integration-tests-engine/src/test/java-wildfly26-servlet/org/camunda/bpm/integrationtest/util/TestContainer.java

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
*/
2727
public class TestContainer {
2828

29+
public static void addContainerSpecificResourcesEmbedCdiLib(WebArchive webArchive) {
30+
addContainerSpecificResources(webArchive);
31+
}
32+
2933
public static void addContainerSpecificResources(WebArchive archive) {
3034
addContainerSpecificResourcesWithoutWeld(archive);
3135
}
@@ -34,6 +38,10 @@ public static void addContainerSpecificResourcesWithoutWeld(WebArchive webArchiv
3438
webArchive.addClass(TestProcessApplication.class);
3539
}
3640

41+
public static void addContainerSpecificResourcesForNonPaEmbedCdiLib(WebArchive webArchive) {
42+
addContainerSpecificResourcesForNonPa(webArchive);
43+
}
44+
3745
public static void addContainerSpecificResourcesForNonPa(WebArchive webArchive) {
3846
addContainerSpecificResourcesForNonPaWithoutWeld(webArchive);
3947
}

qa/integration-tests-engine/src/test/java-wildfly26/org/camunda/bpm/integrationtest/util/TestContainer.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
*/
2626
public class TestContainer {
2727

28+
public static void addContainerSpecificResourcesEmbedCdiLib(WebArchive webArchive) {
29+
addContainerSpecificResources(webArchive);
30+
}
31+
2832
public static void addContainerSpecificResources(WebArchive webArchive) {
2933
addContainerSpecificResourcesWithoutWeld(webArchive);
3034
}
@@ -33,6 +37,10 @@ public static void addContainerSpecificResourcesWithoutWeld(WebArchive webArchiv
3337
webArchive.addAsLibraries(DeploymentHelper.getEjbClient());
3438
}
3539

40+
public static void addContainerSpecificResourcesForNonPaEmbedCdiLib(WebArchive webArchive) {
41+
addContainerSpecificResourcesForNonPa(webArchive);
42+
}
43+
3644
public static void addContainerSpecificResourcesForNonPa(WebArchive webArchive) {
3745
addContainerSpecificResourcesForNonPaWithoutWeld(webArchive);
3846
}
@@ -56,4 +64,4 @@ public static void addJodaTimeJacksonModule(WebArchive webArchive) {
5664
public static void addCommonLoggingDependency(WebArchive webArchive) {
5765
webArchive.addAsManifestResource("jboss-deployment-structure-with-commons-logging.xml", "jboss-deployment-structure.xml");
5866
}
59-
}
67+
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/deployment/war/TestWarDeploymentWithoutProcessesXml.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static WebArchive processArchive() {
4343
.addAsWebInfResource("org/camunda/bpm/integrationtest/beans.xml", "beans.xml")
4444
.addAsLibraries(DeploymentHelper.getEngineCdi())
4545
.addClass(AbstractFoxPlatformIntegrationTest.class);
46-
46+
4747
TestContainer.addContainerSpecificResources(deployment);
4848

4949
return deployment;

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/cdi/CdiBeanCaseTaskResolutionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static WebArchive clientDeployment() {
6060
.addClass(AbstractFoxPlatformIntegrationTest.class)
6161
.addAsLibraries(DeploymentHelper.getEngineCdi());
6262

63-
TestContainer.addContainerSpecificResourcesForNonPa(deployment);
63+
TestContainer.addContainerSpecificResourcesForNonPaEmbedCdiLib(deployment);
6464

6565
return deployment;
6666
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/cdi/CdiBeanDependentScopedAsyncTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static WebArchive clientDeployment() {
5353
.addClass(DependentScopedBean.class)
5454
.addAsLibraries(DeploymentHelper.getEngineCdi());
5555

56-
TestContainer.addContainerSpecificResourcesForNonPa(deployment);
56+
TestContainer.addContainerSpecificResourcesForNonPaEmbedCdiLib(deployment);
5757

5858
return deployment;
5959
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/cdi/CdiBeanDependentScopedSyncTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static WebArchive clientDeployment() {
5353
.addClass(DependentScopedBean.class)
5454
.addAsLibraries(DeploymentHelper.getEngineCdi());
5555

56-
TestContainer.addContainerSpecificResourcesForNonPa(deployment);
56+
TestContainer.addContainerSpecificResourcesForNonPaEmbedCdiLib(deployment);
5757

5858
return deployment;
5959
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/cdi/CdiBeanResolutionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static WebArchive clientDeployment() {
6060
.addClass(AbstractFoxPlatformIntegrationTest.class)
6161
.addAsLibraries(DeploymentHelper.getEngineCdi());
6262

63-
TestContainer.addContainerSpecificResourcesForNonPa(deployment);
63+
TestContainer.addContainerSpecificResourcesForNonPaEmbedCdiLib(deployment);
6464

6565
return deployment;
6666
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/cdi/CdiBeanSignallableActivityBehaviorResolutionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static WebArchive clientDeployment() {
5454
.addClass(AbstractFoxPlatformIntegrationTest.class)
5555
.addAsLibraries(DeploymentHelper.getEngineCdi());
5656

57-
TestContainer.addContainerSpecificResourcesForNonPa(deployment);
57+
TestContainer.addContainerSpecificResourcesForNonPaEmbedCdiLib(deployment);
5858

5959
return deployment;
6060
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/cdi/CdiCallActivityVersionTagTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static WebArchive clientDeployment() {
4949
.addClass(AbstractFoxPlatformIntegrationTest.class)
5050
.addAsLibraries(DeploymentHelper.getEngineCdi());
5151

52-
TestContainer.addContainerSpecificResourcesForNonPa(deployment);
52+
TestContainer.addContainerSpecificResourcesForNonPaEmbedCdiLib(deployment);
5353

5454
return deployment;
5555
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/cdi/CdiDelegateBeanResolutionTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.junit.Test;
3131
import org.junit.runner.RunWith;
3232

33-
3433
/**
3534
* <p>Deploys two different applications, a process archive and a cleint application.</p>
3635
*
@@ -61,7 +60,7 @@ public static WebArchive clientDeployment() {
6160
.addClass(AbstractFoxPlatformIntegrationTest.class)
6261
.addAsLibraries(DeploymentHelper.getEngineCdi());
6362

64-
TestContainer.addContainerSpecificResources(webArchive);
63+
TestContainer.addContainerSpecificResourcesEmbedCdiLib(webArchive);
6564

6665
return webArchive;
6766
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/cdi/CdiRetryConfigurationTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static WebArchive clientDeployment() {
5353
.addClass(DependentScopedBean.class)
5454
.addAsLibraries(DeploymentHelper.getEngineCdi());
5555

56-
TestContainer.addContainerSpecificResourcesForNonPa(deployment);
56+
TestContainer.addContainerSpecificResourcesForNonPaEmbedCdiLib(deployment);
5757

5858
return deployment;
5959
}

qa/integration-tests-engine/src/test/java/org/camunda/bpm/integrationtest/functional/classloading/jobexecution/ClassloadingByJobPriorityTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ protected static Asset modelAsAsset(BpmnModelInstance modelInstance) {
9090
return new ByteArrayAsset(bytes);
9191
}
9292

93-
}
93+
}

0 commit comments

Comments
 (0)