Skip to content

Commit

Permalink
Move test for BM passivation into CDI_FULL test group
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn authored and Ladicek committed Jan 31, 2023
1 parent 0dfbf03 commit 10a9539
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static org.jboss.cdi.tck.TestGroups.CDI_FULL;
import static org.jboss.cdi.tck.cdi.Sections.BEANMANAGER;
import static org.jboss.cdi.tck.cdi.Sections.BM_DETERMINING_ANNOTATION;
import static org.jboss.cdi.tck.cdi.Sections.BM_OBTAIN_ANNOTATEDTYPE;
import static org.jboss.cdi.tck.cdi.Sections.BM_OBTAIN_ELRESOLVER;
Expand Down Expand Up @@ -55,6 +56,7 @@
import org.jboss.test.audit.annotations.SpecVersion;
import org.testng.annotations.Test;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down Expand Up @@ -193,4 +195,14 @@ public void testGetExtension() {
}
fail();
}

@Test
@SpecAssertion(section = BEANMANAGER, id = "b")
public void testManagerBeanIsPassivationCapable() {
assertTrue(isSerializable(getCurrentManager().getClass()));
}

private boolean isSerializable(Class<?> clazz) {
return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static org.jboss.cdi.tck.cdi.Sections.BEANMANAGER;
import static org.jboss.cdi.tck.cdi.Sections.BM_OBTAIN_CONTEXTUAL_REFERENCE;

import java.io.Serializable;
import java.math.BigDecimal;

import jakarta.enterprise.context.Dependent;
Expand Down Expand Up @@ -71,12 +70,6 @@ public void testManagerBeanHasCurrentBinding() {
assert beanManager.getQualifiers().contains(Default.Literal.INSTANCE);
}

@Test
@SpecAssertion(section = BEANMANAGER, id = "b")
public void testManagerBeanIsPassivationCapable() {
assert isSerializable(getCurrentManager().getClass());
}

@Test
@SpecAssertions({ @SpecAssertion(section = BM_OBTAIN_CONTEXTUAL_REFERENCE, id = "a"), @SpecAssertion(section = BM_OBTAIN_CONTEXTUAL_REFERENCE, id = "b") })
public void testGetReferenceReturnsContextualInstance() {
Expand All @@ -91,8 +84,4 @@ public void testGetReferenceWithIllegalBeanType() {
getCurrentManager().getReference(bean, BigDecimal.class, getCurrentManager().createCreationalContext(bean));
}

private boolean isSerializable(Class<?> clazz) {
return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
}

}

0 comments on commit 10a9539

Please sign in to comment.