org.jboss.webbeans.tck.unit.implementation.enterprise
Class EnterpriseBeanDeclarationTest

java.lang.Object
  extended by org.jboss.webbeans.tck.AbstractTest
      extended by org.jboss.webbeans.tck.unit.implementation.enterprise.EnterpriseBeanDeclarationTest

public class EnterpriseBeanDeclarationTest
extends AbstractTest

Sections 3.3. Enterprise Web Beans 3.3.1. Which EJBs are enterprise Web Beans? 3.3.2. API types of an enterprise Web Bean 3.3.3. Declaring an enterprise Web Bean using annotations 3.3.4. Declaring an enterprise Web Bean using XML

Author:
Nicklas Karlsson 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
EnterpriseBeanDeclarationTest()
           
 
Method Summary
 void testAnnotatedEnterpriseBean()
          All session beans exposing an EJB 3.x client view and declared via an EJB component defining annotation on the EJB bean class are Web Beans, and thus no special declaration is required.
 void testAnnotatedEnterpriseBeanComplementedWithXML()
          Additional enterprise Web Beans for these EJBs may be defined using XML, by specifying the bean class in web-beans.xml.
 void testAPITypesAreLocalInterfacesWithoutWildcardTypesOrTypeVariablesWithSuperInterfaces()
          The set of API types for an enterprise Web Bean contains all local interfaces of the bean that do not have wildcard type parameters or type variables and their superinterfaces
 void testDefaultName()
          The default name for an enterprise Web Bean is the unqualified class name of the Web Bean implementation class, after converting the first character to lower case.
 void testEJBJARDefinedEnterpriseBean()
          All session beans exposing an EJB 3.x client view and declared in ejb-jar.xml are also Web Beans.
 void testEJBJARDefinedEnterpriseBeanComplementedWithXML()
          Additional enterprise Web Beans for these EJBs may be defined using XML, by specifying the bean class and EJB name in web-beans.xml
 void testEnterpriseBeanDecoratorFails()
          If the implementation class of an enterprise Web Bean is annotated @Interceptor or @Decorator, a DefinitionException is thrown by the Web Bean manager at initialization time.
 void testEnterpriseBeanInterceptorFails()
          If the implementation class of an enterprise Web Bean is annotated @Interceptor or @Decorator, a DefinitionException is thrown by the Web Bean manager at initialization time.
 void testEnterpriseBeanWithLocalViewAndParameterizedTypeIncludesBeanClassAndSuperclassesInAPITypes()
          If the EJB bean has a bean class local view and the bean class is not a parameterized type, the set of API types contains the bean class and all superclasses
 void testMessageDrivenBeansNotOK()
          Enterprise Web Beans may not be message-driven beans.
 void testMultipleAnnotationDefinedEnterpriseBeansWithSameImplementationClassFails()
          Only one Web Bean per implementation class may be defined using annotations.
 void testMultipleXMLDefinedEnterpriseBeansWithSameImplementationClassOK()
          Note that multiple enterprise Web Beans may share the same implementation class.
 void testObjectIsInAPITypes()
          In addition, java.lang.Object is an API type of every enterprise Web Bean.
 void testRemoteInterfacesAreNotInAPITypes()
          Remote interfaces are not included in the set of API types.
 void testSingletonWithApplicationScopeOK()
          An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope.
 void testSingletonWithConversationScopeFails()
          An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope.
 void testSingletonWithDependentScopeOK()
          An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope.
 void testSingletonWithRequestScopeFails()
          An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope.
 void testSingletonWithSessionScopeFails()
          An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope.
 void testStatelessWithApplicationScopeFails()
          An EJB stateless session bean must belong to the @Dependent pseudo-scope.
 void testStatelessWithConversationScopeFails()
          An EJB stateless session bean must belong to the @Dependent pseudo-scope.
 void testStatelessWithDependentScopeOK()
          An EJB stateless session bean must belong to the @Dependent pseudo-scope.
 void testStatelessWithRequestScopeFails()
          An EJB stateless session bean must belong to the @Dependent pseudo-scope.
 void testStatelessWithSessionScopeFails()
          An EJB stateless session bean must belong to the @Dependent pseudo-scope.
 void testXMLFilesEJBNameUsage()
          Enterprise Web Beans may be declared in web-beans.xml using the bean class name (for EJBs defined using a component- defining annotation) or bean class and EJB name (for EJBs defined in ejb-jar.xml).
 
Methods inherited from class org.jboss.webbeans.tck.AbstractTest
activateDependentContext, after, before, createEnterpriseBean, createProducerFieldBean, createProducerMethodBean, createSimpleBean, deactivateDependentContext, deployBeans, deserialize, getEnabledDeploymentTypes, getStandardDeploymentTypes, mockCreationalContext, serialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnterpriseBeanDeclarationTest

public EnterpriseBeanDeclarationTest()
Method Detail

testStatelessWithDependentScopeOK

@SpecAssertion(section="3.3")
public void testStatelessWithDependentScopeOK()
An EJB stateless session bean must belong to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testStatelessWithRequestScopeFails

@SpecAssertion(section="3.3")
public void testStatelessWithRequestScopeFails()
An EJB stateless session bean must belong to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testStatelessWithConversationScopeFails

@SpecAssertion(section="3.3")
public void testStatelessWithConversationScopeFails()
An EJB stateless session bean must belong to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testStatelessWithSessionScopeFails

@SpecAssertion(section="3.3")
public void testStatelessWithSessionScopeFails()
An EJB stateless session bean must belong to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testStatelessWithApplicationScopeFails

