workaround that payara doesnt pass cdicontainer.version to single tests
diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc007/MethodLevelInterceptorTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc007/MethodLevelInterceptorTest.java
index 3ceacc4..8d9b5d1 100644
--- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc007/MethodLevelInterceptorTest.java
+++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc007/MethodLevelInterceptorTest.java
@@ -19,6 +19,7 @@
package org.apache.deltaspike.test.core.api.partialbean.uc007;
import org.apache.deltaspike.core.api.provider.BeanProvider;
+import org.apache.deltaspike.core.util.ClassUtils;
import org.apache.deltaspike.test.core.api.partialbean.shared.CustomInterceptorImpl;
import org.apache.deltaspike.test.core.api.partialbean.shared.CustomInterceptorState;
import org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding;
@@ -77,6 +78,12 @@
// this test is known to not work under weld-5.0.x
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_5_0));
+ // workaround as payara doesnt pass cdicontainer.version to the arquillian process
+ if (ClassUtils.tryToLoadClassForName("org.apache.deltaspike.test.core.api.partialbean.uc007.PartialBean") == null)
+ {
+ return;
+ }
+
PartialBean partialBean = BeanProvider.getContextualReference(PartialBean.class);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
@@ -91,6 +98,12 @@
// this test is known to not work under weld-5.0.x
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_5_0));
+ // workaround as payara doesnt pass cdicontainer.version to the arquillian process
+ if (ClassUtils.tryToLoadClassForName("org.apache.deltaspike.test.core.api.partialbean.uc007.PartialBean") == null)
+ {
+ return;
+ }
+
PartialBean partialBean = BeanProvider.getContextualReference(PartialBean.class);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
@@ -105,6 +118,12 @@
// this test is known to not work under weld-5.0.x
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_5_0));
+ // workaround as payara doesnt pass cdicontainer.version to the arquillian process
+ if (ClassUtils.tryToLoadClassForName("org.apache.deltaspike.test.core.api.partialbean.uc007.PartialBean") == null)
+ {
+ return;
+ }
+
PartialBean partialBean = BeanProvider.getContextualReference(PartialBean.class);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008/ClassLevelInterceptorTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008/ClassLevelInterceptorTest.java
index ba9dbca..cbcfdfe 100644
--- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008/ClassLevelInterceptorTest.java
+++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008/ClassLevelInterceptorTest.java
@@ -18,9 +18,10 @@
*/
package org.apache.deltaspike.test.core.api.partialbean.uc008;
+import org.apache.deltaspike.core.api.provider.BeanProvider;
+import org.apache.deltaspike.core.util.ClassUtils;
import org.apache.deltaspike.test.core.api.partialbean.shared.CustomInterceptorImpl;
import org.apache.deltaspike.test.core.api.partialbean.shared.CustomInterceptorState;
-import org.apache.deltaspike.core.api.provider.BeanProvider;
import org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding;
import org.apache.deltaspike.test.core.api.partialbean.util.ArchiveUtils;
import org.apache.deltaspike.test.utils.CdiContainerUnderTest;
@@ -77,6 +78,12 @@
// this test is known to not work under weld-5.0.x
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_5_0));
+ // workaround as payara doesnt pass cdicontainer.version to the arquillian process
+ if (ClassUtils.tryToLoadClassForName("org.apache.deltaspike.test.core.api.partialbean.uc008.PartialBean") == null)
+ {
+ return;
+ }
+
PartialBean partialBean = BeanProvider.getContextualReference(PartialBean.class);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
@@ -92,7 +99,13 @@
// this test is known to not work under weld-5.0.x
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_5_0));
- PartialBean partialBean = BeanProvider.getContextualReference(PartialBean.class);
+ // workaround as payara doesnt pass cdicontainer.version to the arquillian process
+ if (ClassUtils.tryToLoadClassForName("org.apache.deltaspike.test.core.api.partialbean.uc008.PartialBean") == null)
+ {
+ return;
+ }
+
+ PartialBean partialBean = BeanProvider.getContextualReference(PartialBean.class, true);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
Assert.assertNotNull(partialBean);
diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java
index 21aa422..e7a1fc2 100644
--- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java
+++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java
@@ -20,6 +20,7 @@
import jakarta.enterprise.inject.spi.Extension;
import org.apache.deltaspike.core.api.provider.BeanProvider;
+import org.apache.deltaspike.core.util.ClassUtils;
import org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding;
import org.apache.deltaspike.test.core.api.partialbean.util.ArchiveUtils;
import org.apache.deltaspike.test.utils.CdiContainerUnderTest;
@@ -79,6 +80,12 @@
// this test is known to not work under weld
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD));
+ // workaround as payara doesnt pass cdicontainer.version to the arquillian process
+ if (ClassUtils.tryToLoadClassForName("org.apache.deltaspike.test.core.api.partialbean.uc013.MyRepository") == null)
+ {
+ return;
+ }
+
MyRepository myRepository = BeanProvider.getContextualReference(MyRepository.class);
List<String> users = myRepository.getAllUsers();
diff --git a/deltaspike/test-utils/src/main/resources/arquillian.xml b/deltaspike/test-utils/src/main/resources/arquillian.xml
index 7219826..c2d04d2 100644
--- a/deltaspike/test-utils/src/main/resources/arquillian.xml
+++ b/deltaspike/test-utils/src/main/resources/arquillian.xml
@@ -66,7 +66,7 @@
<property name="ajpPort">-1</property>
<property name="stopPort">-1</property>
<property name="appWorkingDir">target/arquillian-test-working-dir</property>
- <property name="catalina_opts">-Dcdicontainer.version=tomee-${tomee.version}</property>
+ <property name="catalina_opts">-Dcdicontainer.version=${cdicontainer.version}</property>
<property name="simpleLog">true</property>
<!-- In-Memory database for the data module -->
@@ -94,5 +94,4 @@
</configuration>
</container>
-
</arquillian>