Class ProducerMethodDefinitionTest

  • All Implemented Interfaces:
    org.testng.IHookable, org.testng.ITestNGListener

    @SpecVersion(spec="cdi",
                 version="2.0")
    public class ProducerMethodDefinitionTest
    extends AbstractTest
    • Constructor Detail

      • ProducerMethodDefinitionTest

        public ProducerMethodDefinitionTest()
    • 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()