Class ProducerMethodDefinitionTest
- java.lang.Object
-
- org.jboss.arquillian.testng.Arquillian
-
- org.jboss.cdi.tck.AbstractTest
-
- org.jboss.cdi.tck.tests.implementation.producer.method.definition.ProducerMethodDefinitionTest
-
- All Implemented Interfaces:
org.testng.IHookable,org.testng.ITestNGListener
@SpecVersion(spec="cdi", version="2.0") public class ProducerMethodDefinitionTest extends AbstractTest
-
-
Field Summary
-
Fields inherited from class org.jboss.cdi.tck.AbstractTest
beanManager
-
-
Constructor Summary
Constructors Constructor Description ProducerMethodDefinitionTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.jboss.shrinkwrap.api.spec.WebArchivecreateTestArchive()voidtestApiTypeForArrayTypeReturn()voidtestApiTypeForClassReturn()voidtestApiTypeForInterfaceReturn()voidtestApiTypeForPrimitiveReturn()voidtestBindingType()voidtestBindingTypesAppliedToProducerMethodParameters()Note on the "3.3.2 h" assertion related to CDI section "3.3.2.voidtestDefaultBindingType()voidtestDefaultNamedMethod()voidtestDependentProducerReturnsNullValue()voidtestNamedMethod()voidtestNonDependentProducerReturnsNullValue()voidtestNonStaticDisposerMethodWithStaticProducer()voidtestNonStaticProducerMethodNotInherited()voidtestParameterizedReturnType()voidtestProducerOnNonBean()voidtestScopeType()voidtestStaticDisposerMethod()voidtestStaticDisposerMethodWithNonStaticProducer()voidtestStaticMethod()voidtestStereotypeSpecifiesScope()voidtestTypeVariableReturnType()-
Methods inherited from class org.jboss.cdi.tck.AbstractTest
activate, annotationSetMatches, annotationSetMatches, destroyContext, getBeans, getBeans, getContextualReference, getContextualReference, getContextualReference, getCurrentBeanContainer, getCurrentConfiguration, getCurrentManager, getUniqueBean, getUniqueBean, isThrowablePresent, newDependentInstance, passivate, rawTypeSetMatches, setContextActive, setContextInactive, typeSetMatches
-
-
-
-
Method Detail
-
createTestArchive
@Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive createTestArchive()
-
testStaticMethod
@SpecAssertion(section="producer_method",id="b") @SpecAssertion(section="producer_or_disposer_methods_invocation",id="a") public void testStaticMethod() throws Exception- Throws:
Exception
-
testProducerOnNonBean
@SpecAssertions(@SpecAssertion(section="producer_method",id="aa")) public void testProducerOnNonBean() throws Exception- Throws:
Exception
-
testStaticDisposerMethod
@SpecAssertions(@SpecAssertion(section="disposer_method",id="b")) public void testStaticDisposerMethod() throws Exception- Throws:
Exception
-
testStaticDisposerMethodWithNonStaticProducer
@SpecAssertions(@SpecAssertion(section="disposer_method",id="b")) public void testStaticDisposerMethodWithNonStaticProducer() throws Exception- Throws:
Exception
-
testNonStaticDisposerMethodWithStaticProducer
@SpecAssertions(@SpecAssertion(section="disposer_method",id="b")) public void testNonStaticDisposerMethodWithStaticProducer() throws Exception- Throws:
Exception
-
testParameterizedReturnType
@SpecAssertion(section="producer_method", id="ga") public void testParameterizedReturnType() throws Exception- Throws:
Exception
-
testDefaultBindingType
@SpecAssertion(section="producer_method",id="c") @SpecAssertion(section="declaring_producer_method",id="a") @SpecAssertion(section="builtin_qualifiers",id="aa") @SpecAssertion(section="builtin_qualifiers",id="ab") public void testDefaultBindingType() throws Exception- Throws:
Exception
-
testApiTypeForClassReturn
@SpecAssertion(section="producer_method_types",id="c") @SpecAssertion(section="bean_types",id="l") public void testApiTypeForClassReturn() throws Exception- Throws:
Exception
-
testApiTypeForInterfaceReturn
@SpecAssertion(section="producer_method_types", id="a") public void testApiTypeForInterfaceReturn() throws Exception- Throws:
Exception
-
testApiTypeForPrimitiveReturn
@SpecAssertion(section="producer_method_types", id="ba") public void testApiTypeForPrimitiveReturn() throws Exception- Throws:
Exception
-
testApiTypeForArrayTypeReturn
@SpecAssertion(section="producer_method_types",id="bb") @SpecAssertion(section="legal_bean_types",id="i") public void testApiTypeForArrayTypeReturn() throws Exception- Throws:
Exception
-
testBindingType
@SpecAssertion(section="declaring_producer_method",id="be") @SpecAssertion(section="producer_method",id="k") @SpecAssertion(section="declaring_bean_qualifiers",id="b") public void testBindingType() throws Exception- Throws:
Exception
-
testScopeType
@SpecAssertion(section="declaring_producer_method",id="ba") @SpecAssertion(section="producer_method",id="k") public void testScopeType() throws Exception- Throws:
Exception
-
testNamedMethod
@SpecAssertion(section="declaring_producer_method",id="bb") @SpecAssertion(section="declaring_bean_name",id="b") public void testNamedMethod() throws Exception- Throws:
Exception
-
testDefaultNamedMethod
@SpecAssertion(section="declaring_producer_method",id="bb") @SpecAssertion(section="default_name",id="b") @SpecAssertion(section="default_name",id="fb") public void testDefaultNamedMethod() throws Exception- Throws:
Exception
-
testStereotypeSpecifiesScope
@SpecAssertion(section="declaring_stereotypes",id="b") @SpecAssertion(section="declaring_producer_method",id="ba") @SpecAssertion(section="default_scope",id="c") @SpecAssertion(section="declaring_producer_method",id="bd") public void testStereotypeSpecifiesScope() throws Exception- Throws:
Exception
-
testNonStaticProducerMethodNotInherited
@SpecAssertion(section="member_level_inheritance",id="da") @SpecAssertion(section="member_level_inheritance",id="dg") public void testNonStaticProducerMethodNotInherited()
-
testBindingTypesAppliedToProducerMethodParameters
@SpecAssertion(section="method_constructor_parameter_qualifiers",id="a") @SpecAssertion(section="declaring_producer_method",id="i") @SpecAssertion(section="declaring_producer_method",id="h") @SpecAssertion(section="producer_or_disposer_methods_invocation",id="e") public void testBindingTypesAppliedToProducerMethodParameters()
Note on the "3.3.2 h" assertion related to CDI section "3.3.2. Declaring a producer method" statement "A producer method may have any number of parameters." JVM spec allows max 255 params. This test works with two producer method params -SpiderProducer.producesDeadliestTarantula(Tarantula, Tarantula). To fulfill the assertion requirements we would need to test 255 producer methods with 1 to 255 parameter injection points.
-
testDependentProducerReturnsNullValue
@SpecAssertion(section="producer_method", id="e") public void testDependentProducerReturnsNullValue()
-
testNonDependentProducerReturnsNullValue
@SpecAssertion(section="producer_method", id="f") public void testNonDependentProducerReturnsNullValue()
-
testTypeVariableReturnType
@SpecAssertion(section="producer_method", id="iaa") public void testTypeVariableReturnType()
-
-