Skip to content

Commit

Permalink
some cleanup and fixed cdicontainer.version
Browse files Browse the repository at this point in the history
  • Loading branch information
tandraschko committed Feb 27, 2024
1 parent 1ae58f8 commit 1e158bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
import org.apache.deltaspike.core.api.provider.BeanProvider;
import org.apache.deltaspike.core.api.provider.DependentProvider;
import org.apache.deltaspike.test.util.ArchiveUtils;
import org.apache.deltaspike.test.utils.CdiContainerUnderTest;
import org.apache.deltaspike.test.utils.Serializer;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -42,9 +40,6 @@
@RunWith(Arquillian.class)
public class BeanProviderTest
{
private static final String CONTAINER_OWB_1_1_x = "owb-1\\.1\\..*";
private static final String CONTAINER_TOMEE_1_5_x = "tomee-1\\.5\\..*";


/**
*X TODO creating a WebArchive is only a workaround because JavaArchive cannot contain other archives.
Expand Down Expand Up @@ -221,10 +216,6 @@ public void testNamedDependentBeanResolving() throws Exception
@Test
public void testDependentBeanSerialization() throws Exception
{
// this test is known to not work under owb-1.1.x as ManagedBean for Dependent scoped classes did not implement PassivationCapable.
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_OWB_1_1_x));
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_TOMEE_1_5_x));

DependentProvider<DependentTestBean> dependentTestBeanProvider = BeanProvider.getDependent(DependentTestBean.class);

Serializer<DependentProvider<DependentTestBean>> serializer = new Serializer<DependentProvider<DependentTestBean>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,14 @@
package org.apache.deltaspike.test.core.impl.custom.spi;

import org.apache.deltaspike.core.util.ServiceUtils;
import org.apache.deltaspike.test.utils.CdiContainerUnderTest;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;

public abstract class ServiceUtilsTest
{
private static final String CONTAINER_OWB_1_1_x = "owb-1\\.1\\..*";
private static final String CONTAINER_OWB_1_2_0 = "owb-1\\.2\\.0";

@Test
public void lookupOfSpiImplementations()
{
//exclude it due to an issue with the arquillian-adapter for owb 1.1.x and 1.2.0
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_OWB_1_1_x) &&
!CdiContainerUnderTest.is(CONTAINER_OWB_1_2_0));

Assert.assertTrue(ServiceUtils.loadServiceImplementations(MyInterface.class).iterator().hasNext());

Assert.assertNotNull(ServiceUtils.loadServiceImplementations(MyInterface.class));
Expand Down
12 changes: 6 additions & 6 deletions deltaspike/parent/code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
<properties>
<jakartaeeapi.version>10.0-M2</jakartaeeapi.version>
<owb.version>4.0.2</owb.version>
<cdicontainer.version>tomee-${tomee.version}</cdicontainer.version>
<cdicontainer.version>owb-${owb.version}</cdicontainer.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -583,7 +583,7 @@
<properties>
<!-- Actual default Weld version used with this profile -->
<weld.version>5.1.2.Final</weld.version>
<cdicontainer.version>wildfly-${wildfly.version}</cdicontainer.version>
<cdicontainer.version>weld-${weld.version}</cdicontainer.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -653,7 +653,7 @@
<properties>
<!-- Actual default Weld version used with this profile -->
<weld.version>5.1.2.Final</weld.version>
<cdicontainer.version>wildfly-${wildfly.version}</cdicontainer.version>
<cdicontainer.version>weld-${weld.version}</cdicontainer.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -747,7 +747,7 @@
<!-- Wildfly must be started manually for this work correctly - for debug hints see arquillian-jboss.xml -->

<properties>
<cdicontainer.version>wildfly-${wildfly.version}</cdicontainer.version>
<cdicontainer.version>weld-${weld.version}</cdicontainer.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -811,7 +811,7 @@

<properties>
<weld.version>5.0.1.Final</weld.version>
<cdicontainer.version>payara-${payara.version}</cdicontainer.version>
<cdicontainer.version>weld-${weld.version}</cdicontainer.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -870,7 +870,7 @@

<properties>
<weld.version>5.0.1.Final</weld.version>
<cdicontainer.version>payara-${payara.version}</cdicontainer.version>
<cdicontainer.version>weld-${weld.version}</cdicontainer.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,4 @@ public ClassLoader run()
}
}
}

public static boolean isNotTomEE()
{
return !System.getProperty("cdicontainer.version").startsWith("tomee");
}
}

0 comments on commit 1e158bf

Please sign in to comment.