org.jboss.webbeans.tck.unit.implementation.producer.field
Class ProducerFieldDefinitionTest

java.lang.Object
  extended by org.jboss.webbeans.tck.AbstractTest
      extended by org.jboss.webbeans.tck.unit.implementation.producer.field.ProducerFieldDefinitionTest

public class ProducerFieldDefinitionTest
extends AbstractTest

Spec version: PRD2


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.webbeans.tck.AbstractTest
AbstractTest.RunInDependentContext
 
Field Summary
 
Fields inherited from class org.jboss.webbeans.tck.AbstractTest
BUILT_IN_BEANS, manager, visited
 
Constructor Summary
ProducerFieldDefinitionTest()
           
 
Method Summary
protected  java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> getEnabledDeploymentTypes()
          This method should be overridden by test classes which need to enable additional deployment types beyond the normal ones.
 void testApiTypeForArrayTypeReturn()
          If a field type is primitive or is a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object.
 void testApiTypeForClassReturn()
          If the field type is a class, the set of bean types contains the field type, every superclass and all interfaces it implements directly or indirectly.
 void testApiTypeForInterfaceReturn()
          If the field type is an interface, the set of bean types contains the field type, all interfaces it extends directly or indir- ectly and java.lang.Object.
 void testApiTypeForPrimitiveReturn()
          If a field type is primitive or is a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object.
 void testBeanDeclaresMultipleProducerFields()
          A bean may declare multiple producer fields.
 void testBindingType()
          A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.
 void testDefaultBindingType()
           
 void testDefaultNamedField()
          The default name for a producer field is the field name.
 void testDeploymentType()
          A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.
 void testNamedField()
          A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.
 void testNonStaticProducerFieldNotInherited()
           
 void testParameterizedReturnType()
          If the producer field return type is a parameterized type, it must specify actual type parameters for each type parameter.
 void testParameterizedReturnTypeWithWildcard()
          If the producer field return type is a parameterized type, it must specify actual type parameters for each type parameter.
 void testProducerFieldInheritsDeploymentTypeOfDeclaringWebBean()
          By default, if no deployment type annotation is explicitly specified, a producer method or field inherits the deployment type of the bean in which it is defined.
 void testProducerFieldIsNotBusinessField()
           
 void testScopeType()
          A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.
 void testStereotype()
          A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.
 
Methods inherited from class org.jboss.webbeans.tck.AbstractTest
activateDependentContext, after, before, createEnterpriseBean, createProducerFieldBean, createProducerMethodBean, createSimpleBean, deactivateDependentContext, deployBeans, deserialize, getStandardDeploymentTypes, mockCreationalContext, serialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProducerFieldDefinitionTest

public ProducerFieldDefinitionTest()
Method Detail

getEnabledDeploymentTypes

protected java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> getEnabledDeploymentTypes()
Description copied from class: AbstractTest
This method should be overridden by test classes which need to enable additional deployment types beyond the normal ones.

Overrides:
getEnabledDeploymentTypes in class AbstractTest
Returns:
the list of enabled deployment types

testProducerFieldInheritsDeploymentTypeOfDeclaringWebBean

@SpecAssertion(section="2.5.3")
public void testProducerFieldInheritsDeploymentTypeOfDeclaringWebBean()
                                                               throws java.lang.Exception
By default, if no deployment type annotation is explicitly specified, a producer method or field inherits the deployment type of the bean in which it is defined.

Throws:
java.lang.Exception

testProducerFieldIsNotBusinessField

@SpecAssertion(section="3.5")
public void testProducerFieldIsNotBusinessField()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

testParameterizedReturnType

@SpecAssertion(section="3.5")
public void testParameterizedReturnType()
                                 throws java.lang.Exception
If the producer field return type is a parameterized type, it must specify actual type parameters for each type parameter.

Throws:
java.lang.Exception

testParameterizedReturnTypeWithWildcard

@SpecAssertion(section="3.5")
public void testParameterizedReturnTypeWithWildcard()
If the producer field return type is a parameterized type, it must specify actual type parameters for each type parameter. If a producer field return type contains a wildcard type parameter or type variable, a DefinitionException is thrown by the container at deployment time.

Throws:
java.lang.Exception

testBeanDeclaresMultipleProducerFields

@SpecAssertion(section="3.5")
public void testBeanDeclaresMultipleProducerFields()
A bean may declare multiple producer fields.


testDefaultBindingType

@SpecAssertion(section={"3.5","2.3.1"})
public void testDefaultBindingType()

testApiTypeForClassReturn

@SpecAssertion(section="3.5.1")
public void testApiTypeForClassReturn()
If the field type is a class, the set of bean types contains the field type, every superclass and all interfaces it implements directly or indirectly.

Throws:
java.lang.Exception

testApiTypeForInterfaceReturn

@SpecAssertion(section="3.5.1")
public void testApiTypeForInterfaceReturn()
If the field type is an interface, the set of bean types contains the field type, all interfaces it extends directly or indir- ectly and java.lang.Object.

Throws:
java.lang.Exception

testApiTypeForPrimitiveReturn

@SpecAssertion(section="3.5.1")
public void testApiTypeForPrimitiveReturn()
If a field type is primitive or is a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object.

Throws:
java.lang.Exception

testApiTypeForArrayTypeReturn

@SpecAssertion(section={"3.5.1","2.2"})
public void testApiTypeForArrayTypeReturn()
If a field type is primitive or is a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object.

Throws:
java.lang.Exception

testBindingType

@SpecAssertion(section="3.5.2")
public void testBindingType()
A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.

Throws:
java.lang.Exception

testScopeType

@SpecAssertion(section="3.5.2")
public void testScopeType()
A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.

Throws:
java.lang.Exception

testDeploymentType

@SpecAssertion(section="3.5.2")
public void testDeploymentType()
A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.

Throws:
java.lang.Exception

testNamedField

@SpecAssertion(section="3.5.2")
public void testNamedField()
A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.

Throws:
java.lang.Exception

testDefaultNamedField

@SpecAssertion(section={"2.6.3","3.5.4"})
public void testDefaultNamedField()
The default name for a producer field is the field name.

Throws:
java.lang.Exception

testStereotype

@SpecAssertion(section={"2.7.2","3.5.2","2.2"})
public void testStereotype()
A producer field may also specify scope, name, deployment type, stereotypes and/or bindings.

Throws:
java.lang.Exception

testNonStaticProducerFieldNotInherited

@SpecAssertion(section="4.2")
public void testNonStaticProducerFieldNotInherited()


Copyright © 2008-2009. All Rights Reserved.