Skip to content

Commit

Permalink
updated weld excludes
Browse files Browse the repository at this point in the history
  • Loading branch information
tandraschko committed Mar 18, 2024
1 parent db1d12d commit 1e79f8f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@RunWith(Arquillian.class)
public class MethodLevelInterceptorTest
{
public static final String CONTAINER_WELD_2_0_0 = "weld-2\\.0\\.0\\..*";
public static final String CONTAINER_WELD_5_0 = "weld-5\\.0\\..*";

@Deployment
public static WebArchive war()
Expand All @@ -54,7 +54,7 @@ public static WebArchive war()
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);

//don't create a completely empty web-archive
if (CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0))
if (CdiContainerUnderTest.is(CONTAINER_WELD_5_0))
{
return ShrinkWrap.create(WebArchive.class, archiveName + ".war")
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive());
Expand All @@ -74,8 +74,8 @@ public static WebArchive war()
@Test
public void testMethodLevelInterceptor() throws Exception
{
// this test is known to not work under weld-2.0.0.Final and weld-2.0.0.SP1
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0));
// 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);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
Expand All @@ -88,8 +88,8 @@ public void testMethodLevelInterceptor() throws Exception
@Test
public void testMethodLevelInterceptorStereotype() throws Exception
{
// this test is known to not work under weld-2.0.0.Final and weld-2.0.0.SP1
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0));
// 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);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
Expand All @@ -102,8 +102,8 @@ public void testMethodLevelInterceptorStereotype() throws Exception
@Test
public void testMethodLevelInterceptorOnAbstractMethod() throws Exception
{
// this test is known to not work under weld-2.0.0.Final and weld-2.0.0.SP1
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0));
// 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);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@RunWith(Arquillian.class)
public class ClassLevelInterceptorTest
{
public static final String CONTAINER_WELD_2_0_0 = "weld-2\\.0\\.0\\..*";
public static final String CONTAINER_WELD_5_0 = "weld-5\\.0\\..*";

@Deployment
public static WebArchive war()
Expand All @@ -54,7 +54,7 @@ public static WebArchive war()
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);

//don't create a completely empty web-archive
if (CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0))
if (CdiContainerUnderTest.is(CONTAINER_WELD_5_0))
{
return ShrinkWrap.create(WebArchive.class, archiveName + ".war")
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive());
Expand All @@ -74,8 +74,8 @@ public static WebArchive war()
@Test
public void testClassLevelInterceptor() throws Exception
{
// this test is known to not work under weld-2.0.0.Final and weld-2.0.0.SP1
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0));
// 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);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
Expand All @@ -89,8 +89,8 @@ public void testClassLevelInterceptor() throws Exception
@Test
public void testClassLevelInterceptorOnAbstractMethod() throws Exception
{
// this test is known to not work under weld-2.0.0.Final and weld-2.0.0.SP1
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0));
// 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);
CustomInterceptorState state = BeanProvider.getContextualReference(CustomInterceptorState.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.deltaspike.test.core.api.partialbean.uc013;

import java.util.List;
import jakarta.enterprise.inject.spi.Extension;
import org.apache.deltaspike.core.api.provider.BeanProvider;
import org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding;
Expand All @@ -36,10 +35,12 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.List;

@RunWith(Arquillian.class)
public class MethodLevelInterceptorTest
{
public static final String CONTAINER_WELD_2_0_0 = "weld-2\\.0\\.0\\..*";
public static final String CONTAINER_WELD = "weld-.*";

@Deployment
public static WebArchive war()
Expand All @@ -54,7 +55,7 @@ public static WebArchive war()
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);

//don't create a completely empty web-archive
if (CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0))
if (CdiContainerUnderTest.is(CONTAINER_WELD))
{
return ShrinkWrap.create(WebArchive.class, archiveName + ".war")
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive());
Expand All @@ -75,8 +76,8 @@ public static WebArchive war()
@Test
public void testMethodLevelInterceptor() throws Exception
{
// this test is known to not work under weld-2.0.0.Final and weld-2.0.0.SP1
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0));
// this test is known to not work under weld
Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD));

MyRepository myRepository = BeanProvider.getContextualReference(MyRepository.class);

Expand Down

0 comments on commit 1e79f8f

Please sign in to comment.