@SpecAssertion(section="3.3")
public void testStatelessWithApplicationScopeFails()
An EJB stateless session bean must belong to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testSingletonWithDependentScopeOK

@SpecAssertion(section="3.3")
public void testSingletonWithDependentScopeOK()
An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testSingletonWithRequestScopeFails

@SpecAssertion(section="3.3")
public void testSingletonWithRequestScopeFails()
An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testSingletonWithConversationScopeFails

@SpecAssertion(section="3.3")
public void testSingletonWithConversationScopeFails()
An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testSingletonWithSessionScopeFails

@SpecAssertion(section="3.3")
public void testSingletonWithSessionScopeFails()
An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testSingletonWithApplicationScopeOK

@SpecAssertion(section="3.3")
public void testSingletonWithApplicationScopeOK()
An EJB singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope. If an enterprise Web Bean specifies an illegal scope, a DefinitionException is thrown by the Web Bean manager at initialization time


testEnterpriseBeanInterceptorFails

@SpecAssertion(section="3.3")
public void testEnterpriseBeanInterceptorFails()
If the implementation class of an enterprise Web Bean is annotated @Interceptor or @Decorator, a DefinitionException is thrown by the Web Bean manager at initialization time.


testEnterpriseBeanDecoratorFails

@SpecAssertion(section="3.3")
public void testEnterpriseBeanDecoratorFails()
If the implementation class of an enterprise Web Bean is annotated @Interceptor or @Decorator, a DefinitionException is thrown by the Web Bean manager at initialization time.


testMultipleAnnotationDefinedEnterpriseBeansWithSameImplementationClassFails

@SpecAssertion(section="3.3")
public void testMultipleAnnotationDefinedEnterpriseBeansWithSameImplementationClassFails()
Only one Web Bean per implementation class may be defined using annotations.


testMultipleXMLDefinedEnterpriseBeansWithSameImplementationClassOK

@SpecAssertion(section="3.3")
public void testMultipleXMLDefinedEnterpriseBeansWithSameImplementationClassOK()
Note that multiple enterprise Web Beans may share the same implementation class. This occurs when Web Beans are defined using XML


testAnnotatedEnterpriseBean

@SpecAssertion(section="3.3.2")
public void testAnnotatedEnterpriseBean()
All session beans exposing an EJB 3.x client view and declared via an EJB component defining annotation on the EJB bean class are Web Beans, and thus no special declaration is required.


testAnnotatedEnterpriseBeanComplementedWithXML

@SpecAssertion(section="3.3.2")
public void testAnnotatedEnterpriseBeanComplementedWithXML()
Additional enterprise Web Beans for these EJBs may be defined using XML, by specifying the bean class in web-beans.xml.


testEJBJARDefinedEnterpriseBean

@SpecAssertion(section="3.3.2")
public void testEJBJARDefinedEnterpriseBean()
All session beans exposing an EJB 3.x client view and declared in ejb-jar.xml are also Web Beans.


testEJBJARDefinedEnterpriseBeanComplementedWithXML

@SpecAssertion(section="3.3.2")
public void testEJBJARDefinedEnterpriseBeanComplementedWithXML()
Additional enterprise Web Beans for these EJBs may be defined using XML, by specifying the bean class and EJB name in web-beans.xml


testAPITypesAreLocalInterfacesWithoutWildcardTypesOrTypeVariablesWithSuperInterfaces

@SpecAssertion(section="3.3.3")
public void testAPITypesAreLocalInterfacesWithoutWildcardTypesOrTypeVariablesWithSuperInterfaces()
The set of API types for an enterprise Web Bean contains all local interfaces of the bean that do not have wildcard type parameters or type variables and their superinterfaces


testEnterpriseBeanWithLocalViewAndParameterizedTypeIncludesBeanClassAndSuperclassesInAPITypes

@SpecAssertion(section="3.3.3")
public void testEnterpriseBeanWithLocalViewAndParameterizedTypeIncludesBeanClassAndSuperclassesInAPITypes()
If the EJB bean has a bean class local view and the bean class is not a parameterized type, the set of API types contains the bean class and all superclasses


testObjectIsInAPITypes

@SpecAssertion(section="3.3.3")
public void testObjectIsInAPITypes()
In addition, java.lang.Object is an API type of every enterprise Web Bean.


testRemoteInterfacesAreNotInAPITypes

@SpecAssertion(section="3.3.3")
public void testRemoteInterfacesAreNotInAPITypes()
Remote interfaces are not included in the set of API types.


testXMLFilesEJBNameUsage

@SpecAssertion(section="3.3")
public void testXMLFilesEJBNameUsage()
Enterprise Web Beans may be declared in web-beans.xml using the bean class name (for EJBs defined using a component- defining annotation) or bean class and EJB name (for EJBs defined in ejb-jar.xml). The ejbName attribute declares the EJB name of an EJB defined in ejb-jar.xml


testMessageDrivenBeansNotOK

@SpecAssertion(section="3.3")
public void testMessageDrivenBeansNotOK()
Enterprise Web Beans may not be message-driven beans. If an enterprise Web Bean declared in XML is a message-driven bean, a DefinitionException is thrown by the Web Bean manager at initialization time.


testDefaultName

@SpecAssertion(section="3.3.8")
public void testDefaultName()
The default name for an enterprise Web Bean is the unqualified class name of the Web Bean implementation class, after converting the first character to lower case.



Copyright © 2008-2009. All Rights Reserved.