[webbeans-commits] Webbeans SVN: r1042 - tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-01-17 13:55:42 -0500 (Sat, 17 Jan 2009)
New Revision: 1042
Removed:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EuropeanGoldfinch.java
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventBusTest.java
Log:
A few changes to ch. 8 tests with some new ones running now.
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java 2009-01-17 17:24:16 UTC (rev 1041)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java 2009-01-17 18:55:42 UTC (rev 1042)
@@ -156,10 +156,7 @@
{
try
{
- if (!method.isAccessible())
- {
- method.setAccessible(true);
- }
+ method.setAccessible(true);
return method.invoke(instance);
}
catch (IllegalArgumentException e)
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EuropeanGoldfinch.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EuropeanGoldfinch.java 2009-01-17 17:24:16 UTC (rev 1041)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EuropeanGoldfinch.java 2009-01-17 18:55:42 UTC (rev 1042)
@@ -1,30 +0,0 @@
-package org.jboss.webbeans.tck.tests.event;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.webbeans.ConversationScoped;
-import javax.webbeans.Destructor;
-import javax.webbeans.Event;
-import javax.webbeans.Fires;
-
-import org.jboss.webbeans.tck.tests.event.StarFinch.Mess;
-
-@ConversationScoped @Stateful
-class EuropeanGoldfinch
-{
- private Mess someMess;
-
- public Mess getSomeMess()
- {
- return someMess;
- }
-
- @Destructor @Remove
- public void remove(@Fires Event<Mess> eventObject)
- {
- // Create a new mess and fire the event for it
- someMess = new Mess();
- eventObject.fire(someMess);
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventBusTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventBusTest.java 2009-01-17 17:24:16 UTC (rev 1041)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventBusTest.java 2009-01-17 18:55:42 UTC (rev 1042)
@@ -508,6 +508,7 @@
public void testObserverMethodRegistration()
{
// For now, this test is checking the registration of methods
+ //TODO Check the called test to make sure it is still valid here
testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic();
}
@@ -626,7 +627,7 @@
@Test(groups = { "events" })
@SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnField()
+ public void testFiresAnnotationOnEventTypes()
{
deployBeans(BlueFacedParrotFinch.class);
try
@@ -642,12 +643,6 @@
{
deactivateDependentContext();
}
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnParameterOfProducerMethod()
- {
deployBeans(StarFinch.class, FinchKeeper.class, BirdCage.class);
try
{
@@ -664,12 +659,6 @@
{
deactivateDependentContext();
}
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnParameterOfInitializerMethod()
- {
deployBeans(OrangeCheekedWaxbill.class, FinchKeeper.class);
try
{
@@ -684,41 +673,6 @@
{
deactivateDependentContext();
}
- }
-
- //TODO Implement once disposal methods are included
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnParameterOfDisposalMethod()
- {
- assert false;
- }
-
- //TODO Make sure this test works once EJBs are fully supported
- @Test(groups = { "broken", "events" })
- @SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnParameterOfRemoveMethod()
- {
- deployBeans(EuropeanGoldfinch.class, FinchKeeper.class);
- try
- {
- activateDependentContext();
- EuropeanGoldfinch bird = manager.getInstanceByType(EuropeanGoldfinch.class);
- FinchKeeper birdKeeper = manager.getInstanceByType(FinchKeeper.class);
- assert bird != null;
-
- assert birdKeeper.isNewMessDetected();
- }
- finally
- {
- deactivateDependentContext();
- }
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnParameterOfConstructor()
- {
deployBeans(AuroraFinch.class, FinchKeeper.class);
try
{
@@ -736,7 +690,7 @@
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
@SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnNonEventTypeInjectionPointFails()
+ public void testFiresAnnotationOnNonEventTypeInjectionPointFails()
{
deployBeans(CommonWaxbill_Broken.class);
try
@@ -753,7 +707,7 @@
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
@SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnInjectionPointWithoutTypeParameterFails()
+ public void testFiresAnnotationOnInjectionPointWithoutTypeParameterFails()
{
deployBeans(BlackRumpedWaxbill_Broken.class);
try
@@ -770,7 +724,7 @@
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
@SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnInjectionPointWithWildcardedTypeParameterFails()
+ public void testFiresAnnotationOnInjectionPointWithWildcardedTypeParameterFails()
{
deployBeans(GoldbreastWaxbill_Broken.class);
try
@@ -787,7 +741,7 @@
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
@SpecAssertion(section = "8.6")
- public void testObservableAnnotationOnInjectionPointWithTypeVariabledTypeParameterFails()
+ public void testFiresAnnotationOnInjectionPointWithTypeVariabledTypeParameterFails()
{
deployBeans(JavaSparrow_Broken.class);
try
17 years, 2 months
[webbeans-commits] Webbeans SVN: r1041 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-17 12:24:16 -0500 (Sat, 17 Jan 2009)
New Revision: 1041
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedConstructorParameter.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedField.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedInitializerParameter.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedProducerParameter.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewAndOtherBindingType_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/WrappedEnterpriseBean.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewEnterpriseBeanTest.java
Log:
port new enterprise bean tests
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewEnterpriseBeanTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewEnterpriseBeanTest.java 2009-01-17 17:13:26 UTC (rev 1040)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewEnterpriseBeanTest.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -1,428 +0,0 @@
-package org.jboss.webbeans.test.newbean;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-import javax.webbeans.DefinitionException;
-import javax.webbeans.Dependent;
-import javax.webbeans.Standard;
-
-import org.jboss.webbeans.bean.EnterpriseBean;
-import org.jboss.webbeans.bean.NewEnterpriseBean;
-import org.jboss.webbeans.binding.NewBinding;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.jboss.webbeans.test.mock.MockWebBeanDiscovery;
-import org.jboss.webbeans.test.newbean.invalid.NewAndOtherBindingType;
-import org.jboss.webbeans.test.newbean.valid.AnnotatedConstructorParameter;
-import org.jboss.webbeans.test.newbean.valid.AnnotatedField;
-import org.jboss.webbeans.test.newbean.valid.AnnotatedInitializerParameter;
-import org.jboss.webbeans.test.newbean.valid.AnnotatedProducerParameter;
-import org.jboss.webbeans.test.newbean.valid.WrappedEnterpriseBean;
-import org.jboss.webbeans.test.newbean.valid.WrappedSimpleBean;
-import org.jboss.webbeans.util.Proxies.TypeInfo;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081222")
-public class NewEnterpriseBeanTest extends AbstractTest
-{
- private EnterpriseBean<WrappedEnterpriseBean> wrappedEnterpriseBean;
- private NewEnterpriseBean<WrappedEnterpriseBean> newEnterpriseBean;
-
- @BeforeMethod
- public void initNewBean() {
- addToEjbCache(WrappedEnterpriseBean.class);
- wrappedEnterpriseBean = EnterpriseBean.of(WrappedEnterpriseBean.class, manager);
- manager.addBean(wrappedEnterpriseBean);
- newEnterpriseBean = NewEnterpriseBean.of(WrappedEnterpriseBean.class, manager);
- manager.addBean(newEnterpriseBean);
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanIsDependentScoped()
- {
- assert Dependent.class.equals(newEnterpriseBean.getScopeType());
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanIsOfStandardDeploymentType()
- {
- assert Standard.class.equals(newEnterpriseBean.getDeploymentType());
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanIsHasOnlyNewBinding()
- {
- assert newEnterpriseBean.getBindings().size() == 1;
- assert newEnterpriseBean.getBindings().iterator().next().annotationType().equals(new NewBinding().annotationType());
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoWebBeanName()
- {
- assert newEnterpriseBean.getName() == null;
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "stub", "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoStereotypes()
- {
- assert false;
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new", "broken" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasImplementationClassOfInjectionPointType()
- {
- assert newEnterpriseBean.getType().equals(WrappedSimpleBean.class);
- }
-
- /**
- * If the parameter type satisfies the definition of a simple Web Bean
- * implementation class, Section 3.2.1, �Which Java classes are simple Web
- * Beans?�, then the Web Bean is a simple Web Bean. If the parameter type
- * satisfies the definition of an enterprise Web Bean implementation class,
- * Section 3.3.2, �Which EJBs are enterprise Web Beans?�, then the Web Bean
- * is an enterprise Web Bean.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanIsEnterpriseWebBeanIfParameterTypeIsEnterpriseWebBean()
- {
- assert wrappedEnterpriseBean.getType().equals(newEnterpriseBean.getType());
- assert manager.getEjbDescriptorCache().containsKey(newEnterpriseBean.getType());
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasSameConstructorAsWrappedBean()
- {
- // N/A for EJB
- assert true;
-// assert wrappedEnterpriseBean.getConstructor().equals(newEnterpriseBean.getConstructor());
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
- {
- assert newEnterpriseBean.getInitializerMethods().equals(wrappedEnterpriseBean.getInitializerMethods());
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
- {
- Set<AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedEnterpriseBean.getAnnotatedInjectionPoints();
- Set<AnnotatedItem<?, ?>> newBeanInjectionPoints = newEnterpriseBean.getAnnotatedInjectionPoints();
- assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = {"new", "stub" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoObservers()
- {
- assert false;
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new", "stub" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoProducerFields()
- {
- assert false;
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new", "stub" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoProducerMethods()
- {
- assert false;
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoDisposalMethods()
- {
- Class<?> type = TypeInfo.ofTypes(newEnterpriseBean.getTypes()).getSuperClass();
- assert manager.resolveDisposalMethods(type, newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "stub", "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
- {
- assert false;
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoDecorators()
- {
- Annotation[] bindingTypes = newEnterpriseBean.getBindings().toArray(new Annotation[0]);
- assert manager.resolveDecorators(newEnterpriseBean.getTypes(), bindingTypes).isEmpty();
- }
-
- /**
- * The @New annotation or <New> element may be applied to any field of a Web
- * Bean implementation class or to any parameter of a producer method,
- * initializer method, disposal method or Web Bean constructor where the type
- * of the field or parameter is a concrete Java type which satisfies the
- * requirements of a simple Web Bean implementation class or enterprise Web
- * Bean implementation class.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationMayBeAppliedToField()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(AnnotatedField.class, WrappedSimpleBean.class));
- webBeansBootstrap.boot();
- assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
- }
-
- /**
- * The @New annotation or <New> element may be applied to any field of a Web
- * Bean implementation class or to any parameter of a producer method,
- * initializer method, disposal method or Web Bean constructor where the type
- * of the field or parameter is a concrete Java type which satisfies the
- * requirements of a simple Web Bean implementation class or enterprise Web
- * Bean implementation class.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationMayBeAppliedToProducerMethodParameter()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(AnnotatedProducerParameter.class, WrappedSimpleBean.class));
- webBeansBootstrap.boot();
- assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
- }
-
- /**
- * The @New annotation or <New> element may be applied to any field of a Web
- * Bean implementation class or to any parameter of a producer method,
- * initializer method, disposal method or Web Bean constructor where the type
- * of the field or parameter is a concrete Java type which satisfies the
- * requirements of a simple Web Bean implementation class or enterprise Web
- * Bean implementation class.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationMayBeAppliedToInitializerMethodParameter()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(AnnotatedInitializerParameter.class, WrappedSimpleBean.class));
- webBeansBootstrap.boot();
- assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
- }
-
- /**
- * The @New annotation or <New> element may be applied to any field of a Web
- * Bean implementation class or to any parameter of a producer method,
- * initializer method, disposal method or Web Bean constructor where the type
- * of the field or parameter is a concrete Java type which satisfies the
- * requirements of a simple Web Bean implementation class or enterprise Web
- * Bean implementation class.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationMayBeAppliedToConstructorMethodParameter()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(AnnotatedConstructorParameter.class, WrappedSimpleBean.class));
- webBeansBootstrap.boot();
- assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
- }
-
- /**
- * If the @New binding type appears in conjunction with some other binding
- * type, or is specified for a field or parameter of a type which does not
- * satisfy the definition of a simple Web Bean implementation class or
- * enterprise Web Bean implementation class, a DefinitionException is thrown
- * by the container at deployment time.
- */
- @Test(groups = { "new" , "broken"}, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationCannotAppearInConjunctionWithOtherBindingType()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(NewAndOtherBindingType.class));
- webBeansBootstrap.boot();
- }
-
- /**
- * If the @New binding type appears in conjunction with some other binding
- * type, or is specified for a field or parameter of a type which does not
- * satisfy the definition of a simple Web Bean implementation class or
- * enterprise Web Bean implementation class, a DefinitionException is thrown
- * by the container at deployment time.
- */
- @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationCannotBeAppliedToNonWebBeanImplementationClass()
- {
- assert false;
- }
-
- /**
- * No Web Bean defined using annotations or XML may explicitly declare @New
- * as a binding type
- */
- @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationCannotBeExplicitlyDeclared()
- {
- assert false;
- }
-
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewEnterpriseBeanTest.java (from rev 1036, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewEnterpriseBeanTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewEnterpriseBeanTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewEnterpriseBeanTest.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -0,0 +1,66 @@
+package org.jboss.webbeans.test.unit;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.bean.NewEnterpriseBean;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecVersion;
+import org.jboss.webbeans.test.newbean.valid.WrappedEnterpriseBean;
+import org.jboss.webbeans.test.newbean.valid.WrappedSimpleBean;
+import org.jboss.webbeans.util.Proxies.TypeInfo;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081222")
+public class NewEnterpriseBeanTest extends AbstractTest
+{
+ private EnterpriseBean<WrappedEnterpriseBean> wrappedEnterpriseBean;
+ private NewEnterpriseBean<WrappedEnterpriseBean> newEnterpriseBean;
+
+ @BeforeMethod
+ public void initNewBean() {
+ addToEjbCache(WrappedEnterpriseBean.class);
+ wrappedEnterpriseBean = EnterpriseBean.of(WrappedEnterpriseBean.class, manager);
+ manager.addBean(wrappedEnterpriseBean);
+ newEnterpriseBean = NewEnterpriseBean.of(WrappedEnterpriseBean.class, manager);
+ manager.addBean(newEnterpriseBean);
+ }
+
+ @Test(groups = { "new", "broken" })
+ public void testNewBeanHasImplementationClassOfInjectionPointType()
+ {
+ assert newEnterpriseBean.getType().equals(WrappedSimpleBean.class);
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanIsEnterpriseWebBeanIfParameterTypeIsEnterpriseWebBean()
+ {
+ assert wrappedEnterpriseBean.getType().equals(newEnterpriseBean.getType());
+ assert manager.getEjbDescriptorCache().containsKey(newEnterpriseBean.getType());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
+ {
+ assert newEnterpriseBean.getInitializerMethods().equals(wrappedEnterpriseBean.getInitializerMethods());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
+ {
+ Set<AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedEnterpriseBean.getAnnotatedInjectionPoints();
+ Set<AnnotatedItem<?, ?>> newBeanInjectionPoints = newEnterpriseBean.getAnnotatedInjectionPoints();
+ assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasNoDisposalMethods()
+ {
+ Class<?> type = TypeInfo.ofTypes(newEnterpriseBean.getTypes()).getSuperClass();
+ assert manager.resolveDisposalMethods(type, newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedConstructorParameter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedConstructorParameter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedConstructorParameter.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.tests.implementation.enterprise;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.New;
+
+
+class AnnotatedConstructorParameter
+{
+ @Initializer
+ public AnnotatedConstructorParameter(@New WrappedEnterpriseBean reference)
+ {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedConstructorParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedField.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedField.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedField.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.implementation.enterprise;
+
+import javax.webbeans.New;
+
+
+class AnnotatedField
+{
+ @New
+ WrappedEnterpriseBean reference;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedInitializerParameter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedInitializerParameter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedInitializerParameter.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.tests.implementation.enterprise;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.New;
+
+
+class AnnotatedInitializerParameter
+{
+ @Initializer
+ public void init(@New WrappedEnterpriseBean reference)
+ {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedInitializerParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedProducerParameter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedProducerParameter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedProducerParameter.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.implementation.enterprise;
+
+import javax.webbeans.New;
+import javax.webbeans.Produces;
+
+
+class AnnotatedProducerParameter
+{
+ @Produces
+ Object produce(@New WrappedEnterpriseBean reference)
+ {
+ return new Object();
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/AnnotatedProducerParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewAndOtherBindingType_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewAndOtherBindingType_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewAndOtherBindingType_Broken.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.implementation.enterprise;
+
+import javax.webbeans.Current;
+import javax.webbeans.New;
+
+class NewAndOtherBindingType_Broken
+{
+ public @New @Current WrappedEnterpriseBean violation;
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewAndOtherBindingType_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewEnterpriseBeanTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewEnterpriseBeanTest.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -0,0 +1,371 @@
+package org.jboss.webbeans.tck.tests.implementation.enterprise;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.webbeans.DefinitionException;
+import javax.webbeans.Dependent;
+import javax.webbeans.Standard;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.impl.literals.NewBinding;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081222")
+public class NewEnterpriseBeanTest extends AbstractTest
+{
+ private Bean<WrappedEnterpriseBean> newEnterpriseBean;
+
+ @BeforeMethod
+ public void initNewBean() {
+ deployBeans(WrappedEnterpriseBean.class);
+ Set<Bean<WrappedEnterpriseBean>> beans = manager.resolveByType(WrappedEnterpriseBean.class, new NewBinding());
+ assert beans.size() == 1;
+ newEnterpriseBean = beans.iterator().next();
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanIsDependentScoped()
+ {
+ assert Dependent.class.equals(newEnterpriseBean.getScopeType());
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanIsOfStandardDeploymentType()
+ {
+ assert Standard.class.equals(newEnterpriseBean.getDeploymentType());
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanIsHasOnlyNewBinding()
+ {
+ assert newEnterpriseBean.getBindings().size() == 1;
+ assert newEnterpriseBean.getBindings().iterator().next().annotationType().equals(new NewBinding().annotationType());
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoWebBeanName()
+ {
+ assert newEnterpriseBean.getName() == null;
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "stub", "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoStereotypes()
+ {
+ assert false;
+ }
+
+ /**
+ * If the parameter type satisfies the definition of a simple Web Bean
+ * implementation class, Section 3.2.1, �Which Java classes are simple Web
+ * Beans?�, then the Web Bean is a simple Web Bean. If the parameter type
+ * satisfies the definition of an enterprise Web Bean implementation class,
+ * Section 3.3.2, �Which EJBs are enterprise Web Beans?�, then the Web Bean
+ * is an enterprise Web Bean.
+ */
+ @Test(groups = { "new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanIsEnterpriseWebBeanIfParameterTypeIsEnterpriseWebBean()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = {"new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoObservers()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoProducerFields()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoProducerMethods()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoDisposalMethods()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "stub", "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoDecorators()
+ {
+ Annotation[] bindingTypes = newEnterpriseBean.getBindings().toArray(new Annotation[0]);
+ assert manager.resolveDecorators(newEnterpriseBean.getTypes(), bindingTypes).isEmpty();
+ }
+
+ /**
+ * The @New annotation or <New> element may be applied to any field of a Web
+ * Bean implementation class or to any parameter of a producer method,
+ * initializer method, disposal method or Web Bean constructor where the type
+ * of the field or parameter is a concrete Java type which satisfies the
+ * requirements of a simple Web Bean implementation class or enterprise Web
+ * Bean implementation class.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationMayBeAppliedToField()
+ {
+ deployBeans(AnnotatedField.class, WrappedEnterpriseBean.class);
+ assert manager.resolveByType(WrappedEnterpriseBean.class, new NewBinding()).size() == 1;
+ }
+
+ /**
+ * The @New annotation or <New> element may be applied to any field of a Web
+ * Bean implementation class or to any parameter of a producer method,
+ * initializer method, disposal method or Web Bean constructor where the type
+ * of the field or parameter is a concrete Java type which satisfies the
+ * requirements of a simple Web Bean implementation class or enterprise Web
+ * Bean implementation class.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationMayBeAppliedToProducerMethodParameter()
+ {
+ deployBeans(AnnotatedProducerParameter.class, WrappedEnterpriseBean.class);
+ assert manager.resolveByType(WrappedEnterpriseBean.class, new NewBinding()).size() == 1;
+ }
+
+ /**
+ * The @New annotation or <New> element may be applied to any field of a Web
+ * Bean implementation class or to any parameter of a producer method,
+ * initializer method, disposal method or Web Bean constructor where the type
+ * of the field or parameter is a concrete Java type which satisfies the
+ * requirements of a simple Web Bean implementation class or enterprise Web
+ * Bean implementation class.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationMayBeAppliedToInitializerMethodParameter()
+ {
+ deployBeans(AnnotatedInitializerParameter.class, WrappedEnterpriseBean.class);
+ assert manager.resolveByType(WrappedEnterpriseBean.class, new NewBinding()).size() == 1;
+ }
+
+ /**
+ * The @New annotation or <New> element may be applied to any field of a Web
+ * Bean implementation class or to any parameter of a producer method,
+ * initializer method, disposal method or Web Bean constructor where the type
+ * of the field or parameter is a concrete Java type which satisfies the
+ * requirements of a simple Web Bean implementation class or enterprise Web
+ * Bean implementation class.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationMayBeAppliedToConstructorMethodParameter()
+ {
+ deployBeans(AnnotatedConstructorParameter.class, WrappedEnterpriseBean.class);
+ assert manager.resolveByType(WrappedEnterpriseBean.class, new NewBinding()).size() == 1;
+ }
+
+ /**
+ * If the @New binding type appears in conjunction with some other binding
+ * type, or is specified for a field or parameter of a type which does not
+ * satisfy the definition of a simple Web Bean implementation class or
+ * enterprise Web Bean implementation class, a DefinitionException is thrown
+ * by the container at deployment time.
+ */
+ @Test(groups = { "new" , "broken"}, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationCannotAppearInConjunctionWithOtherBindingType()
+ {
+ deployBeans(NewAndOtherBindingType_Broken.class);
+ }
+
+ /**
+ * If the @New binding type appears in conjunction with some other binding
+ * type, or is specified for a field or parameter of a type which does not
+ * satisfy the definition of a simple Web Bean implementation class or
+ * enterprise Web Bean implementation class, a DefinitionException is thrown
+ * by the container at deployment time.
+ */
+ @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationCannotBeAppliedToNonWebBeanImplementationClass()
+ {
+ assert false;
+ }
+
+ /**
+ * No Web Bean defined using annotations or XML may explicitly declare @New
+ * as a binding type
+ */
+ @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationCannotBeExplicitlyDeclared()
+ {
+ assert false;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/NewEnterpriseBeanTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/WrappedEnterpriseBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/WrappedEnterpriseBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/WrappedEnterpriseBean.java 2009-01-17 17:24:16 UTC (rev 1041)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.tests.implementation.enterprise;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Named;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+@Stateful
+@Named("John")
+public class WrappedEnterpriseBean
+{
+ @Remove
+ public void bye() {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/WrappedEnterpriseBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
[webbeans-commits] Webbeans SVN: r1040 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-17 12:13:26 -0500 (Sat, 17 Jan 2009)
New Revision: 1040
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewSimpleBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/literals/NewBinding.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedConstructorParameter.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedField.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedInitializerParameter.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedProducerParameter.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewAndOtherBindingType_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewSimpleBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/WrappedSimpleBean.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewSimpleBeanTest.java
Log:
port new simple bean tests
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewSimpleBeanTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewSimpleBeanTest.java 2009-01-17 16:54:32 UTC (rev 1039)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewSimpleBeanTest.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -1,423 +0,0 @@
-package org.jboss.webbeans.test.newbean;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-import javax.webbeans.DefinitionException;
-import javax.webbeans.Dependent;
-import javax.webbeans.Standard;
-
-import org.jboss.webbeans.bean.NewSimpleBean;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.binding.NewBinding;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.jboss.webbeans.test.mock.MockWebBeanDiscovery;
-import org.jboss.webbeans.test.newbean.invalid.NewAndOtherBindingType;
-import org.jboss.webbeans.test.newbean.valid.AnnotatedConstructorParameter;
-import org.jboss.webbeans.test.newbean.valid.AnnotatedField;
-import org.jboss.webbeans.test.newbean.valid.AnnotatedInitializerParameter;
-import org.jboss.webbeans.test.newbean.valid.AnnotatedProducerParameter;
-import org.jboss.webbeans.test.newbean.valid.WrappedSimpleBean;
-import org.jboss.webbeans.util.Proxies.TypeInfo;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081222")
-public class NewSimpleBeanTest extends AbstractTest
-{
- private SimpleBean<WrappedSimpleBean> wrappedSimpleBean;
- private NewSimpleBean<WrappedSimpleBean> newSimpleBean;
-
- @BeforeMethod
- public void initNewBean() {
- wrappedSimpleBean = SimpleBean.of(WrappedSimpleBean.class, manager);
- manager.addBean(wrappedSimpleBean);
- newSimpleBean = NewSimpleBean.of(WrappedSimpleBean.class, manager);
- manager.addBean(newSimpleBean);
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanIsDependentScoped()
- {
- assert Dependent.class.equals(newSimpleBean.getScopeType());
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanIsOfStandardDeploymentType()
- {
- assert Standard.class.equals(newSimpleBean.getDeploymentType());
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanIsHasOnlyNewBinding()
- {
- assert newSimpleBean.getBindings().size() == 1;
- assert newSimpleBean.getBindings().iterator().next().annotationType().equals(new NewBinding().annotationType());
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoWebBeanName()
- {
- assert newSimpleBean.getName() == null;
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "stub", "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoStereotypes()
- {
- assert false;
- }
-
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasImplementationClassOfInjectionPointType()
- {
- assert newSimpleBean.getType().equals(WrappedSimpleBean.class);
- }
-
- /**
- * If the parameter type satisfies the definition of a simple Web Bean
- * implementation class, Section 3.2.1, �Which Java classes are simple Web
- * Beans?�, then the Web Bean is a simple Web Bean. If the parameter type
- * satisfies the definition of an enterprise Web Bean implementation class,
- * Section 3.3.2, �Which EJBs are enterprise Web Beans?�, then the Web Bean
- * is an enterprise Web Bean.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanIsSimpleWebBeanIfParameterTypeIsSimpleWebBean()
- {
- assert newSimpleBean.getType().equals(wrappedSimpleBean.getType());
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasSameConstructorAsWrappedBean()
- {
- assert wrappedSimpleBean.getConstructor().equals(newSimpleBean.getConstructor());
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
- {
- assert newSimpleBean.getInitializerMethods().equals(wrappedSimpleBean.getInitializerMethods());
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
- {
- Set<AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedSimpleBean.getAnnotatedInjectionPoints();
- Set<AnnotatedItem<?, ?>> newBeanInjectionPoints = newSimpleBean.getAnnotatedInjectionPoints();
- assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = {"new", "stub" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoObservers()
- {
- assert false;
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new", "stub" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoProducerFields()
- {
- assert false;
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new", "stub" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoProducerMethods()
- {
- assert false;
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoDisposalMethods()
- {
- Class<?> type = TypeInfo.ofTypes(newSimpleBean.getTypes()).getSuperClass();
- assert manager.resolveDisposalMethods(type, newSimpleBean.getBindings().toArray(new Annotation[0])).isEmpty();
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "stub", "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
- {
- assert false;
- }
-
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewBeanHasNoDecorators()
- {
- Annotation[] bindingTypes = newSimpleBean.getBindings().toArray(new Annotation[0]);
- assert manager.resolveDecorators(newSimpleBean.getTypes(), bindingTypes).isEmpty();
- }
-
- /**
- * The @New annotation or <New> element may be applied to any field of a Web
- * Bean implementation class or to any parameter of a producer method,
- * initializer method, disposal method or Web Bean constructor where the type
- * of the field or parameter is a concrete Java type which satisfies the
- * requirements of a simple Web Bean implementation class or enterprise Web
- * Bean implementation class.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationMayBeAppliedToField()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(AnnotatedField.class, WrappedSimpleBean.class));
- webBeansBootstrap.boot();
- assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
- }
-
- /**
- * The @New annotation or <New> element may be applied to any field of a Web
- * Bean implementation class or to any parameter of a producer method,
- * initializer method, disposal method or Web Bean constructor where the type
- * of the field or parameter is a concrete Java type which satisfies the
- * requirements of a simple Web Bean implementation class or enterprise Web
- * Bean implementation class.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationMayBeAppliedToProducerMethodParameter()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(AnnotatedProducerParameter.class, WrappedSimpleBean.class));
- webBeansBootstrap.boot();
- assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
- }
-
- /**
- * The @New annotation or <New> element may be applied to any field of a Web
- * Bean implementation class or to any parameter of a producer method,
- * initializer method, disposal method or Web Bean constructor where the type
- * of the field or parameter is a concrete Java type which satisfies the
- * requirements of a simple Web Bean implementation class or enterprise Web
- * Bean implementation class.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationMayBeAppliedToInitializerMethodParameter()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(AnnotatedInitializerParameter.class, WrappedSimpleBean.class));
- webBeansBootstrap.boot();
- assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
- }
-
- /**
- * The @New annotation or <New> element may be applied to any field of a Web
- * Bean implementation class or to any parameter of a producer method,
- * initializer method, disposal method or Web Bean constructor where the type
- * of the field or parameter is a concrete Java type which satisfies the
- * requirements of a simple Web Bean implementation class or enterprise Web
- * Bean implementation class.
- */
- @Test(groups = { "new" })
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationMayBeAppliedToConstructorMethodParameter()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(AnnotatedConstructorParameter.class, WrappedSimpleBean.class));
- webBeansBootstrap.boot();
- assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
- }
-
- /**
- * If the @New binding type appears in conjunction with some other binding
- * type, or is specified for a field or parameter of a type which does not
- * satisfy the definition of a simple Web Bean implementation class or
- * enterprise Web Bean implementation class, a DefinitionException is thrown
- * by the container at deployment time.
- */
- @Test(groups = { "new", "broken" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationCannotAppearInConjunctionWithOtherBindingType()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(NewAndOtherBindingType.class));
- webBeansBootstrap.boot();
- }
-
- /**
- * If the @New binding type appears in conjunction with some other binding
- * type, or is specified for a field or parameter of a type which does not
- * satisfy the definition of a simple Web Bean implementation class or
- * enterprise Web Bean implementation class, a DefinitionException is thrown
- * by the container at deployment time.
- */
- @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationCannotBeAppliedToNonWebBeanImplementationClass()
- {
- assert false;
- }
-
- /**
- * No Web Bean defined using annotations or XML may explicitly declare @New
- * as a binding type
- */
- @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.9")
- public void testNewAnnotationCannotBeExplicitlyDeclared()
- {
- assert false;
- }
-
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewSimpleBeanTest.java (from rev 1036, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/newbean/NewSimpleBeanTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewSimpleBeanTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewSimpleBeanTest.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,60 @@
+package org.jboss.webbeans.test.unit;
+
+import java.util.Set;
+
+import org.jboss.webbeans.bean.NewSimpleBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecVersion;
+import org.jboss.webbeans.test.newbean.valid.WrappedSimpleBean;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081222")
+public class NewSimpleBeanTest extends AbstractTest
+{
+ private SimpleBean<WrappedSimpleBean> wrappedSimpleBean;
+ private NewSimpleBean<WrappedSimpleBean> newSimpleBean;
+
+ @BeforeMethod
+ public void initNewBean() {
+ wrappedSimpleBean = SimpleBean.of(WrappedSimpleBean.class, manager);
+ manager.addBean(wrappedSimpleBean);
+ newSimpleBean = NewSimpleBean.of(WrappedSimpleBean.class, manager);
+ manager.addBean(newSimpleBean);
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasImplementationClassOfInjectionPointType()
+ {
+ assert newSimpleBean.getType().equals(WrappedSimpleBean.class);
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanIsSimpleWebBeanIfParameterTypeIsSimpleWebBean()
+ {
+ assert newSimpleBean.getType().equals(wrappedSimpleBean.getType());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameConstructorAsWrappedBean()
+ {
+ assert wrappedSimpleBean.getConstructor().equals(newSimpleBean.getConstructor());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
+ {
+ assert newSimpleBean.getInitializerMethods().equals(wrappedSimpleBean.getInitializerMethods());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
+ {
+ Set<AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedSimpleBean.getAnnotatedInjectionPoints();
+ Set<AnnotatedItem<?, ?>> newBeanInjectionPoints = newSimpleBean.getAnnotatedInjectionPoints();
+ assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/NewSimpleBeanTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/literals/NewBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/literals/NewBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/literals/NewBinding.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.impl.literals;
+
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.New;
+
+public class NewBinding extends AnnotationLiteral<New> implements New
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/literals/NewBinding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedConstructorParameter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedConstructorParameter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedConstructorParameter.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.New;
+
+
+class AnnotatedConstructorParameter
+{
+ @Initializer
+ public AnnotatedConstructorParameter(@New WrappedSimpleBean reference)
+ {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedConstructorParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedField.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedField.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedField.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.New;
+
+
+class AnnotatedField
+{
+ @New
+ WrappedSimpleBean reference;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedInitializerParameter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedInitializerParameter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedInitializerParameter.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.New;
+
+
+class AnnotatedInitializerParameter
+{
+ @Initializer
+ public void init(@New WrappedSimpleBean reference)
+ {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedInitializerParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedProducerParameter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedProducerParameter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedProducerParameter.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.New;
+import javax.webbeans.Produces;
+
+
+class AnnotatedProducerParameter
+{
+ @Produces
+ Object produce(@New WrappedSimpleBean reference)
+ {
+ return new Object();
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnnotatedProducerParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewAndOtherBindingType_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewAndOtherBindingType_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewAndOtherBindingType_Broken.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Current;
+import javax.webbeans.New;
+
+class NewAndOtherBindingType_Broken
+{
+ public @New @Current WrappedSimpleBean violation;
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewAndOtherBindingType_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewSimpleBeanTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewSimpleBeanTest.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,324 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.webbeans.DefinitionException;
+import javax.webbeans.Dependent;
+import javax.webbeans.Standard;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.impl.literals.NewBinding;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081222")
+public class NewSimpleBeanTest extends AbstractTest
+{
+
+ private Bean<WrappedSimpleBean> newSimpleBean;
+
+ @BeforeMethod
+ public void initNewBean()
+ {
+ deployBeans(WrappedSimpleBean.class);
+ Set<Bean<WrappedSimpleBean>> beans = manager.resolveByType(WrappedSimpleBean.class, new NewBinding());
+ assert beans.size() == 1;
+ newSimpleBean = beans.iterator().next();
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanIsDependentScoped()
+ {
+ assert Dependent.class.equals(newSimpleBean.getScopeType());
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanIsOfStandardDeploymentType()
+ {
+ assert Standard.class.equals(newSimpleBean.getDeploymentType());
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanIsHasOnlyNewBinding()
+ {
+ assert newSimpleBean.getBindings().size() == 1;
+ assert newSimpleBean.getBindings().iterator().next().annotationType().equals(new NewBinding().annotationType());
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoWebBeanName()
+ {
+ assert newSimpleBean.getName() == null;
+ }
+
+ /**
+ * When the built-in binding type @New is applied to an injection point, a
+ * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
+ *
+ * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
+ * stereotypes, and such that � the implementation class is the
+ * declared type of the injection point.
+ */
+ @Test(groups = { "stub", "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoStereotypes()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = {"new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoObservers()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoProducerFields()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new", "stub" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoProducerMethods()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new" , "stub"})
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoDisposalMethods()
+ {
+ //Class<?> type = TypeInfo.ofTypes(newSimpleBean.getTypes()).getSuperClass();
+ //assert manager.resolveDisposalMethods(type, newSimpleBean.getBindings().toArray(new Annotation[0])).isEmpty();
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "stub", "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
+ {
+ assert false;
+ }
+
+ /**
+ * Furthermore, this Web Bean: � has the same Web Bean constructor,
+ * initializer methods and injected fields as a Web Bean defined using
+ * annotations� that is, it has any Web Bean constructor, initializer method
+ * or injected field declared by annotations that appear on the
+ * implementation class, � has no observer methods, producer methods or
+ * fields or disposal methods, � has the same interceptors as a Web Bean
+ * defined using annotations�that is, it has all the interceptor binding
+ * types declared by annotations that appear on the implementation class, and
+ * � has no decorators.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewBeanHasNoDecorators()
+ {
+ Annotation[] bindingTypes = newSimpleBean.getBindings().toArray(new Annotation[0]);
+ assert manager.resolveDecorators(newSimpleBean.getTypes(), bindingTypes).isEmpty();
+ }
+
+ /**
+ * The @New annotation or <New> element may be applied to any field of a Web
+ * Bean implementation class or to any parameter of a producer method,
+ * initializer method, disposal method or Web Bean constructor where the type
+ * of the field or parameter is a concrete Java type which satisfies the
+ * requirements of a simple Web Bean implementation class or enterprise Web
+ * Bean implementation class.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationMayBeAppliedToField()
+ {
+ deployBeans(AnnotatedField.class, WrappedSimpleBean.class);
+ assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
+ }
+
+ /**
+ * The @New annotation or <New> element may be applied to any field of a Web
+ * Bean implementation class or to any parameter of a producer method,
+ * initializer method, disposal method or Web Bean constructor where the type
+ * of the field or parameter is a concrete Java type which satisfies the
+ * requirements of a simple Web Bean implementation class or enterprise Web
+ * Bean implementation class.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationMayBeAppliedToProducerMethodParameter()
+ {
+ deployBeans(AnnotatedProducerParameter.class, WrappedSimpleBean.class);
+ assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
+ }
+
+ /**
+ * The @New annotation or <New> element may be applied to any field of a Web
+ * Bean implementation class or to any parameter of a producer method,
+ * initializer method, disposal method or Web Bean constructor where the type
+ * of the field or parameter is a concrete Java type which satisfies the
+ * requirements of a simple Web Bean implementation class or enterprise Web
+ * Bean implementation class.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationMayBeAppliedToInitializerMethodParameter()
+ {
+ deployBeans(AnnotatedInitializerParameter.class, WrappedSimpleBean.class);
+ assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
+ }
+
+ /**
+ * The @New annotation or <New> element may be applied to any field of a Web
+ * Bean implementation class or to any parameter of a producer method,
+ * initializer method, disposal method or Web Bean constructor where the type
+ * of the field or parameter is a concrete Java type which satisfies the
+ * requirements of a simple Web Bean implementation class or enterprise Web
+ * Bean implementation class.
+ */
+ @Test(groups = { "new" })
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationMayBeAppliedToConstructorMethodParameter()
+ {
+ deployBeans(AnnotatedConstructorParameter.class, WrappedSimpleBean.class);
+ assert manager.resolveByType(WrappedSimpleBean.class, new NewBinding()).size() == 1;
+ }
+
+ /**
+ * If the @New binding type appears in conjunction with some other binding
+ * type, or is specified for a field or parameter of a type which does not
+ * satisfy the definition of a simple Web Bean implementation class or
+ * enterprise Web Bean implementation class, a DefinitionException is thrown
+ * by the container at deployment time.
+ */
+ @Test(groups = { "new", "broken" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationCannotAppearInConjunctionWithOtherBindingType()
+ {
+ deployBeans(NewAndOtherBindingType_Broken.class);
+ }
+
+ /**
+ * If the @New binding type appears in conjunction with some other binding
+ * type, or is specified for a field or parameter of a type which does not
+ * satisfy the definition of a simple Web Bean implementation class or
+ * enterprise Web Bean implementation class, a DefinitionException is thrown
+ * by the container at deployment time.
+ */
+ @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationCannotBeAppliedToNonWebBeanImplementationClass()
+ {
+ assert false;
+ }
+
+ /**
+ * No Web Bean defined using annotations or XML may explicitly declare @New
+ * as a binding type
+ */
+ @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "3.9")
+ public void testNewAnnotationCannotBeExplicitlyDeclared()
+ {
+ assert false;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/NewSimpleBeanTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/WrappedSimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/WrappedSimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/WrappedSimpleBean.java 2009-01-17 17:13:26 UTC (rev 1040)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import java.io.Serializable;
+
+import javax.webbeans.Named;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+@Named("Fred")
+class WrappedSimpleBean implements Serializable
+{
+ public WrappedSimpleBean() {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/WrappedSimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
[webbeans-commits] Webbeans SVN: r1039 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-17 11:54:32 -0500 (Sat, 17 Jan 2009)
New Revision: 1039
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/application/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/application/ApplicationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/conversation/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/conversation/ConversationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Animal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlyAnimal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlySpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Fox.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/FoxRun.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Spider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Tarantula.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/City.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityBinding.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityInterface.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer2.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer3.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Espoo_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Forssa_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hamina_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Helsinki.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hyvinkaa.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Joensuu.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jyvaskyla.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kaarina_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kotka_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kuopio_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Loviisa_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Maarianhamina_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Mikkeli_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Nokia_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Peraseinajoki.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Pietarsaari_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Porvoo_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Raisio_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Salo_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Turku.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Uusikaupunki_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vaasa.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vantaa_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation2.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/request/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/request/RequestContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/session/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/session/SessionContextTest.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java
Log:
port passivation tests, some disabled due to weirdness of tests
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,608 +0,0 @@
-package org.jboss.webbeans.test.contexts;
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.webbeans.ApplicationScoped;
-import javax.webbeans.ConversationScoped;
-import javax.webbeans.DefinitionException;
-import javax.webbeans.IllegalProductException;
-import javax.webbeans.RequestScoped;
-import javax.webbeans.SessionScoped;
-import javax.webbeans.UnserializableDependencyException;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.MetaDataCache;
-import org.jboss.webbeans.bean.AbstractProducerBean;
-import org.jboss.webbeans.bean.EnterpriseBean;
-import org.jboss.webbeans.bean.ProducerFieldBean;
-import org.jboss.webbeans.bean.ProducerMethodBean;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.jboss.webbeans.test.contexts.invalid.CityProducer;
-import org.jboss.webbeans.test.contexts.invalid.CityProducer2;
-import org.jboss.webbeans.test.contexts.invalid.CityProducer3;
-import org.jboss.webbeans.test.contexts.invalid.Espoo;
-import org.jboss.webbeans.test.contexts.invalid.Forssa;
-import org.jboss.webbeans.test.contexts.invalid.Hamina;
-import org.jboss.webbeans.test.contexts.invalid.Jamsa;
-import org.jboss.webbeans.test.contexts.invalid.Kaarina;
-import org.jboss.webbeans.test.contexts.invalid.Kotka;
-import org.jboss.webbeans.test.contexts.invalid.Kuopio;
-import org.jboss.webbeans.test.contexts.invalid.Loviisa;
-import org.jboss.webbeans.test.contexts.invalid.Maarianhamina;
-import org.jboss.webbeans.test.contexts.invalid.Mikkeli;
-import org.jboss.webbeans.test.contexts.invalid.Nokia;
-import org.jboss.webbeans.test.contexts.invalid.Peraseinajoki;
-import org.jboss.webbeans.test.contexts.invalid.Pietarsaari;
-import org.jboss.webbeans.test.contexts.invalid.Porvoo;
-import org.jboss.webbeans.test.contexts.invalid.Raisio;
-import org.jboss.webbeans.test.contexts.invalid.Salo;
-import org.jboss.webbeans.test.contexts.invalid.Uusikaupunki;
-import org.jboss.webbeans.test.contexts.invalid.Vantaa;
-import org.jboss.webbeans.test.contexts.invalid.Violation;
-import org.jboss.webbeans.test.contexts.invalid.Violation2;
-import org.jboss.webbeans.test.contexts.valid.Helsinki;
-import org.jboss.webbeans.test.contexts.valid.Hyvinkaa;
-import org.jboss.webbeans.test.contexts.valid.Joensuu;
-import org.jboss.webbeans.test.contexts.valid.Jyvaskyla;
-import org.jboss.webbeans.test.contexts.valid.Turku;
-import org.jboss.webbeans.test.contexts.valid.Vaasa;
-import org.jboss.webbeans.util.BeanValidation;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Nicklas Karlsson
- *
- */
-@SpecVersion("20081206")
-@SuppressWarnings("unused")
-public class PassivatingContextTest extends AbstractTest
-{
- @BeforeMethod
- public void initContext()
- {
- addToEjbCache(Turku.class);
- addToEjbCache(Kaarina.class);
- addToEjbCache(Espoo.class);
- addToEjbCache(Maarianhamina.class);
- addToEjbCache(Porvoo.class);
- addToEjbCache(Pietarsaari.class);
- }
-
- /**
- * EJB local objects are serializable. Therefore, an enterprise Web Bean may
- * declare any passivating scope.
- */
- @Test(groups = { "contexts", "passivation", "enterpriseBean" })
- @SpecAssertion(section = "9.5")
- public void testEJBWebBeanCanDeclarePassivatingScope()
- {
- EnterpriseBean<Turku> bean = EnterpriseBean.of(Turku.class, manager);
- assert true;
- }
-
- /**
- * Simple Web Beans are not required to be serializable. If a simple Web Bean
- * declares a passivating scope, and the implementation class is not
- * serializable, a DefinitionException is thrown by the Web Bean manager at
- * initialization time.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "9.5")
- public void testSimpleWebBeanWithNonSerializableImplementationClassFails()
- {
- registerBeans(new Class<?>[] { Hamina.class });
- }
-
- /**
- * Simple Web Beans are not required to be serializable. If a simple Web Bean
- * declares a passivating scope, and the implementation class is not
- * serializable, a DefinitionException is thrown by the Web Bean manager at
- * initialization time.
- */
- @Test(groups = {"contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testSimpleWebBeanWithSerializableImplementationClassOK()
- {
- SimpleBean<Jyvaskyla> bean = SimpleBean.of(Jyvaskyla.class, manager);
- assert true;
- }
-
- /**
- * The built-in session and conversation scopes are passivating. No other
- * built-in scope is passivating.
- */
- @Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testIsSessionScopePassivating()
- {
- assert MetaDataCache.instance().getScopeModel(SessionScoped.class).isPassivating();
- }
-
- /**
- * The built-in session and conversation scopes are passivating. No other
- * built-in scope is passivating.
- */
- @Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testIsConversationScopePassivating()
- {
- assert MetaDataCache.instance().getScopeModel(ConversationScoped.class).isPassivating();
- }
-
- /**
- * The built-in session and conversation scopes are passivating. No other
- * built-in scope is passivating.
- */
- @Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testIsApplicationScopeNonPassivating()
- {
- assert !MetaDataCache.instance().getScopeModel(ApplicationScoped.class).isPassivating();
- }
-
- /**
- * The built-in session and conversation scopes are passivating. No other
- * built-in scope is passivating.
- */
- @Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testIsRequestScopeNonPassivating()
- {
- assert !MetaDataCache.instance().getScopeModel(RequestScoped.class).isPassivating();
- }
-
- /**
- * the Web Bean declares a passivating scope type, and context passivation
- * occurs, or
- *
- * @throws IOException
- * @throws ClassNotFoundException
- */
- @Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated() throws IOException, ClassNotFoundException
- {
- SimpleBean<Jyvaskyla> bean = SimpleBean.of(Jyvaskyla.class, manager);
- //assert testSerialize(bean);
- }
-
- @SuppressWarnings("unchecked")
- private <T> boolean testSerialize(Bean<T> bean) throws IOException, ClassNotFoundException
- {
- manager.addBean(bean);
- T instance = manager.getInstance(bean);
- byte[] data = serialize(instance);
- T resurrected = (T) deserialize(data);
- return resurrected.toString().equals(instance.toString());
- }
-
- /**
- * the Web Bean is an EJB stateful session bean, and it is passivated by the
- * EJB container.
- *
- * @throws ClassNotFoundException
- * @throws IOException
- */
- // TODO requires an EJB instance
- @Test(groups = { "contexts", "passivation", "broken" })
- @SpecAssertion(section = "9.5")
- public void testStatefulEJBIsSerializedWhenPassivatedByEJBContainer() throws IOException, ClassNotFoundException
- {
- EnterpriseBean<Turku> bean = EnterpriseBean.of(Turku.class, manager);
- assert testSerialize(bean);
- }
-
- /**
- * On the other hand, dependent objects (including interceptors and
- * decorators with scope @Dependent) of a stateful session bean or of a Web
- * Bean with a passivating scope must be serialized and deserialized along
- * with their owner
- */
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentInterceptorsOfStatefulEnterpriseBeanMustBeSerializable()
- {
- EnterpriseBean<Kaarina> bean = EnterpriseBean.of(Kaarina.class, manager);
- }
-
- /**
- * On the other hand, dependent objects (including interceptors and
- * decorators with scope @Dependent) of a stateful session bean or of a Web
- * Bean with a passivating scope must be serialized and deserialized along
- * with their owner
- */
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentDecoratorsOfStatefulEnterpriseBeanMustBeSerializable()
- {
- EnterpriseBean<Porvoo> bean = EnterpriseBean.of(Porvoo.class, manager);
- }
-
- /**
- * On the other hand, dependent objects (including interceptors and
- * decorators with scope @Dependent) of a stateful session bean or of a Web
- * Bean with a passivating scope must be serialized and deserialized along
- * with their owner
- */
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentInterceptorsOfWebBeanWithPassivatingScopeMustBeSerializable()
- {
- SimpleBean<Kotka> bean = SimpleBean.of(Kotka.class, manager);
- }
-
- /**
- * On the other hand, dependent objects (including interceptors and
- * decorators with scope @Dependent) of a stateful session bean or of a Web
- * Bean with a passivating scope must be serialized and deserialized along
- * with their owner
- */
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentDecoratorsOfWebBeansWithPassivatingScopeMustBeSerializable()
- {
- SimpleBean<Raisio> bean = SimpleBean.of(Raisio.class, manager);
- }
-
- /**
- * EJB local objects are serializable. Therefore, any reference to an
- * enterprise Web Bean of scope @Dependent is serializable.
- *
- * @throws ClassNotFoundException
- * @throws IOException
- */
- @Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
- {
- SimpleBean<Vaasa> bean = SimpleBean.of(Vaasa.class, manager);
- manager.addBean(SimpleBean.of(Helsinki.class, manager));
- assert testSerialize(bean);
- }
-
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
- @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanFails()
- {
- manager.addBean(SimpleBean.of(Violation.class, manager));
- EnterpriseBean<Espoo> bean = EnterpriseBean.of(Espoo.class, manager);
- bean.postConstruct(null);
- }
-
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
- {
- registerBeans(new Class<?>[] { Violation.class, Vantaa.class });
- BeanValidation.validate(manager.getBeans());
- }
-
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
- @Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoTransientFieldOK()
- {
- SimpleBean<Joensuu> bean = SimpleBean.of(Joensuu.class, manager);
- }
-
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
- {
- registerBeans(new Class<?>[] { Violation.class, Loviisa.class} );
- BeanValidation.validate(manager.getBeans());
- }
-
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
- {
- registerBeans(new Class<?>[] { Violation.class, Forssa.class });
- BeanValidation.validate(manager.getBeans());
- }
-
- /**
- * If a simple Web Bean of scope @Dependent and a non-serializable
- * implementation class is injected into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * UnserializableDependencyException must be thrown by the Web Bean manager
- * at initialization time.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
- @SpecAssertion(section = "9.5")
- public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails()
- {
- manager.addBean(SimpleBean.of(Violation.class, manager));
- Bean<?> producerBean = registerProducerBean(Peraseinajoki.class, "create", Violation2.class);
- BeanValidation.validate(manager.getBeans());
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- *
- * @throws NoSuchMethodException
- * @throws SecurityException
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulEnterpriseBeanFails() throws SecurityException, NoSuchMethodException
- {
- registerProducerBean(CityProducer2.class, "create", Violation.class);
- EnterpriseBean<Maarianhamina> ejb = EnterpriseBean.of(Maarianhamina.class, manager);
- ejb.postConstruct(null);
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
- {
- registerProducerBean(CityProducer2.class, "create", Violation.class);
- getInstance(Nokia.class).ping();
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
- {
- SimpleBean<CityProducer2> bean = SimpleBean.of(CityProducer2.class, manager);
- SimpleBean<Hyvinkaa> ejb = SimpleBean.of(Hyvinkaa.class, manager);
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
- {
- registerProducerBean(CityProducer2.class, "create", Violation.class);
- getInstance(Loviisa.class).ping();
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
- {
- registerProducerBean(CityProducer2.class, "create", Violation.class);
- getInstance(Kuopio.class).ping();
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
- {
- registerProducerBean(CityProducer3.class, "create", Violation.class);
- Bean<?> producerBean = registerProducerBean(Jamsa.class, "create", Violation.class);
- Jamsa producerInstance = (Jamsa)producerBean.create();
- producerInstance.ping();
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- *
- * @throws NoSuchFieldException
- * @throws SecurityException
- */
- @Test(groups = { "contexts", "passivation"}, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails() throws SecurityException, NoSuchFieldException
- {
- registerProducerBean(CityProducer.class, "reference", Violation.class);
- EnterpriseBean<Pietarsaari> bean = EnterpriseBean.of(Pietarsaari.class, manager);
- // TODO: hack
- BeanValidation.validate(manager.getBeans());
- bean.postConstruct(null);
- assert true;
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
- {
- registerProducerBean(CityProducer.class, "reference", Violation.class);
- getInstance(Uusikaupunki.class).ping();
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation"})
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
- {
- registerProducerBean(CityProducer.class, "reference", Violation.class);
- getInstance(Salo.class).ping();
- assert true;
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
- {
- registerProducerBean(CityProducer.class, "reference", Violation.class);
- getInstance(Loviisa.class).ping();
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
- {
- registerProducerBean(CityProducer.class, "reference", Violation.class);
- getInstance(Mikkeli.class).ping();
- }
-
- private <T> T getInstance(Class<T> clazz)
- {
- Bean<T> bean = null;
- if (CurrentManager.rootManager().getEjbDescriptorCache().containsKey(clazz))
- {
- bean = EnterpriseBean.of(clazz, manager);
- }
- else
- {
- bean = SimpleBean.of(clazz, manager);
- }
- manager.addBean(bean);
- return manager.getInstance(bean);
- }
-
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- */
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "9.5")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
- {
- registerProducerBean(CityProducer.class, "reference", Violation.class);
- Bean<?> producerBean = registerProducerBean(Jamsa.class, "create", Violation.class);
- Jamsa producerInstance = (Jamsa)producerBean.create();
- producerInstance.ping();
-
- }
-
- /**
- * The Web Bean manager must guarantee that JMS endpoint proxy objects are
- * serializable.
- */
- @Test(groups = { "stub", "contexts", "passivation", "jms" })
- @SpecAssertion(section = "9.5")
- public void testJMSEndpointProxyIsSerializable()
- {
- assert false;
- }
-}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/PassivatingContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/PassivatingContextTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/PassivatingContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,54 @@
+package org.jboss.webbeans.test.unit;
+
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.ConversationScoped;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.SessionScoped;
+
+import org.jboss.webbeans.MetaDataCache;
+import org.testng.annotations.Test;
+
+public class PassivatingContextTest extends org.jboss.webbeans.test.AbstractTest
+{
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ public void testIsSessionScopePassivating()
+ {
+ assert MetaDataCache.instance().getScopeModel(SessionScoped.class).isPassivating();
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ public void testIsConversationScopePassivating()
+ {
+ assert MetaDataCache.instance().getScopeModel(ConversationScoped.class).isPassivating();
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ public void testIsApplicationScopeNonPassivating()
+ {
+ assert !MetaDataCache.instance().getScopeModel(ApplicationScoped.class).isPassivating();
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ public void testIsRequestScopeNonPassivating()
+ {
+ assert !MetaDataCache.instance().getScopeModel(RequestScoped.class).isPassivating();
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/PassivatingContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -83,6 +83,11 @@
return configuration().getBeans().createSimpleBean(beanClass);
}
+ public <T> Bean<T> createEnterpriseBean(Class<T> beanClass)
+ {
+ return configuration().getBeans().createEnterpriseBean(beanClass);
+ }
+
public <T> Bean<T> createProducerMethodBean(Method method, Bean<?> producerBean)
{
return configuration().getBeans().createProducerMethodBean(method, producerBean);
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-interface Animal
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,20 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.webbeans.DeploymentType;
-
-@Target( { TYPE, METHOD })
-@Retention(RUNTIME)
-@Documented
-@DeploymentType
-@interface AnotherDeploymentType
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-interface DeadlyAnimal
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-interface DeadlySpider extends DeadlyAnimal
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,601 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-import java.lang.reflect.Method;
-import java.util.Set;
-
-import javax.webbeans.ContextNotActiveException;
-import javax.webbeans.Dependent;
-import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Context;
-
-import org.jboss.webbeans.tck.impl.SpecAssertion;
-import org.jboss.webbeans.tck.impl.SpecVersion;
-import org.jboss.webbeans.tck.tests.AbstractTest;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class DependentContextTest extends AbstractTest
-{
-
- /**
- * No injected instance of the Web Bean is ever shared between multiple
- * injection points.
- */
- @Test(groups = { "contexts", "injection" })
- @SpecAssertion(section = "9.4")
- public void testInstanceNotSharedBetweenInjectionPoints()
- {
- deployBeans(Fox.class, FoxRun.class);
- Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
- assert foxBeans.size() == 1;
- Bean<Fox> foxBean = foxBeans.iterator().next();
- Set<Bean<FoxRun>> foxRunBeans = manager.resolveByType(FoxRun.class);
- assert foxRunBeans.size() == 1;
- Bean<FoxRun> foxRunBean = foxRunBeans.iterator().next();
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert !foxRun.fox.equals(foxRun.anotherFox);
- }
-
- /**
- * Any instance of the Web Bean that is used to evaluate a Unified EL
- * expression exists to service that evaluation only.
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForElEvalutionNotShared()
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "contexts", "producerMethod", "broken" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForProducerMethodNotShared() throws Exception
- {
- Bean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
- manager.addBean(spiderProducer);
- Method method = SpiderProducer.class.getMethod("produceTarantula");
- Bean<Tarantula> tarantulaBean = createProducerMethodBean(method, spiderProducer);
- Tarantula tarantula = tarantulaBean.create();
- Tarantula tarantula2 = tarantulaBean.create();
- assert tarantula != null;
- assert tarantula2 != null;
- assert tarantula != tarantula2;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "contexts", "producerMethod", "stub" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForProducerFieldNotShared() throws Exception
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForDisposalMethodNotShared()
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForObserverMethodNotShared()
- {
- assert false;
- }
-
- /**
- * Every invocation of the get() operation of the Context object for the @Dependent
- * scope with the value true for the create parameter returns a new instance
- * of the given Web Bean
- */
- @Test(groups = "contexts")
- @SpecAssertion(section = "9.4")
- public void testContextGetWithCreateTrueReturnsNewInstance() throws Exception
- {
- deployBeans(Fox.class);
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
- assert foxBeans.size() == 1;
- Bean<Fox> foxBean = foxBeans.iterator().next();
- Context context = manager.getContext(Dependent.class);
- assert context.get(foxBean, true) != null;
- assert context.get(foxBean, true) instanceof Fox;
- }
-
- }.run();
-
- }
-
- /**
- * Every invocation of the get() operation of the Context object for the @Dependent
- * scope with the value false for the create parameter returns a null value
- */
- @Test(groups = "contexts")
- @SpecAssertion(section = "9.4")
- public void testContextGetWithCreateFalseReturnsNull() throws Exception
- {
- deployBeans(Fox.class);
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
- assert foxBeans.size() == 1;
- Bean<Fox> foxBean = foxBeans.iterator().next();
- Context context = manager.getContext(Dependent.class);
- assert context.get(foxBean, false) == null;
- }
-
- }.run();
-
-
- }
-
- /**
- * The @Dependent scope is inactive except:
- */
- @Test(groups = {"contexts"}, expectedExceptions = ContextNotActiveException.class)
- @SpecAssertion(section = "9.4")
- public void testContextIsInactive()
- {
- manager.getContext(Dependent.class).isActive();
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingProducerMethod()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "producerField" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingProducerField()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingDisposalMethod()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingObserverMethod()
- {
- assert false;
- }
-
- /**
- * while a Unified EL expression is evaluated, or
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenEvaluatingElExpression()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "contexts", "beanLifecycle" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringBeanCreation()
- {
- // Slightly roundabout, but I can't see a better way to test atm
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
- Bean<Fox> foxBean = createSimpleBean(Fox.class);
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert foxRun.fox != null;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "stub", "contexts", "beanDestruction" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringBeanDestruction()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "contexts", "injection" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringInjection()
- {
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
- Bean<Fox> foxBean = createSimpleBean(Fox.class);
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert foxRun.fox != null;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "injection", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBDependencyInjection()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "injection", "stub", "servlet" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringServletDependencyInjection()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "postconstruct", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBPostConstruct()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "predestroy", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBPreDestroy()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "constructor" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromConstructor()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "removeMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromRemoveMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "initalizerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromInitializerMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromProducerMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromDisposalMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "preDestroy" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromPreDestroy()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "postConstruct" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromPostConstruct()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "interceptor" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromInterceptorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "decorator" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromDecoratorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "initializerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromInitializer()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "postConstruct" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromPostConstruct()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "preDestroy" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromPreDestroy()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "interceptor" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromInterceptorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * A Servlet may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods
- */
- @Test(groups = { "stub", "contexts", "servlet", "initializerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testServletBeanMayCreateInstanceFromInitializer()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of a Web Bean instance when the instance is
- * destroyed,
- */
- @Test(groups = { "stub", "contexts", "beanDestruction" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingParentDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
- * or Servlet is destroyed,
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingEjbDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
- * or Servlet is destroyed,
- */
- @Test(groups = { "stub", "contexts", "servlet" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingServletDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all @Dependent scoped contextual instances created during an EL
- * expression evaluation when the evaluation completes, and
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenElEvaluationCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenProducerMethodCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "producerField" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenProducerFieldCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenDisposalMethodCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
- {
- assert false;
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-import javax.webbeans.Dependent;
-
-@Dependent
-class Fox
-{
-
- public String getName()
- {
- return "gavin";
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-import javax.webbeans.Current;
-
-class FoxRun
-{
-
- @Current
- public Fox fox;
-
- @Current
- public Fox anotherFox;
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,12 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-
-class Spider implements Animal
-{
-
- public final void layEggs()
- {
-
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-import javax.webbeans.Produces;
-
-@AnotherDeploymentType
-class SpiderProducer
-{
-
- @Produces public Tarantula produceTarantula()
- {
- return new Tarantula();
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java 2009-01-17 14:58:44 UTC (rev 1038)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.tck.tests.context;
-
-class Tarantula extends Spider implements DeadlySpider
-{
-
-}
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/application/ApplicationContextTest.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ApplicationContextTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/application/ApplicationContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/application/ApplicationContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,92 @@
+package org.jboss.webbeans.tck.tests.context.application;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class ApplicationContextTest extends AbstractTest
+{
+
+ /**
+ * The application scope is active during the service() method of any servlet
+ * in the web application.
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringServiceMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The application scope is active during any Java EE web service invocation.
+ */
+ @Test(groups = { "stub", "contexts", "webservice" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringWebSericeInvocation()
+ {
+ assert false;
+ }
+
+ /**
+ * The application scope is also active during any remote method invocation
+ * of any EJB bean, during any call to an EJB timeout method and during
+ * message delivery to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringRemoteMethodInvocationOfEjb()
+ {
+ assert false;
+ }
+
+ /**
+ * The application scope is also active during any remote method invocation
+ * of any EJB bean, during any call to an EJB timeout method and during
+ * message delivery to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The application scope is also active during any remote method invocation
+ * of any EJB bean, during any call to an EJB timeout method and during
+ * message delivery to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringEjbMessageDelivery()
+ {
+ assert false;
+ }
+
+ /**
+ * The application context is shared between all servlet requests, web
+ * service invocations, EJB remote method invocations, EJB timeouts and
+ * message deliveries to message driven beans that execute within the same
+ * application
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationContextSharedBetweenInvokationsInApplication()
+ {
+ assert false;
+ }
+
+ /**
+ * The application context is destroyed when the application is undeployed.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeDestroyedWhenApplicationIsUndeployed()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/application/ApplicationContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/conversation/ConversationContextTest.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ConversationContextTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/conversation/ConversationContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/conversation/ConversationContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,231 @@
+package org.jboss.webbeans.tck.tests.context.conversation;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@SpecVersion("20081206")
+public class ConversationContextTest extends AbstractTest
+{
+ /**
+ * For a JSF faces request, the context is active from the beginning of the
+ * apply request values phase, until the response is complete.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testContextActiveFromBeginningOfApplyRequestValuesPhasetoResponseCompleteForJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * For a JSF non-faces request, the context is active during the render
+ * response phase
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testContextActiveDuringRenderResponsePhaseForNonFacesJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * Any JSF request has exactly one associated conversation
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testJsfRequestHasExactlyOneAssociatedConversation()
+ {
+ assert false;
+ }
+
+ /**
+ * The conversation associated with a JSF request is determined at the end of
+ * the restore view phase and does not change during the request
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testAssociatedConversationOfJsfRequestIsDeterminedAtEndOfRestoreViewPhase()
+ {
+ assert false;
+ }
+
+ /**
+ * The conversation associated with a JSF request is determined at the end of
+ * the restore view phase and does not change during the request
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testAssociatedConversationOfJsfRequestDoesNotChangeDuringRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * By default, a conversation is transient
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testDefaultConversationIsTransient()
+ {
+ assert false;
+ }
+
+ /**
+ * All long-running conversations have a string-valued unique identifier
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testConversationsHaveUniqueStringIdentifiers()
+ {
+ assert false;
+ }
+
+ /**
+ * If the conversation associated with the current JSF request is in the
+ * transient state at the end of a JSF request, it is destroyed, and the
+ * conversation context is also destroyed.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testTransientConversationIsDestroyedAtEndOfJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * If the conversation associated with the current JSF request is in the
+ * transient state at the end of a JSF request, it is destroyed, and the
+ * conversation context is also destroyed.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testTransientConversationContextIsDestroyedAtEndOfJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * If the conversation associated with the current JSF request is in the
+ * long-running state at the end of a JSF request, it is not destroyed
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationNotDestroyedAtEndOfJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * The long-running conversation context associated with a request that
+ * renders a JSF view is automatically propagated to any faces request (JSF
+ * form submission) that originates from that rendered page.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationOfJsfRenderingRequestIsPropagatedToRequestFromRenderedPage()
+ {
+ assert false;
+ }
+
+ /**
+ * The long-running conversation context associated with a request that
+ * results in a JSF redirect (via a navigation rule) is automatically
+ * propagated to the resulting non-faces request, and to any other subsequent
+ * request to the same URL. This is accomplished via use of a GET request
+ * parameter named cid containing the unique identifier of the conversation.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationOfJsfRedirectIsPropagatedToNonFacesRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * The long-running conversation associated with a request may be propagated
+ * to any non-faces request via use of a GET request parameter named cid
+ * containing the unique identifier of the conversation. In this case, the
+ * application must manage this request parameter
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationManuallyPropagatedToNonFacesRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * When no conversation is propagated to a JSF request, the request is
+ * associated with a new transient conversation.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testNewTransientRequestIsCreatedWhenNoConversationIsPropagated()
+ {
+ assert false;
+ }
+
+ /**
+ * All long-running conversations are scoped to a particular HTTP servlet
+ * session and may not cross session boundaries
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationsMayNotCrossHttpSessions()
+ {
+ assert false;
+ }
+
+ /**
+ * When the HTTP servlet session is invalidated, all long-running
+ * conversation contexts created during the current session are destroyed
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testAllLongRunningConversationContextsOfInvalidatedHttpSessionAreDestroyed()
+ {
+ assert false;
+ }
+
+ /**
+ * The Web Bean manager is permitted to arbitrarily destroy any long-running
+ * conversation that is associated with no current JSF request, in order to
+ * conserve resources
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testManagerCanDestroyOrphanedLongRunningConversations()
+ {
+ assert false;
+ }
+
+ /**
+ * If the propagated conversation cannot be restored, the request is
+ * associated with a new transient conversation
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testNewTransientConversationIsCreatedWhenConversationCannotBeRestored()
+ {
+ assert false;
+ }
+
+ /**
+ * The Web Bean manager ensures that a long-running conversation may be
+ * associated with at most one request at a time, by blocking or rejecting
+ * concurrent requests.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testConcurrentRequestsToLongRunningConversationsAreHandled()
+ {
+ assert false;
+ }
+}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/conversation/ConversationContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Animal.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Animal.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+interface Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Animal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/AnotherDeploymentType.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/AnotherDeploymentType.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlyAnimal.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlyAnimal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlyAnimal.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+interface DeadlyAnimal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlyAnimal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlySpider.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlySpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlySpider.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DeadlySpider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,601 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import javax.webbeans.ContextNotActiveException;
+import javax.webbeans.Dependent;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Context;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class DependentContextTest extends AbstractTest
+{
+
+ /**
+ * No injected instance of the Web Bean is ever shared between multiple
+ * injection points.
+ */
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceNotSharedBetweenInjectionPoints()
+ {
+ deployBeans(Fox.class, FoxRun.class);
+ Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
+ assert foxBeans.size() == 1;
+ Bean<Fox> foxBean = foxBeans.iterator().next();
+ Set<Bean<FoxRun>> foxRunBeans = manager.resolveByType(FoxRun.class);
+ assert foxRunBeans.size() == 1;
+ Bean<FoxRun> foxRunBean = foxRunBeans.iterator().next();
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert !foxRun.fox.equals(foxRun.anotherFox);
+ }
+
+ /**
+ * Any instance of the Web Bean that is used to evaluate a Unified EL
+ * expression exists to service that evaluation only.
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForElEvalutionNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "contexts", "producerMethod", "broken" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForProducerMethodNotShared() throws Exception
+ {
+ Bean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTarantula");
+ Bean<Tarantula> tarantulaBean = createProducerMethodBean(method, spiderProducer);
+ Tarantula tarantula = tarantulaBean.create();
+ Tarantula tarantula2 = tarantulaBean.create();
+ assert tarantula != null;
+ assert tarantula2 != null;
+ assert tarantula != tarantula2;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "contexts", "producerMethod", "stub" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForProducerFieldNotShared() throws Exception
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForDisposalMethodNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForObserverMethodNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Every invocation of the get() operation of the Context object for the @Dependent
+ * scope with the value true for the create parameter returns a new instance
+ * of the given Web Bean
+ */
+ @Test(groups = "contexts")
+ @SpecAssertion(section = "9.4")
+ public void testContextGetWithCreateTrueReturnsNewInstance() throws Exception
+ {
+ deployBeans(Fox.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
+ assert foxBeans.size() == 1;
+ Bean<Fox> foxBean = foxBeans.iterator().next();
+ Context context = manager.getContext(Dependent.class);
+ assert context.get(foxBean, true) != null;
+ assert context.get(foxBean, true) instanceof Fox;
+ }
+
+ }.run();
+
+ }
+
+ /**
+ * Every invocation of the get() operation of the Context object for the @Dependent
+ * scope with the value false for the create parameter returns a null value
+ */
+ @Test(groups = "contexts")
+ @SpecAssertion(section = "9.4")
+ public void testContextGetWithCreateFalseReturnsNull() throws Exception
+ {
+ deployBeans(Fox.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
+ assert foxBeans.size() == 1;
+ Bean<Fox> foxBean = foxBeans.iterator().next();
+ Context context = manager.getContext(Dependent.class);
+ assert context.get(foxBean, false) == null;
+ }
+
+ }.run();
+
+
+ }
+
+ /**
+ * The @Dependent scope is inactive except:
+ */
+ @Test(groups = {"contexts"}, expectedExceptions = ContextNotActiveException.class)
+ @SpecAssertion(section = "9.4")
+ public void testContextIsInactive()
+ {
+ manager.getContext(Dependent.class).isActive();
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingProducerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "producerField" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingProducerField()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingDisposalMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingObserverMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * while a Unified EL expression is evaluated, or
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenEvaluatingElExpression()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "contexts", "beanLifecycle" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringBeanCreation()
+ {
+ // Slightly roundabout, but I can't see a better way to test atm
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert foxRun.fox != null;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "stub", "contexts", "beanDestruction" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringBeanDestruction()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringInjection()
+ {
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert foxRun.fox != null;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "injection", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBDependencyInjection()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "injection", "stub", "servlet" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringServletDependencyInjection()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "postconstruct", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "predestroy", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "constructor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromConstructor()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "removeMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromRemoveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "initalizerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromInitializerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromProducerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromDisposalMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "preDestroy" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "postConstruct" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "interceptor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromInterceptorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "decorator" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromDecoratorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "initializerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromInitializer()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "postConstruct" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "preDestroy" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "interceptor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromInterceptorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Servlet may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods
+ */
+ @Test(groups = { "stub", "contexts", "servlet", "initializerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testServletBeanMayCreateInstanceFromInitializer()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of a Web Bean instance when the instance is
+ * destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "beanDestruction" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingParentDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
+ * or Servlet is destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingEjbDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
+ * or Servlet is destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingServletDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all @Dependent scoped contextual instances created during an EL
+ * expression evaluation when the evaluation completes, and
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenElEvaluationCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenProducerMethodCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "producerField" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenProducerFieldCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenDisposalMethodCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Fox.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Fox.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Fox.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+import javax.webbeans.Dependent;
+
+@Dependent
+class Fox
+{
+
+ public String getName()
+ {
+ return "gavin";
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Fox.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/FoxRun.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/FoxRun.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/FoxRun.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+import javax.webbeans.Current;
+
+class FoxRun
+{
+
+ @Current
+ public Fox fox;
+
+ @Current
+ public Fox anotherFox;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/FoxRun.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Spider.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Spider.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+
+
+class Spider implements Animal
+{
+
+ public final void layEggs()
+ {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Spider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/SpiderProducer.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/SpiderProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/SpiderProducer.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+import javax.webbeans.Produces;
+
+
+@AnotherDeploymentType
+class SpiderProducer
+{
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/SpiderProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Tarantula.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Tarantula.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Tarantula.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.context.dependent;
+
+
+class Tarantula extends Spider implements DeadlySpider
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/Tarantula.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/City.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/City.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/City.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/City.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+class City
+{
+ public void ping() {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/City.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityBinding.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.InterceptorBindingType;
+
+@InterceptorBindingType
+@Dependent
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface CityBinding
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityBinding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityInterface.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityInterface.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+interface CityInterface
+{
+ public void foo();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityInterface.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Produces;
+
+class CityProducer
+{
+ @Produces @Dependent public Violation reference = new Violation();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer2.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer2.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Produces;
+
+class CityProducer2
+{
+ @Produces
+ @Dependent
+ public Violation create()
+ {
+ return new Violation();
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer2.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer3.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer3.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer3.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.webbeans.Current;
+import javax.webbeans.Dependent;
+import javax.webbeans.Produces;
+
+
+class CityProducer3
+{
+ @Produces
+ @Dependent
+ public Violation create(@Current Violation reference)
+ {
+ return new Violation();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/CityProducer3.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Espoo_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Espoo_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Espoo_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+public class Espoo_Broken
+{
+ @Current
+ Violation reference;
+
+ @Remove
+ public void bye() {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Espoo_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Forssa_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Forssa_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Forssa_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Forssa_Broken implements Serializable
+{
+ public Forssa_Broken() {
+ }
+
+ @Initializer
+ public Forssa_Broken(@Current Violation reference) {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Forssa_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hamina_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hamina_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hamina_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+public class Hamina_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hamina_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Helsinki.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Helsinki.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Helsinki.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Helsinki.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.ejb.Stateful;
+import javax.webbeans.Dependent;
+
+@Dependent
+@Stateful
+class Helsinki
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Helsinki.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hyvinkaa.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Hyvinkaa.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hyvinkaa.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hyvinkaa.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SuppressWarnings("serial")
+@SessionScoped
+class Hyvinkaa implements Serializable
+{
+ @SuppressWarnings("unused")
+ @Current
+ private transient Violation reference;
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Hyvinkaa.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Produces;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Jamsa_Broken extends City implements Serializable
+{
+ public Jamsa_Broken()
+ {
+ }
+
+ @Produces
+ @SessionScoped
+ public Violation create()
+ {
+ return new Violation();
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Joensuu.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Joensuu.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Joensuu.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Joensuu.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SuppressWarnings("serial")
+@SessionScoped
+class Joensuu implements Serializable
+{
+ @SuppressWarnings("unused")
+ @Current
+ private transient Violation reference;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Joensuu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jyvaskyla.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Jyvaskyla.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jyvaskyla.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jyvaskyla.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.SessionScoped;
+
+@SuppressWarnings("serial")
+@SessionScoped
+class Jyvaskyla implements Serializable
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jyvaskyla.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kaarina_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kaarina_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kaarina_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+class Kaarina_Broken
+{
+ @CityBinding
+ public void foo()
+ {
+ }
+
+ @Remove
+ public void bye()
+ {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kaarina_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kotka_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kotka_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kotka_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Kotka_Broken implements Serializable
+{
+ @CityBinding
+ public void foo() {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kotka_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kuopio_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kuopio_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kuopio_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Kuopio_Broken extends City implements Serializable
+{
+ public Kuopio_Broken() {
+
+ }
+
+ @Initializer
+ public void init(@Current Violation reference) {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Kuopio_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Loviisa_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Loviisa_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Loviisa_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Loviisa_Broken extends City implements Serializable
+{
+ public Loviisa_Broken() {
+ }
+
+ @Initializer
+ public Loviisa_Broken(@Current Violation reference) {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Loviisa_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Maarianhamina_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Maarianhamina_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Maarianhamina_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+class Maarianhamina_Broken
+{
+ @Current
+ private Violation reference;
+
+ @Remove
+ public void bye() {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Maarianhamina_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Mikkeli_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Mikkeli_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Mikkeli_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.Initializer;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Mikkeli_Broken extends City implements Serializable
+{
+ public Mikkeli_Broken()
+ {
+ }
+
+ @Initializer
+ public Mikkeli_Broken(@Current Violation reference)
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Mikkeli_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Nokia_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Nokia_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Nokia_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Nokia_Broken extends City implements Serializable
+{
+ @Current
+ private Violation reference;
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Nokia_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/PassivatingContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/PassivatingContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,481 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.webbeans.DefinitionException;
+import javax.webbeans.IllegalProductException;
+import javax.webbeans.UnserializableDependencyException;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@SpecVersion("20081206")
+public class PassivatingContextTest extends AbstractTest
+{
+
+ /**
+ * EJB local objects are serializable. Therefore, an enterprise Web Bean may
+ * declare any passivating scope.
+ */
+ @Test(groups = { "contexts", "passivation", "enterpriseBean" })
+ @SpecAssertion(section = "9.5")
+ public void testEJBWebBeanCanDeclarePassivatingScope()
+ {
+ deployBeans(Turku.class);
+ }
+
+ /**
+ * Simple Web Beans are not required to be serializable. If a simple Web Bean
+ * declares a passivating scope, and the implementation class is not
+ * serializable, a DefinitionException is thrown by the Web Bean manager at
+ * initialization time.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleWebBeanWithNonSerializableImplementationClassFails()
+ {
+ deployBeans(Hamina_Broken.class);
+ }
+
+ /**
+ * Simple Web Beans are not required to be serializable. If a simple Web Bean
+ * declares a passivating scope, and the implementation class is not
+ * serializable, a DefinitionException is thrown by the Web Bean manager at
+ * initialization time.
+ */
+ @Test(groups = {"contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testSimpleWebBeanWithSerializableImplementationClassOK()
+ {
+ createSimpleBean(Jyvaskyla.class);
+ }
+
+ /**
+ * the Web Bean declares a passivating scope type, and context passivation
+ * occurs, or
+ *
+ * @throws IOException
+ * @throws ClassNotFoundException
+ */
+ @Test(groups = { "contexts", "passivation" , "stub" })
+ @SpecAssertion(section = "9.5")
+ public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated() throws IOException, ClassNotFoundException
+ {
+ assert false;
+ }
+
+ @SuppressWarnings("unchecked")
+ private <T> boolean testSerialize(Bean<T> bean) throws IOException, ClassNotFoundException
+ {
+ manager.addBean(bean);
+ T instance = manager.getInstance(bean);
+ byte[] data = serialize(instance);
+ T resurrected = (T) deserialize(data);
+ return resurrected.toString().equals(instance.toString());
+ }
+
+ /**
+ * the Web Bean is an EJB stateful session bean, and it is passivated by the
+ * EJB container.
+ *
+ * @throws ClassNotFoundException
+ * @throws IOException
+ */
+ // TODO requires an EJB instance
+ @Test(groups = { "contexts", "passivation", "broken", "stub" })
+ @SpecAssertion(section = "9.5")
+ public void testStatefulEJBIsSerializedWhenPassivatedByEJBContainer() throws IOException, ClassNotFoundException
+ {
+ assert false;
+ }
+
+ /**
+ * On the other hand, dependent objects (including interceptors and
+ * decorators with scope @Dependent) of a stateful session bean or of a Web
+ * Bean with a passivating scope must be serialized and deserialized along
+ * with their owner
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentInterceptorsOfStatefulEnterpriseBeanMustBeSerializable()
+ {
+ deployBeans(Kaarina_Broken.class);
+ }
+
+ /**
+ * On the other hand, dependent objects (including interceptors and
+ * decorators with scope @Dependent) of a stateful session bean or of a Web
+ * Bean with a passivating scope must be serialized and deserialized along
+ * with their owner
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentDecoratorsOfStatefulEnterpriseBeanMustBeSerializable()
+ {
+ deployBeans(Porvoo_Broken.class);
+ }
+
+ /**
+ * On the other hand, dependent objects (including interceptors and
+ * decorators with scope @Dependent) of a stateful session bean or of a Web
+ * Bean with a passivating scope must be serialized and deserialized along
+ * with their owner
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentInterceptorsOfWebBeanWithPassivatingScopeMustBeSerializable()
+ {
+ deployBeans(Kotka_Broken.class);
+ }
+
+ /**
+ * On the other hand, dependent objects (including interceptors and
+ * decorators with scope @Dependent) of a stateful session bean or of a Web
+ * Bean with a passivating scope must be serialized and deserialized along
+ * with their owner
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentDecoratorsOfWebBeansWithPassivatingScopeMustBeSerializable()
+ {
+ deployBeans(Raisio_Broken.class);
+ }
+
+ /**
+ * EJB local objects are serializable. Therefore, any reference to an
+ * enterprise Web Bean of scope @Dependent is serializable.
+ *
+ * @throws ClassNotFoundException
+ * @throws IOException
+ */
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
+ {
+ deployBeans(Vaasa.class, Helsinki.class);
+ Set<Bean<Vaasa>> vaasaBeans = manager.resolveByType(Vaasa.class);
+ assert vaasaBeans.size() == 1;
+ assert testSerialize(vaasaBeans.iterator().next());
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "stub", "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanFails()
+ {
+ deployBeans(Violation.class, Espoo_Broken.class);
+ manager.getInstanceByType(Espoo_Broken.class);
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(Vantaa_Broken.class, Violation.class);
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoTransientFieldOK()
+ {
+ createSimpleBean(Joensuu.class);
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(Loviisa_Broken.class, Violation.class);
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(Forssa_Broken.class, Violation.class);
+ }
+
+ /**
+ * If a simple Web Bean of scope @Dependent and a non-serializable
+ * implementation class is injected into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * UnserializableDependencyException must be thrown by the Web Bean manager
+ * at initialization time.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = UnserializableDependencyException.class)
+ @SpecAssertion(section = "9.5")
+ public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails()
+ {
+ deployBeans(Peraseinajoki.class, Violation.class, Violation2.class);
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ *
+ * @throws NoSuchMethodException
+ * @throws SecurityException
+ */
+ @Test(groups = { "contexts", "passivation" , "broken" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails() throws SecurityException, NoSuchMethodException
+ {
+ // TODO This test isn't testing SFSB, but enterprise beans
+ //deployBeans(CityProducer2.class, Maarianhamina_Broken.class);
+ //manager.getInstanceByType(Maarianhamina_Broken.class);
+ assert false;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(CityProducer2.class, Nokia_Broken.class);
+ manager.getInstanceByType(Nokia_Broken.class).ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
+ {
+ createSimpleBean(CityProducer2.class);
+ createSimpleBean(Hyvinkaa.class);
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(CityProducer2.class, Loviisa_Broken.class);
+ manager.getInstanceByType(Loviisa_Broken.class).ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(CityProducer2.class, Kuopio_Broken.class);
+ manager.getInstanceByType(Kuopio_Broken.class).ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" , "broken"}, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
+ {
+ // TODO Not quite sure what this test is doing
+ //deployBeans(CityProducer3.class, Jamsa_Broken.class);
+ //manager.getInstanceByType(Jamsa_Broken.class).ping();
+ assert false;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ *
+ */
+ @Test(groups = { "contexts", "passivation", "stub"}, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails() throws Exception
+ {
+ // TODO This doesn't test injction in a SFSB, but into a Enterprise bean
+ //deployBeans(CityProducer.class, Pietarsaari_Broken.class);
+ //manager.getInstanceByType(Pietarsaari_Broken.class);
+ assert false;
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(CityProducer.class, Uusikaupunki_Broken.class);
+ manager.getInstanceByType(Uusikaupunki_Broken.class).ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation"})
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
+ {
+ deployBeans(CityProducer.class, Salo_Broken.class);
+ manager.getInstanceByType(Salo_Broken.class).ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(CityProducer.class, Loviisa_Broken.class);
+ manager.getInstanceByType(Loviisa_Broken.class).ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
+ {
+ deployBeans(CityProducer.class, Mikkeli_Broken.class);
+ manager.getInstanceByType(Mikkeli_Broken.class).ping();
+ }
+
+ /**
+ * If a producer method or field of scope @Dependent returns a
+ * non-serializable object for injection into a stateful session bean, into a
+ * non-transient field, Web Bean constructor parameter or initializer method
+ * parameter of a Web Bean which declares a passivating scope type, or into a
+ * parameter of a producer method which declares a passivating scope type, an
+ * IllegalProductException is thrown by the Web Bean manager.
+ */
+ @Test(groups = { "contexts", "passivation", "broken" }, expectedExceptions = IllegalProductException.class)
+ @SpecAssertion(section = "9.5")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
+ {
+ // TODO Not quite sure what this test is doing
+ //deployBeans(CityProducer.class, Jamsa_Broken.class);
+ //manager.getInstanceByType(Jamsa_Broken.class).ping();
+ assert false;
+ }
+
+ /**
+ * The Web Bean manager must guarantee that JMS endpoint proxy objects are
+ * serializable.
+ */
+ @Test(groups = { "stub", "contexts", "passivation", "jms" })
+ @SpecAssertion(section = "9.5")
+ public void testJMSEndpointProxyIsSerializable()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Peraseinajoki.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Peraseinajoki.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Peraseinajoki.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.webbeans.Current;
+import javax.webbeans.Produces;
+import javax.webbeans.SessionScoped;
+
+class Peraseinajoki extends City
+{
+
+ @Produces @SessionScoped
+ public Violation2 create(@Current Violation reference)
+ {
+ return new Violation2();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Peraseinajoki.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Pietarsaari_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Pietarsaari_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Pietarsaari_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+class Pietarsaari_Broken extends City implements Serializable
+{
+ @Current
+ private Violation reference;
+
+ @Remove
+ public void bye() {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Pietarsaari_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Porvoo_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Porvoo_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Porvoo_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+class Porvoo_Broken implements CityInterface
+{
+ public void foo()
+ {
+ }
+
+ @Remove
+ public void bye()
+ {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Porvoo_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Raisio_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Raisio_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Raisio_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Raisio_Broken implements CityInterface, Serializable
+{
+ public void foo()
+ {
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Raisio_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Salo_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Salo_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Salo_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Salo_Broken extends City implements Serializable
+{
+ @Current
+ private transient Violation reference;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Salo_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Turku.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Turku.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Turku.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Turku.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+class Turku
+{
+ @Remove
+ public void bye() {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Turku.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Uusikaupunki_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Uusikaupunki_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Uusikaupunki_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Uusikaupunki_Broken extends City implements Serializable
+{
+ @Current
+ private Violation reference;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Uusikaupunki_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vaasa.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Vaasa.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vaasa.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vaasa.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SuppressWarnings("serial")
+@SessionScoped
+class Vaasa implements Serializable
+{
+ @SuppressWarnings("unused")
+ @Current private Helsinki ejb;
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vaasa.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vantaa_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vantaa_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vantaa_Broken.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,28 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped
+class Vantaa_Broken implements Serializable
+{
+ @Current
+ private Violation reference;
+
+ public Violation getReference()
+ {
+ return reference;
+ }
+
+ public void setReference(Violation reference)
+ {
+ this.reference = reference;
+ }
+
+ public String test() {
+ return reference.toString();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Vantaa_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Violation.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.webbeans.Dependent;
+
+@Dependent
+class Violation
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation2.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation2.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.context.passivating;
+
+import javax.webbeans.Dependent;
+
+@Dependent
+class Violation2
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Violation2.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/request/RequestContextTest.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/RequestContextTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/request/RequestContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/request/RequestContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,124 @@
+package org.jboss.webbeans.tck.tests.context.request;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class RequestContextTest extends AbstractTest
+{
+
+ /**
+ * The request scope is active during the service() method of any Servlet in
+ * the web application.
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringServiceMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed at the end of the servlet request, after
+ * the Servlet service() method returns.
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeIsDestroyedAfterServiceMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The request scope is active during any Java EE web service invocation.
+ */
+ @Test(groups = { "stub", "contexts", "webservice" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringWebSericeInvocation()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed after the web service invocation
+ * completes
+ */
+ @Test(groups = { "stub", "contexts", "webservice" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeIsDestroyedAfterWebServiceInvocation()
+ {
+ assert false;
+ }
+
+ /**
+ * The request scope is active during any remote method invocation of any EJB
+ * bean, during any call to an EJB timeout method and during message delivery
+ * to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringRemoteMethodInvocationOfEjb()
+ {
+ assert false;
+ }
+
+ /**
+ * The request scope is active during any remote method invocation of any EJB
+ * bean, during any call to an EJB timeout method and during message delivery
+ * to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringCallToEjbTimeoutMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The request scope is active during any remote method invocation of any EJB
+ * bean, during any call to an EJB timeout method and during message delivery
+ * to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringEjbMessageDelivery()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed after the remote method invocation,
+ * timeout or message delivery completes.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeDestroyedAfterRemoteMethodInvocationOfEjb()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed after the remote method invocation,
+ * timeout or message delivery completes.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeDestroyedAfterCallToEjbTimeoutMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed after the remote method invocation,
+ * timeout or message delivery completes.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeDestroyedAfterEjbMessageDelivery()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/request/RequestContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/session/SessionContextTest.java (from rev 1037, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SessionContextTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/session/SessionContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/session/SessionContextTest.java 2009-01-17 16:54:32 UTC (rev 1039)
@@ -0,0 +1,45 @@
+package org.jboss.webbeans.tck.tests.context.session;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("2001206")
+public class SessionContextTest extends AbstractTest
+{
+
+ /**
+ * The session scope is active during the service() method of any servlet in
+ * the web application
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.2")
+ public void testSessionScopeActiveDuringServiceMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The session context is shared between all servlet requests that occur in
+ * the same HTTP servlet session
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.2")
+ public void testSessionContextSharedBetweenServletRequestsInSameHttpSession()
+ {
+ assert false;
+ }
+
+ /**
+ * The session context is destroyed when the HTTPSession is invalidated or
+ * times out.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.2")
+ public void testSessionContextDestroyedWhenHttpSessionInvalidatedOrTimesOut()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/session/SessionContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
[webbeans-commits] Webbeans SVN: r1038 - doc/trunk/reference/ko-KR.
by webbeans-commits@lists.jboss.org
Author: eukim
Date: 2009-01-17 09:58:44 -0500 (Sat, 17 Jan 2009)
New Revision: 1038
Modified:
doc/trunk/reference/ko-KR/injection.po
doc/trunk/reference/ko-KR/ri-spi.po
Log:
updated
Modified: doc/trunk/reference/ko-KR/injection.po
===================================================================
--- doc/trunk/reference/ko-KR/injection.po 2009-01-17 14:32:18 UTC (rev 1037)
+++ doc/trunk/reference/ko-KR/injection.po 2009-01-17 14:58:44 UTC (rev 1038)
@@ -8,7 +8,7 @@
"Project-Id-Version: injection\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-06 11:30+0000\n"
-"PO-Revision-Date: 2009-01-08 10:49+1000\n"
+"PO-Revision-Date: 2009-01-18 00:43+1000\n"
"Last-Translator: Eunju Kim <eukim(a)redhat.com>\n"
"Language-Team: Korean <ko(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -16,6 +16,7 @@
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n\n"
+"\n"
#. Tag: title
#: injection.xml:4
@@ -1020,7 +1021,7 @@
#: injection.xml:392
#, no-c-format
msgid "Obtaining a Web Bean by programatic lookup"
-msgstr ""
+msgstr "프로그램적 lookup에 의해 Web Bean 획득 "
#. Tag: para
#: injection.xml:394
Modified: doc/trunk/reference/ko-KR/ri-spi.po
===================================================================
--- doc/trunk/reference/ko-KR/ri-spi.po 2009-01-17 14:32:18 UTC (rev 1037)
+++ doc/trunk/reference/ko-KR/ri-spi.po 2009-01-17 14:58:44 UTC (rev 1038)
@@ -8,7 +8,7 @@
"Project-Id-Version: ri-spi\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-08 14:07+0000\n"
-"PO-Revision-Date: 2009-01-16 08:59+1000\n"
+"PO-Revision-Date: 2009-01-18 00:35+1000\n"
"Last-Translator: Eunju Kim <eukim(a)redhat.com>\n"
"Language-Team: Korean <ko(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -18,6 +18,7 @@
"Plural-Forms: nplurals=2; plural=(n!=1);\n\n"
"\n"
"\n"
+"\n"
#. Tag: title
#: ri-spi.xml:4
@@ -315,7 +316,7 @@
"In addition to these two interfaces, there is "
"<literal>BusinessInterfaceDescriptor</literal> which represents a local "
"business interface (encapsulating the interface class and jndi name)."
-msgstr ""
+msgstr "JavaDoc을 설명하는 계약은 EJBDescriptor를 충분히 구현합니다. 이러한 두 가지 인터페이스에 더하여, 로컬 비지니스 인터페이스를 나타내는 <literal>BusinessInterfaceDescriptor</literal>가 있습니다. (인터페이스 클래스 및 jndi 이름을 캡슐화) "
#. Tag: para
#: ri-spi.xml:69
@@ -326,6 +327,8 @@
"webbeans.bootstrap.WebBeanDiscovery</literal> with the fully qualified class "
"name as the value. For example:"
msgstr ""
+"Web Beans RI는 완전 정규화된 클래스 이름 값과 함께 <literal>org.jboss."
+"webbeans.bootstrap.WebBeanDiscovery</literal> 속성을 사용하여 <literal>WebBeanDiscovery</literal> 구현을 불러오기하게 할 수 있습니다. 예: "
#. Tag: programlisting
#: ri-spi.xml:76
17 years, 3 months
[webbeans-commits] Webbeans SVN: r1037 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-17 09:32:18 -0500 (Sat, 17 Jan 2009)
New Revision: 1037
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/StereotypesTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ApplicationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/City.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ContextManagementTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ConversationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Helsinki.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Hyvinkaa.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Joensuu.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Jyvaskyla.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/NormalContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/RequestContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SessionContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Turku.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Vaasa.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Violation.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Animal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Antelope_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/ApplicationScopedHornedMammalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Asynchronous.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Bovine.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Carp_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Chair_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Elk_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/FallowDeer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Gazelle_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goat_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goldfish.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HighlandCow.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedAnimalDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedMammalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Mammal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Moose.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Reindeer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RequestScopedAnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RoeDeer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Springbok.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithBindingTypes_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithNonEmptyNamed_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyDeploymentTypes_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyScopeTypes_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypesTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Tame.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/injectionpoint/
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ContextManagement.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ConversationContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/SessionContextTest.java
Log:
Port many of the context tests
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java 2009-01-16 20:28:23 UTC (rev 1036)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -1,213 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.util.Arrays;
-
-import javax.webbeans.DefinitionException;
-import javax.webbeans.RequestScoped;
-
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.model.StereotypeModel;
-import org.jboss.webbeans.test.annotations.AnimalOrderStereotype;
-import org.jboss.webbeans.test.annotations.AnimalStereotype;
-import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
-import org.jboss.webbeans.test.annotations.HornedMammalStereotype;
-import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
-import org.jboss.webbeans.test.annotations.Tame;
-import org.jboss.webbeans.test.annotations.broken.StereotypeWithBindingTypes;
-import org.jboss.webbeans.test.annotations.broken.StereotypeWithNonEmptyNamed;
-import org.jboss.webbeans.test.annotations.broken.StereotypeWithTooManyDeploymentTypes;
-import org.jboss.webbeans.test.annotations.broken.StereotypeWithTooManyScopeTypes;
-import org.jboss.webbeans.test.beans.Animal;
-import org.jboss.webbeans.test.beans.Chair;
-import org.jboss.webbeans.test.beans.Goldfish;
-import org.jboss.webbeans.test.beans.HighlandCow;
-import org.jboss.webbeans.test.beans.Order;
-import org.jboss.webbeans.test.beans.broken.Carp;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class StereotypesTest extends AbstractTest
-{
-
- @Test(groups={"stub", "annotationDefinition"}, expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1")
- public void testHasCorrectTarget()
- {
- assert false;
- }
-
- @Test(groups={"stub", "annotationDefinition"}, expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1")
- public void testHasCorrectRetention()
- {
- assert false;
- }
-
- @Test(groups={"stub", "annotationDefinition"}, expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1")
- public void testHasStereotypeAnnotation()
- {
- assert false;
- }
-
- @Test
- public void testAnimalStereotype()
- {
- StereotypeModel<AnimalStereotype> animalStereotype = new StereotypeModel<AnimalStereotype>(AnimalStereotype.class);
- assert animalStereotype.getDefaultScopeType().annotationType().equals(RequestScoped.class);
- assert animalStereotype.getInterceptorBindings().size() == 0;
- assert animalStereotype.getRequiredTypes().size() == 1;
- assert animalStereotype.getRequiredTypes().contains(Animal.class);
- assert animalStereotype.getSupportedScopes().size() == 0;
- assert !animalStereotype.isBeanNameDefaulted();
- assert animalStereotype.getDefaultDeploymentType() == null;
- }
-
- @Test
- public void testAnimalOrderStereotype()
- {
- StereotypeModel<AnimalOrderStereotype> animalStereotype = new StereotypeModel<AnimalOrderStereotype>(AnimalOrderStereotype.class);
- assert animalStereotype.getDefaultScopeType() == null;
- assert animalStereotype.getInterceptorBindings().size() == 0;
- assert animalStereotype.getRequiredTypes().size() == 2;
- Class<?> [] requiredTypes = {Animal.class, Order.class};
- assert animalStereotype.getRequiredTypes().containsAll(Arrays.asList(requiredTypes));
- assert animalStereotype.getSupportedScopes().size() == 0;
- assert !animalStereotype.isBeanNameDefaulted();
- assert animalStereotype.getDefaultDeploymentType() == null;
- }
-
- @Test
- public void testRequestScopedAnimalStereotype()
- {
- StereotypeModel<RequestScopedAnimalStereotype> animalStereotype = new StereotypeModel<RequestScopedAnimalStereotype>(RequestScopedAnimalStereotype.class);
- assert animalStereotype.getDefaultScopeType() == null;
- assert animalStereotype.getInterceptorBindings().size() == 0;
- assert animalStereotype.getRequiredTypes().size() == 1;
- assert Animal.class.equals(animalStereotype.getRequiredTypes().iterator().next());
- assert animalStereotype.getSupportedScopes().size() == 1;
- assert animalStereotype.getSupportedScopes().contains(RequestScoped.class);
- assert !animalStereotype.isBeanNameDefaulted();
- assert animalStereotype.getDefaultDeploymentType() == null;
- }
-
- @Test @SpecAssertion(section="2.7.1.1")
- public void testStereotypeWithScopeType()
- {
- StereotypeModel<AnimalStereotype> animalStereotype = new StereotypeModel<AnimalStereotype>(AnimalStereotype.class);
- assert animalStereotype.getDefaultScopeType().annotationType().equals(RequestScoped.class);
- }
-
- @Test @SpecAssertion(section="2.7.1.1")
- public void testStereotypeWithoutScopeType()
- {
- StereotypeModel<HornedMammalStereotype> animalStereotype = new StereotypeModel<HornedMammalStereotype>(HornedMammalStereotype.class);
- assert animalStereotype.getDefaultScopeType() == null;
- }
-
- @Test @SpecAssertion(section="2.7.1.2")
- public void testStereotypeWithoutInterceptors()
- {
- StereotypeModel<AnimalStereotype> animalStereotype = new StereotypeModel<AnimalStereotype>(AnimalStereotype.class);
- assert animalStereotype.getInterceptorBindings().size() == 0;
- }
-
- @Test(groups={"stub", "interceptors"}) @SpecAssertion(section="2.7.1.2")
- public void testStereotypeWithInterceptors()
- {
- assert false;
- }
-
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1.1")
- public void testStereotypeWithTooManyScopeTypes()
- {
- new StereotypeModel<StereotypeWithTooManyScopeTypes>(StereotypeWithTooManyScopeTypes.class);
- }
-
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1.1")
- public void testStereotypeWithTooManyDeploymentTypes()
- {
- new StereotypeModel<StereotypeWithTooManyDeploymentTypes>(StereotypeWithTooManyDeploymentTypes.class);
- }
-
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1.3")
- public void testStereotypeWithNonEmptyNamed()
- {
- new StereotypeModel<StereotypeWithNonEmptyNamed>(StereotypeWithNonEmptyNamed.class);
- }
-
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1")
- public void testStereotypeWithBindingTypes()
- {
- new StereotypeModel<StereotypeWithBindingTypes>(StereotypeWithBindingTypes.class);
- }
-
- @Test @SpecAssertion(section={"2.7.2", "2.7.4"})
- public void testMultipleStereotypes()
- {
- SimpleBean<HighlandCow> highlandCow = SimpleBean.of(HighlandCow.class, manager);
- assert highlandCow.getName() == null;
- assert highlandCow.getBindings().iterator().next().annotationType().equals(Tame.class);
- assert highlandCow.getScopeType().equals(RequestScoped.class);
- assert highlandCow.getMergedStereotypes().getRequiredTypes().size() == 1;
- assert highlandCow.getMergedStereotypes().getRequiredTypes().contains(Animal.class);
- assert highlandCow.getMergedStereotypes().getSupportedScopes().size() == 1;
- assert highlandCow.getMergedStereotypes().getSupportedScopes().contains(RequestScoped.class);
- assert highlandCow.getDeploymentType().equals(HornedAnimalDeploymentType.class);
- }
-
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.7.3")
- public void testStereotypeDeclaredInXmlIgnoresJavaStereotypes()
- {
- //Map<Class<? extends Annotation>, Annotation> cooXmlAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();
- //cooXmlAnnotations.put(HornedMammalStereotype.class, new HornedMamalStereotypeAnnotationLiteral());
- //AnnotatedClass<HighlandCow> cooXmlAnnotatedItem = new SimpleAnnotatedClass<HighlandCow>(HighlandCow.class, cooXmlAnnotations);
-
- /*SimpleBean<HighlandCow> coo = createSimpleBean(HighlandCow.class, cooXmlAnnotatedItem, manager);
- assert coo.getDeploymentType().equals(HornedAnimalDeploymentType.class);
- assert coo.getScopeType().equals(RequestScoped.class);
- assert coo.getMergedStereotypes().getRequiredTypes().size() == 1;
- assert coo.getMergedStereotypes().getRequiredTypes().contains(Animal.class);
- assert coo.getMergedStereotypes().getSupportedScopes().size() == 0;*/
- assert false;
- }
-
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.7.3")
- public void testStereotypeDeclaredInXmlIgnoresJavaBindingTypes()
- {
- //Map<Class<? extends Annotation>, Annotation> cooXmlAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();
- //cooXmlAnnotations.put(HornedMammalStereotype.class, new HornedMamalStereotypeAnnotationLiteral());
- //cooXmlAnnotations.put(Synchronous.class, new SynchronousAnnotationLiteral());
- //AnnotatedClass<HighlandCow> cooXmlAnnotatedItem = new SimpleAnnotatedClass<HighlandCow>(HighlandCow.class, cooXmlAnnotations);
-
- /*SimpleBean<HighlandCow> coo = createSimpleBean(HighlandCow.class, cooXmlAnnotatedItem, manager);
- assert coo.getBindingTypes().size() == 1;
- assert coo.getBindingTypes().contains(new SynchronousAnnotationLiteral());*/
- assert false;
-
- }
-
- @Test@SpecAssertion(section={"2.7.1.4", "2.7.4"})
- public void testRequiredTypeIsImplemented()
- {
- SimpleBean.of(HighlandCow.class, manager);
- }
-
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section={"2.7.1.4", "2.7.4"})
- public void testRequiredTypeIsNotImplemented()
- {
- SimpleBean.of(Chair.class, manager);
- }
-
- @Test @SpecAssertion(section={"2.7.1.4", "2.7.4"})
- public void testScopeIsSupported()
- {
- SimpleBean.of(Goldfish.class, manager);
- }
-
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section={"2.7.1.4", "2.7.4"})
- public void testScopeIsNotSupported()
- {
- SimpleBean.of(Carp.class, manager);
- }
-
- // TODO Stereotype inheritance tests
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java 2009-01-16 20:28:23 UTC (rev 1036)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -1,92 +0,0 @@
-package org.jboss.webbeans.test.contexts;
-
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class ApplicationContextTest extends AbstractTest
-{
-
- /**
- * The application scope is active during the service() method of any servlet
- * in the web application.
- */
- @Test(groups = { "stub", "contexts", "servlet" })
- @SpecAssertion(section = "9.6.3")
- public void testApplicationScopeActiveDuringServiceMethod()
- {
- assert false;
- }
-
- /**
- * The application scope is active during any Java EE web service invocation.
- */
- @Test(groups = { "stub", "contexts", "webservice" })
- @SpecAssertion(section = "9.6.3")
- public void testApplicationScopeActiveDuringWebSericeInvocation()
- {
- assert false;
- }
-
- /**
- * The application scope is also active during any remote method invocation
- * of any EJB bean, during any call to an EJB timeout method and during
- * message delivery to any EJB message driven bean.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.3")
- public void testApplicationScopeActiveDuringRemoteMethodInvocationOfEjb()
- {
- assert false;
- }
-
- /**
- * The application scope is also active during any remote method invocation
- * of any EJB bean, during any call to an EJB timeout method and during
- * message delivery to any EJB message driven bean.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.3")
- public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod()
- {
- assert false;
- }
-
- /**
- * The application scope is also active during any remote method invocation
- * of any EJB bean, during any call to an EJB timeout method and during
- * message delivery to any EJB message driven bean.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.3")
- public void testApplicationScopeActiveDuringEjbMessageDelivery()
- {
- assert false;
- }
-
- /**
- * The application context is shared between all servlet requests, web
- * service invocations, EJB remote method invocations, EJB timeouts and
- * message deliveries to message driven beans that execute within the same
- * application
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.3")
- public void testApplicationContextSharedBetweenInvokationsInApplication()
- {
- assert false;
- }
-
- /**
- * The application context is destroyed when the application is undeployed.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.3")
- public void testApplicationScopeDestroyedWhenApplicationIsUndeployed()
- {
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ContextManagement.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ContextManagement.java 2009-01-16 20:28:23 UTC (rev 1036)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ContextManagement.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -1,75 +0,0 @@
-package org.jboss.webbeans.test.contexts;
-
-import javax.webbeans.ContextNotActiveException;
-
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Nicklas Karlsson
- *
- */
-@SpecVersion("20081206")
-public class ContextManagement extends AbstractTest
-{
- /**
- * For each of the built-in normal scopes, contexts propagate across any Java
- * method call, including invocation of EJB local business methods.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6")
- public void testBuiltInNormalScopedContextsPropagateAcrossAnyJavaMethodCall()
- {
- assert false;
- }
-
- /**
- * The built-in contexts do not propagate across remote method invocations or
- * to asynchronous processes such as JMS message listeners or EJB timer
- * service timeouts
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6")
- public void testBuiltInNormalScopedContextsDoNotPropagateAcrossRemoteMethodInvocations()
- {
- assert false;
- }
-
- /**
- * The built-in contexts do not propagate across remote method invocations or
- * to asynchronous processes such as JMS message listeners or EJB timer
- * service timeouts
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6")
- public void testBuiltInNormalScopedContextsDoNotPropagateAcrossAsynchronousMethodInvocations()
- {
- assert false;
- }
-
- /**
- * If no active context object exists for the given scope type, getContext()
- * must throw a ContextNotActiveException.
- */
- @Test(groups = { "stub", "contexts" }, expectedExceptions = ContextNotActiveException.class)
- @SpecAssertion(section = "9.7")
- public void testGettingContextNotActiveFails()
- {
- assert false;
- }
-
- /**
- * If more than one active context object exists for the given scope type,
- * getContext() must throw an IllegalStateException.
- */
- @Test(groups = { "stub", "contexts" }, expectedExceptions = ContextNotActiveException.class)
- @SpecAssertion(section = "9.7")
- public void testGettingContextWithTooManyActiveFails()
- {
- assert false;
- }
-
-}
\ No newline at end of file
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ConversationContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ConversationContextTest.java 2009-01-16 20:28:23 UTC (rev 1036)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ConversationContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -1,231 +0,0 @@
-package org.jboss.webbeans.test.contexts;
-
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Nicklas Karlsson
- *
- */
-@SpecVersion("20081206")
-public class ConversationContextTest extends AbstractTest
-{
- /**
- * For a JSF faces request, the context is active from the beginning of the
- * apply request values phase, until the response is complete.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testContextActiveFromBeginningOfApplyRequestValuesPhasetoResponseCompleteForJsfRequest()
- {
- assert false;
- }
-
- /**
- * For a JSF non-faces request, the context is active during the render
- * response phase
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testContextActiveDuringRenderResponsePhaseForNonFacesJsfRequest()
- {
- assert false;
- }
-
- /**
- * Any JSF request has exactly one associated conversation
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testJsfRequestHasExactlyOneAssociatedConversation()
- {
- assert false;
- }
-
- /**
- * The conversation associated with a JSF request is determined at the end of
- * the restore view phase and does not change during the request
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testAssociatedConversationOfJsfRequestIsDeterminedAtEndOfRestoreViewPhase()
- {
- assert false;
- }
-
- /**
- * The conversation associated with a JSF request is determined at the end of
- * the restore view phase and does not change during the request
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testAssociatedConversationOfJsfRequestDoesNotChangeDuringRequest()
- {
- assert false;
- }
-
- /**
- * By default, a conversation is transient
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testDefaultConversationIsTransient()
- {
- assert false;
- }
-
- /**
- * All long-running conversations have a string-valued unique identifier
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testConversationsHaveUniqueStringIdentifiers()
- {
- assert false;
- }
-
- /**
- * If the conversation associated with the current JSF request is in the
- * transient state at the end of a JSF request, it is destroyed, and the
- * conversation context is also destroyed.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testTransientConversationIsDestroyedAtEndOfJsfRequest()
- {
- assert false;
- }
-
- /**
- * If the conversation associated with the current JSF request is in the
- * transient state at the end of a JSF request, it is destroyed, and the
- * conversation context is also destroyed.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testTransientConversationContextIsDestroyedAtEndOfJsfRequest()
- {
- assert false;
- }
-
- /**
- * If the conversation associated with the current JSF request is in the
- * long-running state at the end of a JSF request, it is not destroyed
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testLongRunningConversationNotDestroyedAtEndOfJsfRequest()
- {
- assert false;
- }
-
- /**
- * The long-running conversation context associated with a request that
- * renders a JSF view is automatically propagated to any faces request (JSF
- * form submission) that originates from that rendered page.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testLongRunningConversationOfJsfRenderingRequestIsPropagatedToRequestFromRenderedPage()
- {
- assert false;
- }
-
- /**
- * The long-running conversation context associated with a request that
- * results in a JSF redirect (via a navigation rule) is automatically
- * propagated to the resulting non-faces request, and to any other subsequent
- * request to the same URL. This is accomplished via use of a GET request
- * parameter named cid containing the unique identifier of the conversation.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testLongRunningConversationOfJsfRedirectIsPropagatedToNonFacesRequest()
- {
- assert false;
- }
-
- /**
- * The long-running conversation associated with a request may be propagated
- * to any non-faces request via use of a GET request parameter named cid
- * containing the unique identifier of the conversation. In this case, the
- * application must manage this request parameter
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testLongRunningConversationManuallyPropagatedToNonFacesRequest()
- {
- assert false;
- }
-
- /**
- * When no conversation is propagated to a JSF request, the request is
- * associated with a new transient conversation.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testNewTransientRequestIsCreatedWhenNoConversationIsPropagated()
- {
- assert false;
- }
-
- /**
- * All long-running conversations are scoped to a particular HTTP servlet
- * session and may not cross session boundaries
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testLongRunningConversationsMayNotCrossHttpSessions()
- {
- assert false;
- }
-
- /**
- * When the HTTP servlet session is invalidated, all long-running
- * conversation contexts created during the current session are destroyed
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testAllLongRunningConversationContextsOfInvalidatedHttpSessionAreDestroyed()
- {
- assert false;
- }
-
- /**
- * The Web Bean manager is permitted to arbitrarily destroy any long-running
- * conversation that is associated with no current JSF request, in order to
- * conserve resources
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testManagerCanDestroyOrphanedLongRunningConversations()
- {
- assert false;
- }
-
- /**
- * If the propagated conversation cannot be restored, the request is
- * associated with a new transient conversation
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testNewTransientConversationIsCreatedWhenConversationCannotBeRestored()
- {
- assert false;
- }
-
- /**
- * The Web Bean manager ensures that a long-running conversation may be
- * associated with at most one request at a time, by blocking or rejecting
- * concurrent requests.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.4")
- public void testConcurrentRequestsToLongRunningConversationsAreHandled()
- {
- assert false;
- }
-}
\ No newline at end of file
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java 2009-01-16 20:28:23 UTC (rev 1036)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -1,578 +0,0 @@
-package org.jboss.webbeans.test.contexts;
-
-import java.lang.reflect.Method;
-
-import javax.webbeans.ContextNotActiveException;
-import javax.webbeans.Dependent;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.bean.ProducerMethodBean;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.context.DependentContext;
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.jboss.webbeans.test.beans.Fox;
-import org.jboss.webbeans.test.beans.FoxRun;
-import org.jboss.webbeans.test.beans.SpiderProducer;
-import org.jboss.webbeans.test.beans.Tarantula;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class DependentContextTest extends AbstractTest
-{
-
- /**
- * No injected instance of the Web Bean is ever shared between multiple
- * injection points.
- */
- @Test(groups = { "contexts", "injection" })
- @SpecAssertion(section = "9.4")
- public void testInstanceNotSharedBetweenInjectionPoints()
- {
- Bean<FoxRun> foxRunBean = SimpleBean.of(FoxRun.class, manager);
- Bean<Fox> foxBean = SimpleBean.of(Fox.class, manager);
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert !foxRun.fox.equals(foxRun.anotherFox);
- }
-
- /**
- * Any instance of the Web Bean that is used to evaluate a Unified EL
- * expression exists to service that evaluation only.
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForElEvalutionNotShared()
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "contexts", "producerMethod", "broken" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForProducerMethodNotShared() throws Exception
- {
- SimpleBean<SpiderProducer> spiderProducer = SimpleBean.of(SpiderProducer.class, manager);
- manager.addBean(spiderProducer);
- Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaBean = ProducerMethodBean.of(method, spiderProducer, manager);
- Tarantula tarantula = tarantulaBean.create();
- Tarantula tarantula2 = tarantulaBean.create();
- assert tarantula != null;
- assert tarantula2 != null;
- assert tarantula != tarantula2;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "contexts", "producerMethod", "stub" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForProducerFieldNotShared() throws Exception
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForDisposalMethodNotShared()
- {
- assert false;
- }
-
- /**
- * Any instance of the Web Bean that receives a producer method, producer
- * field, disposal method or observer method invocation exists to service
- * that invocation only
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testInstanceUsedForObserverMethodNotShared()
- {
- assert false;
- }
-
- /**
- * Every invocation of the get() operation of the Context object for the @Dependent
- * scope with the value true for the create parameter returns a new instance
- * of the given Web Bean
- */
- @Test(groups = "contexts")
- @SpecAssertion(section = "9.4")
- public void testContextGetWithCreateTrueReturnsNewInstance()
- {
- Bean<Fox> foxBean = SimpleBean.of(Fox.class, manager);
- manager.addBean(foxBean);
- DependentContext context = new DependentContext();
- context.setActive(true);
- assert context.get(foxBean, true) != null;
- assert context.get(foxBean, true) instanceof Fox;
- }
-
- /**
- * Every invocation of the get() operation of the Context object for the @Dependent
- * scope with the value false for the create parameter returns a null value
- */
- @Test(groups = "contexts")
- @SpecAssertion(section = "9.4")
- public void testContextGetWithCreateFalseReturnsNull()
- {
- Bean<Fox> foxBean = SimpleBean.of(Fox.class, manager);
- manager.addBean(foxBean);
- DependentContext context = new DependentContext();
- context.setActive(true);
- assert context.get(foxBean, false) == null;
- }
-
- /**
- * The @Dependent scope is inactive except:
- */
- @Test(groups = {"contexts"}, expectedExceptions = ContextNotActiveException.class)
- @SpecAssertion(section = "9.4")
- public void testContextIsInactive()
- {
- manager.getContext(Dependent.class).isActive();
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingProducerMethod()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "producerField" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingProducerField()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingDisposalMethod()
- {
- assert false;
- }
-
- /**
- * when an instance of a Web Bean with scope @Dependent is created by the Web
- * Bean manager to receive a producer method, producer field, disposal method
- * or observer method invocation, or
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenInvokingObserverMethod()
- {
- assert false;
- }
-
- /**
- * while a Unified EL expression is evaluated, or
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveWhenEvaluatingElExpression()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "contexts", "beanLifecycle" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringBeanCreation()
- {
- // Slightly roundabout, but I can't see a better way to test atm
- Bean<FoxRun> foxRunBean = SimpleBean.of(FoxRun.class, manager);
- Bean<Fox> foxBean = SimpleBean.of(Fox.class, manager);
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert foxRun.fox != null;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "stub", "contexts", "beanDestruction" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringBeanDestruction()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is creating or destroying a Web Bean instance or
- * injecting its dependencies, or
- */
- @Test(groups = { "contexts", "injection" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringInjection()
- {
- Bean<FoxRun> foxRunBean = SimpleBean.of(FoxRun.class, manager);
- Bean<Fox> foxBean = SimpleBean.of(Fox.class, manager);
- manager.addBean(foxBean);
- FoxRun foxRun = foxRunBean.create();
- assert foxRun.fox != null;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "injection", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBDependencyInjection()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "injection", "stub", "servlet" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringServletDependencyInjection()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "postconstruct", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBPostConstruct()
- {
- assert false;
- }
-
- /**
- * when the Web Bean manager is injecting dependencies of an EJB bean or
- * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
- * invoked by the EJB container
- */
- @Test(groups = { "contexts", "predestroy", "stub", "ejb3" })
- @SpecAssertion(section = "9.4")
- public void testContextIsActiveDuringEJBPreDestroy()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "constructor" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromConstructor()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "removeMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromRemoveMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "initalizerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromInitializerMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromProducerMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromDisposalMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "preDestroy" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromPreDestroy()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "postConstruct" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromPostConstruct()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "interceptor" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromInterceptorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * A Web Bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from the Web Bean constructor, from the
- * Web Bean remove method, from initializer methods, from producer methods,
- * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
- * from Web Beans interceptors or decorators for any of these methods
- */
- @Test(groups = { "stub", "contexts", "decorator" })
- @SpecAssertion(section = "9.4.1")
- public void testWebBeanMayCreateInstanceFromDecoratorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "initializerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromInitializer()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "postConstruct" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromPostConstruct()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "preDestroy" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromPreDestroy()
- {
- assert false;
- }
-
- /**
- * An EJB bean may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods, from @PostConstruct
- * and @PreDestroy callbacks and from Web Beans interceptors for these
- * methods.
- */
- @Test(groups = { "stub", "contexts", "ejb3", "interceptor" })
- @SpecAssertion(section = "9.4.1")
- public void testEjbBeanMayCreateInstanceFromInterceptorOfActiveMethod()
- {
- assert false;
- }
-
- /**
- * A Servlet may create an instance of a Web Bean with scope type @Dependent
- * by calling Manager.getInstance() from initializer methods
- */
- @Test(groups = { "stub", "contexts", "servlet", "initializerMethod" })
- @SpecAssertion(section = "9.4.1")
- public void testServletBeanMayCreateInstanceFromInitializer()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of a Web Bean instance when the instance is
- * destroyed,
- */
- @Test(groups = { "stub", "contexts", "beanDestruction" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingParentDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
- * or Servlet is destroyed,
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingEjbDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
- * or Servlet is destroyed,
- */
- @Test(groups = { "stub", "contexts", "servlet" })
- @SpecAssertion(section = "9.4.2")
- public void testDestroyingServletDestroysDependents()
- {
- assert false;
- }
-
- /**
- * destroy all @Dependent scoped contextual instances created during an EL
- * expression evaluation when the evaluation completes, and
- */
- @Test(groups = { "stub", "contexts", "el" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenElEvaluationCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "producerMethod" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenProducerMethodCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "producerField" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenProducerFieldCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "disposalMethod" })
- @SpecAssertion(section = "9.4.2")
- public void testDependentsDestroyedWhenDisposalMethodCompletes()
- {
- assert false;
- }
-
- /**
- * destroy any @Dependent scoped contextual instance created to receive a
- * producer method, producer field, disposal method or observer method
- * invocation when the invocation completes
- */
- @Test(groups = { "stub", "contexts", "observerMethod" })
- @SpecAssertion(section = "9.4")
- public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
- {
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java 2009-01-16 20:28:23 UTC (rev 1036)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -1,174 +0,0 @@
-package org.jboss.webbeans.test.contexts;
-
-import javax.webbeans.manager.Context;
-
-import org.jboss.webbeans.context.RequestContext;
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Nicklas Karlsson
- * @author Pete Muir
- *
- * This class tests a basic context against section 8 of the
- * specification
- *
- */
-@SpecVersion("20081206")
-public class NormalContextTest extends AbstractTest
-{
- Context context;
-
- @BeforeMethod
- public void initContext()
- {
- context = new RequestContext()
- {
- };
- }
-
- /**
- * return an existing instance of the given contextual type, or
- */
- @Test(groups = { "contexts", "stub" })
- @SpecAssertion(section = "9.2")
- public void testGetReturnsExistingInstace()
- {
- assert false;
- }
-
- /**
- * if the value of the create parameter is false, return a null value, or
- */
- @Test(groups = { "contexts", "stub" })
- @SpecAssertion(section = "9.2")
- public void testGetWithCreateFalseReturnsNull()
- {
- assert false;
- }
-
- /**
- * if the value of the create parameter is true, create a new instance of the
- * given contextual type by calling Bean.create() and return the new
- * instance.
- */
- @Test(groups = { "contexts", "stub" })
- @SpecAssertion(section = "9.2")
- public void testGetWithCreateTrueReturnsNewInstance()
- {
- assert false;
- }
-
- /**
- * The get() method may not return a null value unless the create parameter
- * is false or Contextual.create() returns a null value
- */
- @Test(groups = { "contexts", "stub" })
- @SpecAssertion(section = "9.2")
- public void testGetMayNotReturnNullUnlessCreateIsFalseOrContextualCreateReturnsNull()
- {
- assert false;
- }
-
- /**
- * The get() method may not create a new instance of the given contextual
- * type unless the create parameter is true
- */
- @Test(groups = { "contexts", "stub" })
- @SpecAssertion(section = "9.2")
- public void testGetMayNotCreateNewInstanceUnlessCreateIsTrue()
- {
- assert false;
- }
-
- /**
- * The Context implementation is responsible for destroying any contextual
- * instance it creates by passing the instance to the destroy() method of the
- * Contextual object representing the contextual type.
- */
- public void testContextDestroysBeansWhenDestroyed()
- {
- assert false;
- }
-
- /**
- * A destroyed instance must not subsequently be returned by the get()
- * method.
- */
- @Test(groups = { "contexts", "stub" })
- @SpecAssertion(section = "9.2")
- public void testDestroyedInstanceMustNotBeReturnedByGet()
- {
- assert false;
- }
-
- /**
- * When a scope is inactive, any invocation of the get() from the current
- * thread upon the Context object for that scope results in a
- * ContextNotActiveException.
- */
- @Test(groups = { "contexts", "stub" })
- @SpecAssertion(section = "9.2")
- public void testInvokingGetOnInactiveContextFails()
- {
- assert false;
- }
-
- /**
- * There may be no more than one mapped instance per contextual type per
- * thread
- */
- @Test(groups = { "contexts", "stub" })
- @SpecAssertion(section = "9.3")
- public void testOnlyMappedInstancePerContextualTypePerThread()
- {
- assert false;
- }
-
- /*
- * @Test(groups = "contexts")
- *
- * @SpecAssertion(section = "9.3") public void
- * testGetWithCreateFalseReturnsNull() { Bean<Tuna> tunaBean =
- * BeanFactory.createSimpleBean(Tuna.class, manager); assert
- * context.get(tunaBean, false) == null; }
- *
- * @Test(groups = "contexts")
- *
- * @SpecAssertion(section = "8.1") public void
- * testGetWithCreateTrueReturnsBean() { Bean<Tuna> tunaBean =
- * BeanFactory.createSimpleBean(Tuna.class, manager); assert
- * context.get(tunaBean, true) != null; }
- *
- * @Test(groups = "contexts", expectedExceptions =
- * ContextNotActiveException.class)
- *
- * @SpecAssertion(section = "8.1") public void
- * testInactiveContextThrowsContextNotActiveException() { ((AbstractContext)
- * context).setActive(false); context.get(null, false); assert true; }
- *
- * @Test(groups = "contexts")
- *
- * @SpecAssertion(section = "8.1") public void
- * testReturnsCorrectExistingBean() { Bean<Tuna> tunaBean =
- * BeanFactory.createSimpleBean(Tuna.class, manager); Tuna firstTuna =
- * context.get(tunaBean, true); Tuna secondTuna = context.get(tunaBean,
- * false); assert firstTuna == secondTuna; }
- *
- * @Test(groups = { "contexts", "producerMethod" })
- *
- * @SpecAssertion(section = "8.1") public void
- * testProducerMethodReturningNullOK() throws SecurityException,
- * NoSuchMethodException { SimpleBean<SpiderProducer> producer =
- * createSimpleBean(SpiderProducer.class, manager);
- * manager.addBean(producer); Method nullProducer =
- * SpiderProducer.class.getMethod("produceShelob");
- * ProducerMethodBean<Tarantula> shelobBean =
- * createProducerMethodBean(Tarantula.class, nullProducer, producer,
- * manager); assert shelobBean.create() == null; }
- */
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java 2009-01-16 20:28:23 UTC (rev 1036)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -1,124 +0,0 @@
-package org.jboss.webbeans.test.contexts;
-
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class RequestContextTest extends AbstractTest
-{
-
- /**
- * The request scope is active during the service() method of any Servlet in
- * the web application.
- */
- @Test(groups = { "stub", "contexts", "servlet" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeActiveDuringServiceMethod()
- {
- assert false;
- }
-
- /**
- * The request context is destroyed at the end of the servlet request, after
- * the Servlet service() method returns.
- */
- @Test(groups = { "stub", "contexts", "servlet" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeIsDestroyedAfterServiceMethod()
- {
- assert false;
- }
-
- /**
- * The request scope is active during any Java EE web service invocation.
- */
- @Test(groups = { "stub", "contexts", "webservice" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeActiveDuringWebSericeInvocation()
- {
- assert false;
- }
-
- /**
- * The request context is destroyed after the web service invocation
- * completes
- */
- @Test(groups = { "stub", "contexts", "webservice" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeIsDestroyedAfterWebServiceInvocation()
- {
- assert false;
- }
-
- /**
- * The request scope is active during any remote method invocation of any EJB
- * bean, during any call to an EJB timeout method and during message delivery
- * to any EJB message driven bean.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeActiveDuringRemoteMethodInvocationOfEjb()
- {
- assert false;
- }
-
- /**
- * The request scope is active during any remote method invocation of any EJB
- * bean, during any call to an EJB timeout method and during message delivery
- * to any EJB message driven bean.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeActiveDuringCallToEjbTimeoutMethod()
- {
- assert false;
- }
-
- /**
- * The request scope is active during any remote method invocation of any EJB
- * bean, during any call to an EJB timeout method and during message delivery
- * to any EJB message driven bean.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeActiveDuringEjbMessageDelivery()
- {
- assert false;
- }
-
- /**
- * The request context is destroyed after the remote method invocation,
- * timeout or message delivery completes.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeDestroyedAfterRemoteMethodInvocationOfEjb()
- {
- assert false;
- }
-
- /**
- * The request context is destroyed after the remote method invocation,
- * timeout or message delivery completes.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeDestroyedAfterCallToEjbTimeoutMethod()
- {
- assert false;
- }
-
- /**
- * The request context is destroyed after the remote method invocation,
- * timeout or message delivery completes.
- */
- @Test(groups = { "stub", "contexts", "ejb3" })
- @SpecAssertion(section = "9.6.1")
- public void testRequestScopeDestroyedAfterEjbMessageDelivery()
- {
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/SessionContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/SessionContextTest.java 2009-01-16 20:28:23 UTC (rev 1036)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/SessionContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -1,45 +0,0 @@
-package org.jboss.webbeans.test.contexts;
-
-import org.jboss.webbeans.test.AbstractTest;
-import org.jboss.webbeans.test.SpecAssertion;
-import org.jboss.webbeans.test.SpecVersion;
-import org.testng.annotations.Test;
-
-@SpecVersion("2001206")
-public class SessionContextTest extends AbstractTest
-{
-
- /**
- * The session scope is active during the service() method of any servlet in
- * the web application
- */
- @Test(groups = { "stub", "contexts", "servlet" })
- @SpecAssertion(section = "9.6.2")
- public void testSessionScopeActiveDuringServiceMethod()
- {
- assert false;
- }
-
- /**
- * The session context is shared between all servlet requests that occur in
- * the same HTTP servlet session
- */
- @Test(groups = { "stub", "contexts", "servlet" })
- @SpecAssertion(section = "9.6.2")
- public void testSessionContextSharedBetweenServletRequestsInSameHttpSession()
- {
- assert false;
- }
-
- /**
- * The session context is destroyed when the HTTPSession is invalidated or
- * times out.
- */
- @Test(groups = { "stub", "contexts" })
- @SpecAssertion(section = "9.6.2")
- public void testSessionContextDestroyedWhenHttpSessionInvalidatedOrTimesOut()
- {
- assert false;
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/StereotypesTest.java (from rev 1036, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/StereotypesTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/StereotypesTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,62 @@
+package org.jboss.webbeans.test.unit;
+
+import java.util.Arrays;
+
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.model.StereotypeModel;
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecVersion;
+import org.jboss.webbeans.test.annotations.AnimalOrderStereotype;
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
+import org.jboss.webbeans.test.beans.Animal;
+import org.jboss.webbeans.test.beans.Order;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class StereotypesTest extends AbstractTest
+{
+
+ @Test
+ public void testAnimalStereotype()
+ {
+ StereotypeModel<AnimalStereotype> animalStereotype = new StereotypeModel<AnimalStereotype>(AnimalStereotype.class);
+ assert animalStereotype.getDefaultScopeType().annotationType().equals(RequestScoped.class);
+ assert animalStereotype.getInterceptorBindings().size() == 0;
+ assert animalStereotype.getRequiredTypes().size() == 1;
+ assert animalStereotype.getRequiredTypes().contains(Animal.class);
+ assert animalStereotype.getSupportedScopes().size() == 0;
+ assert !animalStereotype.isBeanNameDefaulted();
+ assert animalStereotype.getDefaultDeploymentType() == null;
+ }
+
+ @Test
+ public void testAnimalOrderStereotype()
+ {
+ StereotypeModel<AnimalOrderStereotype> animalStereotype = new StereotypeModel<AnimalOrderStereotype>(AnimalOrderStereotype.class);
+ assert animalStereotype.getDefaultScopeType() == null;
+ assert animalStereotype.getInterceptorBindings().size() == 0;
+ assert animalStereotype.getRequiredTypes().size() == 2;
+ Class<?> [] requiredTypes = {Animal.class, Order.class};
+ assert animalStereotype.getRequiredTypes().containsAll(Arrays.asList(requiredTypes));
+ assert animalStereotype.getSupportedScopes().size() == 0;
+ assert !animalStereotype.isBeanNameDefaulted();
+ assert animalStereotype.getDefaultDeploymentType() == null;
+ }
+
+ @Test
+ public void testRequestScopedAnimalStereotype()
+ {
+ StereotypeModel<RequestScopedAnimalStereotype> animalStereotype = new StereotypeModel<RequestScopedAnimalStereotype>(RequestScopedAnimalStereotype.class);
+ assert animalStereotype.getDefaultScopeType() == null;
+ assert animalStereotype.getInterceptorBindings().size() == 0;
+ assert animalStereotype.getRequiredTypes().size() == 1;
+ assert Animal.class.equals(animalStereotype.getRequiredTypes().iterator().next());
+ assert animalStereotype.getSupportedScopes().size() == 1;
+ assert animalStereotype.getSupportedScopes().contains(RequestScoped.class);
+ assert !animalStereotype.isBeanNameDefaulted();
+ assert animalStereotype.getDefaultDeploymentType() == null;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/StereotypesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.context;
+
+interface Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Animal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ApplicationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ApplicationContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ApplicationContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,92 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class ApplicationContextTest extends AbstractTest
+{
+
+ /**
+ * The application scope is active during the service() method of any servlet
+ * in the web application.
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringServiceMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The application scope is active during any Java EE web service invocation.
+ */
+ @Test(groups = { "stub", "contexts", "webservice" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringWebSericeInvocation()
+ {
+ assert false;
+ }
+
+ /**
+ * The application scope is also active during any remote method invocation
+ * of any EJB bean, during any call to an EJB timeout method and during
+ * message delivery to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringRemoteMethodInvocationOfEjb()
+ {
+ assert false;
+ }
+
+ /**
+ * The application scope is also active during any remote method invocation
+ * of any EJB bean, during any call to an EJB timeout method and during
+ * message delivery to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The application scope is also active during any remote method invocation
+ * of any EJB bean, during any call to an EJB timeout method and during
+ * message delivery to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeActiveDuringEjbMessageDelivery()
+ {
+ assert false;
+ }
+
+ /**
+ * The application context is shared between all servlet requests, web
+ * service invocations, EJB remote method invocations, EJB timeouts and
+ * message deliveries to message driven beans that execute within the same
+ * application
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationContextSharedBetweenInvokationsInApplication()
+ {
+ assert false;
+ }
+
+ /**
+ * The application context is destroyed when the application is undeployed.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.3")
+ public void testApplicationScopeDestroyedWhenApplicationIsUndeployed()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ApplicationContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/City.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/City.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/City.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.context;
+
+class City
+{
+ public void ping() {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/City.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ContextManagementTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ContextManagementTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ContextManagementTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,75 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import javax.webbeans.ContextNotActiveException;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@SpecVersion("20081206")
+public class ContextManagementTest extends AbstractTest
+{
+ /**
+ * For each of the built-in normal scopes, contexts propagate across any Java
+ * method call, including invocation of EJB local business methods.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6")
+ public void testBuiltInNormalScopedContextsPropagateAcrossAnyJavaMethodCall()
+ {
+ assert false;
+ }
+
+ /**
+ * The built-in contexts do not propagate across remote method invocations or
+ * to asynchronous processes such as JMS message listeners or EJB timer
+ * service timeouts
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6")
+ public void testBuiltInNormalScopedContextsDoNotPropagateAcrossRemoteMethodInvocations()
+ {
+ assert false;
+ }
+
+ /**
+ * The built-in contexts do not propagate across remote method invocations or
+ * to asynchronous processes such as JMS message listeners or EJB timer
+ * service timeouts
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6")
+ public void testBuiltInNormalScopedContextsDoNotPropagateAcrossAsynchronousMethodInvocations()
+ {
+ assert false;
+ }
+
+ /**
+ * If no active context object exists for the given scope type, getContext()
+ * must throw a ContextNotActiveException.
+ */
+ @Test(groups = { "stub", "contexts" }, expectedExceptions = ContextNotActiveException.class)
+ @SpecAssertion(section = "9.7")
+ public void testGettingContextNotActiveFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If more than one active context object exists for the given scope type,
+ * getContext() must throw an IllegalStateException.
+ */
+ @Test(groups = { "stub", "contexts" }, expectedExceptions = ContextNotActiveException.class)
+ @SpecAssertion(section = "9.7")
+ public void testGettingContextWithTooManyActiveFails()
+ {
+ assert false;
+ }
+
+}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ContextManagementTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ConversationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ConversationContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ConversationContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,231 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@SpecVersion("20081206")
+public class ConversationContextTest extends AbstractTest
+{
+ /**
+ * For a JSF faces request, the context is active from the beginning of the
+ * apply request values phase, until the response is complete.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testContextActiveFromBeginningOfApplyRequestValuesPhasetoResponseCompleteForJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * For a JSF non-faces request, the context is active during the render
+ * response phase
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testContextActiveDuringRenderResponsePhaseForNonFacesJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * Any JSF request has exactly one associated conversation
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testJsfRequestHasExactlyOneAssociatedConversation()
+ {
+ assert false;
+ }
+
+ /**
+ * The conversation associated with a JSF request is determined at the end of
+ * the restore view phase and does not change during the request
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testAssociatedConversationOfJsfRequestIsDeterminedAtEndOfRestoreViewPhase()
+ {
+ assert false;
+ }
+
+ /**
+ * The conversation associated with a JSF request is determined at the end of
+ * the restore view phase and does not change during the request
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testAssociatedConversationOfJsfRequestDoesNotChangeDuringRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * By default, a conversation is transient
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testDefaultConversationIsTransient()
+ {
+ assert false;
+ }
+
+ /**
+ * All long-running conversations have a string-valued unique identifier
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testConversationsHaveUniqueStringIdentifiers()
+ {
+ assert false;
+ }
+
+ /**
+ * If the conversation associated with the current JSF request is in the
+ * transient state at the end of a JSF request, it is destroyed, and the
+ * conversation context is also destroyed.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testTransientConversationIsDestroyedAtEndOfJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * If the conversation associated with the current JSF request is in the
+ * transient state at the end of a JSF request, it is destroyed, and the
+ * conversation context is also destroyed.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testTransientConversationContextIsDestroyedAtEndOfJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * If the conversation associated with the current JSF request is in the
+ * long-running state at the end of a JSF request, it is not destroyed
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationNotDestroyedAtEndOfJsfRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * The long-running conversation context associated with a request that
+ * renders a JSF view is automatically propagated to any faces request (JSF
+ * form submission) that originates from that rendered page.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationOfJsfRenderingRequestIsPropagatedToRequestFromRenderedPage()
+ {
+ assert false;
+ }
+
+ /**
+ * The long-running conversation context associated with a request that
+ * results in a JSF redirect (via a navigation rule) is automatically
+ * propagated to the resulting non-faces request, and to any other subsequent
+ * request to the same URL. This is accomplished via use of a GET request
+ * parameter named cid containing the unique identifier of the conversation.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationOfJsfRedirectIsPropagatedToNonFacesRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * The long-running conversation associated with a request may be propagated
+ * to any non-faces request via use of a GET request parameter named cid
+ * containing the unique identifier of the conversation. In this case, the
+ * application must manage this request parameter
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationManuallyPropagatedToNonFacesRequest()
+ {
+ assert false;
+ }
+
+ /**
+ * When no conversation is propagated to a JSF request, the request is
+ * associated with a new transient conversation.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testNewTransientRequestIsCreatedWhenNoConversationIsPropagated()
+ {
+ assert false;
+ }
+
+ /**
+ * All long-running conversations are scoped to a particular HTTP servlet
+ * session and may not cross session boundaries
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testLongRunningConversationsMayNotCrossHttpSessions()
+ {
+ assert false;
+ }
+
+ /**
+ * When the HTTP servlet session is invalidated, all long-running
+ * conversation contexts created during the current session are destroyed
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testAllLongRunningConversationContextsOfInvalidatedHttpSessionAreDestroyed()
+ {
+ assert false;
+ }
+
+ /**
+ * The Web Bean manager is permitted to arbitrarily destroy any long-running
+ * conversation that is associated with no current JSF request, in order to
+ * conserve resources
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testManagerCanDestroyOrphanedLongRunningConversations()
+ {
+ assert false;
+ }
+
+ /**
+ * If the propagated conversation cannot be restored, the request is
+ * associated with a new transient conversation
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testNewTransientConversationIsCreatedWhenConversationCannotBeRestored()
+ {
+ assert false;
+ }
+
+ /**
+ * The Web Bean manager ensures that a long-running conversation may be
+ * associated with at most one request at a time, by blocking or rejecting
+ * concurrent requests.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.4")
+ public void testConcurrentRequestsToLongRunningConversationsAreHandled()
+ {
+ assert false;
+ }
+}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/ConversationContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.context;
+
+interface DeadlyAnimal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlyAnimal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.context;
+
+interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DeadlySpider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,601 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import javax.webbeans.ContextNotActiveException;
+import javax.webbeans.Dependent;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Context;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class DependentContextTest extends AbstractTest
+{
+
+ /**
+ * No injected instance of the Web Bean is ever shared between multiple
+ * injection points.
+ */
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceNotSharedBetweenInjectionPoints()
+ {
+ deployBeans(Fox.class, FoxRun.class);
+ Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
+ assert foxBeans.size() == 1;
+ Bean<Fox> foxBean = foxBeans.iterator().next();
+ Set<Bean<FoxRun>> foxRunBeans = manager.resolveByType(FoxRun.class);
+ assert foxRunBeans.size() == 1;
+ Bean<FoxRun> foxRunBean = foxRunBeans.iterator().next();
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert !foxRun.fox.equals(foxRun.anotherFox);
+ }
+
+ /**
+ * Any instance of the Web Bean that is used to evaluate a Unified EL
+ * expression exists to service that evaluation only.
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForElEvalutionNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "contexts", "producerMethod", "broken" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForProducerMethodNotShared() throws Exception
+ {
+ Bean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTarantula");
+ Bean<Tarantula> tarantulaBean = createProducerMethodBean(method, spiderProducer);
+ Tarantula tarantula = tarantulaBean.create();
+ Tarantula tarantula2 = tarantulaBean.create();
+ assert tarantula != null;
+ assert tarantula2 != null;
+ assert tarantula != tarantula2;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "contexts", "producerMethod", "stub" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForProducerFieldNotShared() throws Exception
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForDisposalMethodNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Any instance of the Web Bean that receives a producer method, producer
+ * field, disposal method or observer method invocation exists to service
+ * that invocation only
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testInstanceUsedForObserverMethodNotShared()
+ {
+ assert false;
+ }
+
+ /**
+ * Every invocation of the get() operation of the Context object for the @Dependent
+ * scope with the value true for the create parameter returns a new instance
+ * of the given Web Bean
+ */
+ @Test(groups = "contexts")
+ @SpecAssertion(section = "9.4")
+ public void testContextGetWithCreateTrueReturnsNewInstance() throws Exception
+ {
+ deployBeans(Fox.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
+ assert foxBeans.size() == 1;
+ Bean<Fox> foxBean = foxBeans.iterator().next();
+ Context context = manager.getContext(Dependent.class);
+ assert context.get(foxBean, true) != null;
+ assert context.get(foxBean, true) instanceof Fox;
+ }
+
+ }.run();
+
+ }
+
+ /**
+ * Every invocation of the get() operation of the Context object for the @Dependent
+ * scope with the value false for the create parameter returns a null value
+ */
+ @Test(groups = "contexts")
+ @SpecAssertion(section = "9.4")
+ public void testContextGetWithCreateFalseReturnsNull() throws Exception
+ {
+ deployBeans(Fox.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Set<Bean<Fox>> foxBeans = manager.resolveByType(Fox.class);
+ assert foxBeans.size() == 1;
+ Bean<Fox> foxBean = foxBeans.iterator().next();
+ Context context = manager.getContext(Dependent.class);
+ assert context.get(foxBean, false) == null;
+ }
+
+ }.run();
+
+
+ }
+
+ /**
+ * The @Dependent scope is inactive except:
+ */
+ @Test(groups = {"contexts"}, expectedExceptions = ContextNotActiveException.class)
+ @SpecAssertion(section = "9.4")
+ public void testContextIsInactive()
+ {
+ manager.getContext(Dependent.class).isActive();
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingProducerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "producerField" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingProducerField()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingDisposalMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * when an instance of a Web Bean with scope @Dependent is created by the Web
+ * Bean manager to receive a producer method, producer field, disposal method
+ * or observer method invocation, or
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenInvokingObserverMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * while a Unified EL expression is evaluated, or
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveWhenEvaluatingElExpression()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "contexts", "beanLifecycle" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringBeanCreation()
+ {
+ // Slightly roundabout, but I can't see a better way to test atm
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert foxRun.fox != null;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "stub", "contexts", "beanDestruction" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringBeanDestruction()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is creating or destroying a Web Bean instance or
+ * injecting its dependencies, or
+ */
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringInjection()
+ {
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
+ manager.addBean(foxBean);
+ FoxRun foxRun = foxRunBean.create();
+ assert foxRun.fox != null;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "injection", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBDependencyInjection()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "injection", "stub", "servlet" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringServletDependencyInjection()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "postconstruct", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * when the Web Bean manager is injecting dependencies of an EJB bean or
+ * Servlet or when an EJB bean @PostConstruct or @PreDestroy callback is
+ * invoked by the EJB container
+ */
+ @Test(groups = { "contexts", "predestroy", "stub", "ejb3" })
+ @SpecAssertion(section = "9.4")
+ public void testContextIsActiveDuringEJBPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "constructor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromConstructor()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "removeMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromRemoveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "initalizerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromInitializerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromProducerMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromDisposalMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "preDestroy" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "postConstruct" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "interceptor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromInterceptorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Web Bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from the Web Bean constructor, from the
+ * Web Bean remove method, from initializer methods, from producer methods,
+ * from disposal methods, from @PostConstruct and @PreDestroy callbacks and
+ * from Web Beans interceptors or decorators for any of these methods
+ */
+ @Test(groups = { "stub", "contexts", "decorator" })
+ @SpecAssertion(section = "9.4.1")
+ public void testWebBeanMayCreateInstanceFromDecoratorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "initializerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromInitializer()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "postConstruct" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromPostConstruct()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "preDestroy" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromPreDestroy()
+ {
+ assert false;
+ }
+
+ /**
+ * An EJB bean may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods, from @PostConstruct
+ * and @PreDestroy callbacks and from Web Beans interceptors for these
+ * methods.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3", "interceptor" })
+ @SpecAssertion(section = "9.4.1")
+ public void testEjbBeanMayCreateInstanceFromInterceptorOfActiveMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * A Servlet may create an instance of a Web Bean with scope type @Dependent
+ * by calling Manager.getInstance() from initializer methods
+ */
+ @Test(groups = { "stub", "contexts", "servlet", "initializerMethod" })
+ @SpecAssertion(section = "9.4.1")
+ public void testServletBeanMayCreateInstanceFromInitializer()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of a Web Bean instance when the instance is
+ * destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "beanDestruction" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingParentDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
+ * or Servlet is destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingEjbDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all dependent objects of an EJB bean or Servlet when the EJB bean
+ * or Servlet is destroyed,
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDestroyingServletDestroysDependents()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy all @Dependent scoped contextual instances created during an EL
+ * expression evaluation when the evaluation completes, and
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenElEvaluationCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "producerMethod" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenProducerMethodCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "producerField" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenProducerFieldCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "disposalMethod" })
+ @SpecAssertion(section = "9.4.2")
+ public void testDependentsDestroyedWhenDisposalMethodCompletes()
+ {
+ assert false;
+ }
+
+ /**
+ * destroy any @Dependent scoped contextual instance created to receive a
+ * producer method, producer field, disposal method or observer method
+ * invocation when the invocation completes
+ */
+ @Test(groups = { "stub", "contexts", "observerMethod" })
+ @SpecAssertion(section = "9.4")
+ public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/DependentContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import javax.webbeans.Dependent;
+
+@Dependent
+class Fox
+{
+
+ public String getName()
+ {
+ return "gavin";
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Fox.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import javax.webbeans.Current;
+
+class FoxRun
+{
+
+ @Current
+ public Fox fox;
+
+ @Current
+ public Fox anotherFox;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/FoxRun.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Helsinki.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Helsinki.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Helsinki.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import javax.ejb.Stateful;
+import javax.webbeans.Dependent;
+
+@Dependent
+@Stateful
+class Helsinki
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Helsinki.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Hyvinkaa.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Hyvinkaa.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Hyvinkaa.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SuppressWarnings("serial")
+@SessionScoped
+class Hyvinkaa implements Serializable
+{
+ @SuppressWarnings("unused")
+ @Current
+ private transient Violation reference;
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Hyvinkaa.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Joensuu.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Joensuu.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Joensuu.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SuppressWarnings("serial")
+@SessionScoped
+class Joensuu implements Serializable
+{
+ @SuppressWarnings("unused")
+ @Current
+ private transient Violation reference;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Joensuu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Jyvaskyla.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Jyvaskyla.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Jyvaskyla.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import java.io.Serializable;
+
+import javax.webbeans.SessionScoped;
+
+@SuppressWarnings("serial")
+@SessionScoped
+class Jyvaskyla implements Serializable
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Jyvaskyla.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/NormalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/NormalContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/NormalContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,202 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.webbeans.ScopeType;
+import javax.webbeans.manager.Context;
+import javax.webbeans.manager.Contextual;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Nicklas Karlsson
+ * @author Pete Muir
+ *
+ * This class tests a basic context against section 8 of the
+ * specification
+ *
+ */
+@SpecVersion("20081206")
+public class NormalContextTest extends AbstractTest
+{
+
+ @ScopeType
+ @Retention(RetentionPolicy.RUNTIME)
+ private @interface Dummy {}
+
+ private static class DummyContext implements Context
+ {
+
+ public <T> T get(Contextual<T> bean, boolean create)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return true;
+ }
+
+ }
+
+ Context context;
+
+ @BeforeMethod
+ public void initContext()
+ {
+ context = new DummyContext();
+ }
+
+ /**
+ * return an existing instance of the given contextual type, or
+ */
+ @Test(groups = { "contexts", "stub" })
+ @SpecAssertion(section = "9.2")
+ public void testGetReturnsExistingInstace()
+ {
+ assert false;
+ }
+
+ /**
+ * if the value of the create parameter is false, return a null value, or
+ */
+ @Test(groups = { "contexts", "stub" })
+ @SpecAssertion(section = "9.2")
+ public void testGetWithCreateFalseReturnsNull()
+ {
+ assert false;
+ }
+
+ /**
+ * if the value of the create parameter is true, create a new instance of the
+ * given contextual type by calling Bean.create() and return the new
+ * instance.
+ */
+ @Test(groups = { "contexts", "stub" })
+ @SpecAssertion(section = "9.2")
+ public void testGetWithCreateTrueReturnsNewInstance()
+ {
+ assert false;
+ }
+
+ /**
+ * The get() method may not return a null value unless the create parameter
+ * is false or Contextual.create() returns a null value
+ */
+ @Test(groups = { "contexts", "stub" })
+ @SpecAssertion(section = "9.2")
+ public void testGetMayNotReturnNullUnlessCreateIsFalseOrContextualCreateReturnsNull()
+ {
+ assert false;
+ }
+
+ /**
+ * The get() method may not create a new instance of the given contextual
+ * type unless the create parameter is true
+ */
+ @Test(groups = { "contexts", "stub" })
+ @SpecAssertion(section = "9.2")
+ public void testGetMayNotCreateNewInstanceUnlessCreateIsTrue()
+ {
+ assert false;
+ }
+
+ /**
+ * The Context implementation is responsible for destroying any contextual
+ * instance it creates by passing the instance to the destroy() method of the
+ * Contextual object representing the contextual type.
+ */
+ public void testContextDestroysBeansWhenDestroyed()
+ {
+ assert false;
+ }
+
+ /**
+ * A destroyed instance must not subsequently be returned by the get()
+ * method.
+ */
+ @Test(groups = { "contexts", "stub" })
+ @SpecAssertion(section = "9.2")
+ public void testDestroyedInstanceMustNotBeReturnedByGet()
+ {
+ assert false;
+ }
+
+ /**
+ * When a scope is inactive, any invocation of the get() from the current
+ * thread upon the Context object for that scope results in a
+ * ContextNotActiveException.
+ */
+ @Test(groups = { "contexts", "stub" })
+ @SpecAssertion(section = "9.2")
+ public void testInvokingGetOnInactiveContextFails()
+ {
+ assert false;
+ }
+
+ /**
+ * There may be no more than one mapped instance per contextual type per
+ * thread
+ */
+ @Test(groups = { "contexts", "stub" })
+ @SpecAssertion(section = "9.3")
+ public void testOnlyMappedInstancePerContextualTypePerThread()
+ {
+ assert false;
+ }
+
+ /*
+ * @Test(groups = "contexts")
+ *
+ * @SpecAssertion(section = "9.3") public void
+ * testGetWithCreateFalseReturnsNull() { Bean<Tuna> tunaBean =
+ * BeanFactory.createSimpleBean(Tuna.class, manager); assert
+ * context.get(tunaBean, false) == null; }
+ *
+ * @Test(groups = "contexts")
+ *
+ * @SpecAssertion(section = "8.1") public void
+ * testGetWithCreateTrueReturnsBean() { Bean<Tuna> tunaBean =
+ * BeanFactory.createSimpleBean(Tuna.class, manager); assert
+ * context.get(tunaBean, true) != null; }
+ *
+ * @Test(groups = "contexts", expectedExceptions =
+ * ContextNotActiveException.class)
+ *
+ * @SpecAssertion(section = "8.1") public void
+ * testInactiveContextThrowsContextNotActiveException() { ((AbstractContext)
+ * context).setActive(false); context.get(null, false); assert true; }
+ *
+ * @Test(groups = "contexts")
+ *
+ * @SpecAssertion(section = "8.1") public void
+ * testReturnsCorrectExistingBean() { Bean<Tuna> tunaBean =
+ * BeanFactory.createSimpleBean(Tuna.class, manager); Tuna firstTuna =
+ * context.get(tunaBean, true); Tuna secondTuna = context.get(tunaBean,
+ * false); assert firstTuna == secondTuna; }
+ *
+ * @Test(groups = { "contexts", "producerMethod" })
+ *
+ * @SpecAssertion(section = "8.1") public void
+ * testProducerMethodReturningNullOK() throws SecurityException,
+ * NoSuchMethodException { SimpleBean<SpiderProducer> producer =
+ * createSimpleBean(SpiderProducer.class, manager);
+ * manager.addBean(producer); Method nullProducer =
+ * SpiderProducer.class.getMethod("produceShelob");
+ * ProducerMethodBean<Tarantula> shelobBean =
+ * createProducerMethodBean(Tarantula.class, nullProducer, producer,
+ * manager); assert shelobBean.create() == null; }
+ */
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/NormalContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/RequestContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/RequestContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/RequestContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,124 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class RequestContextTest extends AbstractTest
+{
+
+ /**
+ * The request scope is active during the service() method of any Servlet in
+ * the web application.
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringServiceMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed at the end of the servlet request, after
+ * the Servlet service() method returns.
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeIsDestroyedAfterServiceMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The request scope is active during any Java EE web service invocation.
+ */
+ @Test(groups = { "stub", "contexts", "webservice" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringWebSericeInvocation()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed after the web service invocation
+ * completes
+ */
+ @Test(groups = { "stub", "contexts", "webservice" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeIsDestroyedAfterWebServiceInvocation()
+ {
+ assert false;
+ }
+
+ /**
+ * The request scope is active during any remote method invocation of any EJB
+ * bean, during any call to an EJB timeout method and during message delivery
+ * to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringRemoteMethodInvocationOfEjb()
+ {
+ assert false;
+ }
+
+ /**
+ * The request scope is active during any remote method invocation of any EJB
+ * bean, during any call to an EJB timeout method and during message delivery
+ * to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringCallToEjbTimeoutMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The request scope is active during any remote method invocation of any EJB
+ * bean, during any call to an EJB timeout method and during message delivery
+ * to any EJB message driven bean.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeActiveDuringEjbMessageDelivery()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed after the remote method invocation,
+ * timeout or message delivery completes.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeDestroyedAfterRemoteMethodInvocationOfEjb()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed after the remote method invocation,
+ * timeout or message delivery completes.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeDestroyedAfterCallToEjbTimeoutMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The request context is destroyed after the remote method invocation,
+ * timeout or message delivery completes.
+ */
+ @Test(groups = { "stub", "contexts", "ejb3" })
+ @SpecAssertion(section = "9.6.1")
+ public void testRequestScopeDestroyedAfterEjbMessageDelivery()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/RequestContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SessionContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SessionContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SessionContextTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,45 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("2001206")
+public class SessionContextTest extends AbstractTest
+{
+
+ /**
+ * The session scope is active during the service() method of any servlet in
+ * the web application
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.2")
+ public void testSessionScopeActiveDuringServiceMethod()
+ {
+ assert false;
+ }
+
+ /**
+ * The session context is shared between all servlet requests that occur in
+ * the same HTTP servlet session
+ */
+ @Test(groups = { "stub", "contexts", "servlet" })
+ @SpecAssertion(section = "9.6.2")
+ public void testSessionContextSharedBetweenServletRequestsInSameHttpSession()
+ {
+ assert false;
+ }
+
+ /**
+ * The session context is destroyed when the HTTPSession is invalidated or
+ * times out.
+ */
+ @Test(groups = { "stub", "contexts" })
+ @SpecAssertion(section = "9.6.2")
+ public void testSessionContextDestroyedWhenHttpSessionInvalidatedOrTimesOut()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SessionContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.tests.context;
+
+
+class Spider implements Animal
+{
+
+ public final void layEggs()
+ {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Spider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import javax.webbeans.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer
+{
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/SpiderProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.context;
+
+class Tarantula extends Spider implements DeadlySpider
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Tarantula.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Turku.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Turku.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Turku.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.SessionScoped;
+
+@Stateful
+@SessionScoped
+class Turku
+{
+ @Remove
+ public void bye() {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Turku.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Vaasa.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Vaasa.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Vaasa.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import java.io.Serializable;
+
+import javax.webbeans.Current;
+import javax.webbeans.SessionScoped;
+
+@SuppressWarnings("serial")
+@SessionScoped
+class Vaasa implements Serializable
+{
+ @SuppressWarnings("unused")
+ @Current private Helsinki ejb;
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Vaasa.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Violation.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Violation.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Violation.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.context;
+
+import javax.webbeans.Dependent;
+
+@Dependent
+public class Violation
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/Violation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Animal.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+interface Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Animal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnimalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnimalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnimalStereotype.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.RequestScoped;
+import javax.webbeans.Stereotype;
+
+(a)Stereotype(requiredTypes=Animal.class)
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+@interface AnimalStereotype
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnimalStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherDeploymentType.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherStereotype.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.Stereotype;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@AnotherDeploymentType
+@interface AnotherStereotype
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/AnotherStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Antelope_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Antelope_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Antelope_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@HornedMammalStereotype
+@Bovine
+class Antelope_Broken implements Mammal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Antelope_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/ApplicationScopedHornedMammalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/ApplicationScopedHornedMammalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/ApplicationScopedHornedMammalStereotype.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.Stereotype;
+
+(a)Stereotype(supportedScopes=ApplicationScoped.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@HornedAnimalDeploymentType
+@interface ApplicationScopedHornedMammalStereotype
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/ApplicationScopedHornedMammalStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Asynchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Asynchronous.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Asynchronous.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Asynchronous
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Asynchronous.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Bovine.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Bovine.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Bovine.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.Stereotype;
+
+(a)Stereotype(requiredTypes=Mammal.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@interface Bovine
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Bovine.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Carp_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Carp_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Carp_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@RequestScopedAnimalStereotype
+class Carp_Broken implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Carp_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Chair_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Chair_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Chair_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@AnimalStereotype
+class Chair_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Chair_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Elk_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Elk_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Elk_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@StereotypeWithTooManyScopeTypes_Broken
+public class Elk_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Elk_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/FallowDeer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/FallowDeer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/FallowDeer_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@StereotypeWithNonEmptyNamed_Broken
+public class FallowDeer_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/FallowDeer_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Gazelle_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Gazelle_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Gazelle_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@StereotypeWithTooManyDeploymentTypes_Broken
+public class Gazelle_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Gazelle_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goat_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goat_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goat_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@HornedMammalStereotype
+@AnotherStereotype
+class Goat_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goat_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goldfish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goldfish.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goldfish.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+@RequestScopedAnimalStereotype
+@RequestScoped
+@Production
+class Goldfish implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Goldfish.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HighlandCow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HighlandCow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HighlandCow.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import javax.webbeans.RequestScoped;
+
+@HornedMammalStereotype
+@RequestScopedAnimalStereotype
+@RequestScoped
+@Tame
+class HighlandCow implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HighlandCow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedAnimalDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedAnimalDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedAnimalDeploymentType.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface HornedAnimalDeploymentType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedAnimalDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedMammalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedMammalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedMammalStereotype.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.Stereotype;
+
+(a)Stereotype(requiredTypes=Animal.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@HornedAnimalDeploymentType
+@interface HornedMammalStereotype
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/HornedMammalStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Mammal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Mammal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Mammal.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+public interface Mammal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Mammal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Moose.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Moose.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Moose.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@AnimalStereotype
+class Moose implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Moose.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Reindeer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Reindeer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Reindeer.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@HornedMammalStereotype
+public class Reindeer implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Reindeer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RequestScopedAnimalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RequestScopedAnimalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RequestScopedAnimalStereotype.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.RequestScoped;
+import javax.webbeans.Stereotype;
+
+(a)Stereotype(requiredTypes=Animal.class, supportedScopes=RequestScoped.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@interface RequestScopedAnimalStereotype
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RequestScopedAnimalStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RoeDeer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RoeDeer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RoeDeer_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+@StereotypeWithBindingTypes_Broken
+public class RoeDeer_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/RoeDeer_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Springbok.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Springbok.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Springbok.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import javax.webbeans.ApplicationScoped;
+
+@ApplicationScopedHornedMammalStereotype
+@RequestScopedAnimalStereotype
+@ApplicationScoped
+public class Springbok implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Springbok.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithBindingTypes_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithBindingTypes_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithBindingTypes_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.Stereotype;
+
+@Stereotype
+@Target( { TYPE })
+@Retention(RUNTIME)
+@Asynchronous
+@interface StereotypeWithBindingTypes_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithBindingTypes_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithNonEmptyNamed_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithNonEmptyNamed_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithNonEmptyNamed_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.Named;
+import javax.webbeans.Stereotype;
+
+@Stereotype
+@Target( { TYPE })
+@Retention(RUNTIME)
+@Named("foo")
+@interface StereotypeWithNonEmptyNamed_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithNonEmptyNamed_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyDeploymentTypes_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyDeploymentTypes_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyDeploymentTypes_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.Production;
+import javax.webbeans.Stereotype;
+
+@Stereotype
+@Target( { TYPE })
+@Retention(RUNTIME)
+@Production
+@AnotherDeploymentType
+@interface StereotypeWithTooManyDeploymentTypes_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyDeploymentTypes_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyScopeTypes_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyScopeTypes_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyScopeTypes_Broken.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.Stereotype;
+
+@Stereotype
+@Target( { TYPE })
+@Retention(RUNTIME)
+@ApplicationScoped
+@RequestScoped
+@interface StereotypeWithTooManyScopeTypes_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypeWithTooManyScopeTypes_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypesTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypesTest.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,224 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.DefinitionException;
+import javax.webbeans.Dependent;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class StereotypesTest extends AbstractTest
+{
+
+ @Override
+ protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ {
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
+ deploymentTypes.add(AnotherDeploymentType.class);
+ deploymentTypes.add(HornedAnimalDeploymentType.class);
+ return deploymentTypes;
+ }
+
+ @Test(groups = { "stub", "annotationDefinition" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "2.7.1")
+ public void testHasCorrectTarget()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "annotationDefinition" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "2.7.1")
+ public void testHasCorrectRetention()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "annotationDefinition" }, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "2.7.1")
+ public void testHasStereotypeAnnotation()
+ {
+ assert false;
+ }
+
+ @Test
+ @SpecAssertion(section = "2.7.1.1")
+ public void testStereotypeWithScopeType()
+ {
+ Bean<Moose> moose = createSimpleBean(Moose.class);
+ assert moose.getScopeType().equals(RequestScoped.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "2.7.1.1")
+ public void testStereotypeWithoutScopeType()
+ {
+ Bean<Reindeer> reindeer = createSimpleBean(Reindeer.class);
+ assert reindeer.getScopeType().equals(Dependent.class);
+ }
+
+ @Test(groups = "stub")
+ @SpecAssertion(section = "2.7.1.2")
+ public void testStereotypeWithoutInterceptors()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "interceptors" })
+ @SpecAssertion(section = "2.7.1.2")
+ public void testStereotypeWithInterceptors()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "2.7.1.1")
+ public void testStereotypeWithTooManyScopeTypes()
+ {
+ deployBeans(Elk_Broken.class);
+ }
+
+ @Test(expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "2.7.1.1")
+ public void testStereotypeWithTooManyDeploymentTypes()
+ {
+ deployBeans(Gazelle_Broken.class);
+ }
+
+ @Test(expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "2.7.1.3")
+ public void testStereotypeWithNonEmptyNamed()
+ {
+ deployBeans(FallowDeer_Broken.class);
+ }
+
+ @Test(expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = "2.7.1")
+ public void testStereotypeWithBindingTypes()
+ {
+ deployBeans(RoeDeer_Broken.class);
+ }
+
+ @Test
+ @SpecAssertion(section = { "2.7.2", "2.7.4" })
+ public void testMultipleStereotypes()
+ {
+ Bean<HighlandCow> highlandCow = createSimpleBean(HighlandCow.class);
+ assert highlandCow.getName() == null;
+ assert highlandCow.getBindings().iterator().next().annotationType().equals(Tame.class);
+ assert highlandCow.getScopeType().equals(RequestScoped.class);
+ assert highlandCow.getDeploymentType().equals(HornedAnimalDeploymentType.class);
+ }
+
+ @Test
+ @SpecAssertion(section = { "2.7.2", "2.7.4" })
+ public void testMultipleStereotypesMergesScopes()
+ {
+ Bean<Springbok> springbok = createSimpleBean(Springbok.class);
+ assert springbok.getScopeType().equals(ApplicationScoped.class);
+ }
+
+ @Test(expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = { "2.7.2", "2.7.4" })
+ public void testMultipleStereotypesMergesRequiredTypes()
+ {
+ deployBeans(Antelope_Broken.class);
+ }
+
+ @Test(expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = { "2.7.2", "2.7.4" })
+ public void testMultipleStereotypesWithMultipleDeploymentTypes()
+ {
+ deployBeans(Goat_Broken.class);
+ }
+
+ @Test(expectedExceptions = DefinitionException.class, groups = "stub")
+ @SpecAssertion(section = { "2.7.2", "2.7.4" })
+ public void testMultipleStereotypesWithMultipleScopeTypes()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "webbeansxml" })
+ @SpecAssertion(section = "2.7.3")
+ public void testStereotypeDeclaredInXmlIgnoresJavaStereotypes()
+ {
+ // Map<Class<? extends Annotation>, Annotation> cooXmlAnnotations = new
+ // HashMap<Class<? extends Annotation>, Annotation>();
+ // cooXmlAnnotations.put(HornedMammalStereotype.class, new
+ // HornedMamalStereotypeAnnotationLiteral());
+ // AnnotatedClass<HighlandCow> cooXmlAnnotatedItem = new
+ // SimpleAnnotatedClass<HighlandCow>(HighlandCow.class,
+ // cooXmlAnnotations);
+
+ /*
+ * SimpleBean<HighlandCow> coo = createSimpleBean(HighlandCow.class,
+ * cooXmlAnnotatedItem); assert
+ * coo.getDeploymentType().equals(HornedAnimalDeploymentType.class);
+ * assert coo.getScopeType().equals(RequestScoped.class); assert
+ * coo.getMergedStereotypes().getRequiredTypes().size() == 1; assert
+ * coo.getMergedStereotypes().getRequiredTypes().contains(Animal.class);
+ * assert coo.getMergedStereotypes().getSupportedScopes().size() == 0;
+ */
+ assert false;
+ }
+
+ @Test(groups = { "stub", "webbeansxml" })
+ @SpecAssertion(section = "2.7.3")
+ public void testStereotypeDeclaredInXmlIgnoresJavaBindingTypes()
+ {
+ // Map<Class<? extends Annotation>, Annotation> cooXmlAnnotations = new
+ // HashMap<Class<? extends Annotation>, Annotation>();
+ // cooXmlAnnotations.put(HornedMammalStereotype.class, new
+ // HornedMamalStereotypeAnnotationLiteral());
+ // cooXmlAnnotations.put(Synchronous.class, new
+ // SynchronousAnnotationLiteral());
+ // AnnotatedClass<HighlandCow> cooXmlAnnotatedItem = new
+ // SimpleAnnotatedClass<HighlandCow>(HighlandCow.class,
+ // cooXmlAnnotations);
+
+ /*
+ * SimpleBean<HighlandCow> coo = createSimpleBean(HighlandCow.class,
+ * cooXmlAnnotatedItem); assert coo.getBindingTypes().size() == 1; assert
+ * coo.getBindingTypes().contains(new SynchronousAnnotationLiteral());
+ */
+ assert false;
+
+ }
+
+ @Test
+ @SpecAssertion(section = { "2.7.1.4", "2.7.4" })
+ public void testRequiredTypeIsImplemented()
+ {
+ assert createSimpleBean(HighlandCow.class).getTypes().contains(Animal.class);
+ }
+
+ @Test(expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = { "2.7.1.4", "2.7.4" })
+ public void testRequiredTypeIsNotImplemented()
+ {
+ deployBeans(Chair_Broken.class);
+ }
+
+ @Test
+ @SpecAssertion(section = { "2.7.1.4", "2.7.4" })
+ public void testScopeIsSupported()
+ {
+ assert createSimpleBean(Goldfish.class).getScopeType().equals(RequestScoped.class);
+ }
+
+ @Test(expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = { "2.7.1.4", "2.7.4" })
+ public void testScopeIsNotSupported()
+ {
+ createSimpleBean(Carp_Broken.class);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/StereotypesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Tame.java 2009-01-17 14:32:18 UTC (rev 1037)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/stereotype/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
[webbeans-commits] Webbeans SVN: r1036 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-16 15:28:23 -0500 (Fri, 16 Jan 2009)
New Revision: 1036
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Cow_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Donkey.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Duck.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/EntityBean.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goose_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/HeavyDuty.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockEnterpriseBean.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockFilter.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockHttpSessionListener.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServlet.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServletContextListener.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServletRequestListener.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockUIComponent.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Modern.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Motorized.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Order.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/OuterBean_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/ParameterizedBean_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Plough.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Sheep.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SimpleBeanModelTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Synchronous.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SynchronousAnnotationLiteral.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tractor.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Turkey.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EnterpriseBeanWebBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EntityBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/FilterBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/HttpSessionListenerBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletContextListenerBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletRequestListenerBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/UIComponentBean.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java
Log:
Port simple bean tests
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,327 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.lang.annotation.Annotation;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.webbeans.AnnotationLiteral;
-import javax.webbeans.DefinitionException;
-import javax.webbeans.NonexistentConstructorException;
-
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.binding.CurrentBinding;
-import org.jboss.webbeans.introspector.AnnotatedConstructor;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.test.annotations.HeavyDuty;
-import org.jboss.webbeans.test.annotations.Motorized;
-import org.jboss.webbeans.test.beans.Cow;
-import org.jboss.webbeans.test.beans.Donkey;
-import org.jboss.webbeans.test.beans.Duck;
-import org.jboss.webbeans.test.beans.Order;
-import org.jboss.webbeans.test.beans.Sheep;
-import org.jboss.webbeans.test.beans.Tractor;
-import org.jboss.webbeans.test.beans.Turkey;
-import org.jboss.webbeans.test.beans.broken.Goose;
-import org.jboss.webbeans.test.beans.broken.ParameterizedBean;
-import org.jboss.webbeans.test.beans.broken.OuterBean.InnerBean;
-import org.jboss.webbeans.test.beans.broken.OuterBean.StaticInnerBean;
-import org.jboss.webbeans.test.beans.nonBeans.EnterpriseBeanWebBean;
-import org.jboss.webbeans.test.beans.nonBeans.FilterBean;
-import org.jboss.webbeans.test.beans.nonBeans.HttpSessionListenerBean;
-import org.jboss.webbeans.test.beans.nonBeans.ServletBean;
-import org.jboss.webbeans.test.beans.nonBeans.ServletContextListenerBean;
-import org.jboss.webbeans.test.beans.nonBeans.ServletRequestListenerBean;
-import org.jboss.webbeans.test.beans.nonBeans.UIComponentBean;
-import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
-import org.jboss.webbeans.test.mock.MockWebBeanDiscovery;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class SimpleBeanModelTest extends AbstractTest
-{
-
- //*** BEAN CLASS CHECKS ****//
-
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2")
- public void testAbstractClassDeclaredInJavaIsNotAllowed()
- {
- SimpleBean.of(Cow.class, manager);
- }
-
- @Test(groups="innerClass") @SpecAssertion(section="3.2")
- public void testStaticInnerClassDeclaredInJavaAllowed()
- {
- SimpleBean.of(StaticInnerBean.class, manager);
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups="innerClass") @SpecAssertion(section="3.2")
- public void testNonStaticInnerClassDeclaredInJavaNotAllowed()
- {
- SimpleBean.of(InnerBean.class, manager);
- }
-
- @SuppressWarnings("unchecked")
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2")
- public void testParameterizedClassDeclaredInJavaIsNotAllowed()
- {
- SimpleBean.of(ParameterizedBean.class, manager);
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups={"stub", "interceptors", "decorators"}) @SpecAssertion(section="3.2")
- public void testClassCannotBeInterceptorAndDecorator()
- {
-
- }
-
- @Test(groups="stub")
- public void testEntitiesNotDiscoveredAsSimpleBeans()
- {
- assert false;
- }
-
- @Test
- public void testClassesImplementingServletInterfacesNotDiscoveredAsSimpleBeans()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(FilterBean.class, HttpSessionListenerBean.class, ServletBean.class, ServletContextListenerBean.class, ServletRequestListenerBean.class));
- webBeansBootstrap.boot();
- assert manager.getBeans().size() == BUILT_IN_BEANS;
- }
-
- @Test
- public void testClassesImplementingEnterpriseBeanInterfaceNotDiscoveredAsSimpleBean()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(EnterpriseBeanWebBean.class));
- webBeansBootstrap.boot();
- assert manager.getBeans().size() == BUILT_IN_BEANS;
- }
-
- @Test
- public void testClassExtendingUiComponentNotDiscoveredAsSimpleBean()
- {
- webBeansBootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(UIComponentBean.class));
- webBeansBootstrap.boot();
- assert manager.getBeans().size() == BUILT_IN_BEANS;
- }
-
- @Test(groups="stub")
- public void testEjbsNotDiscoveredAsSimpleBean()
- {
-
- }
-
- @Test(groups={"stub", "producerMethod", "webbeansxml"}) @SpecAssertion(section="3.2.4")
- public void testBeanDeclaredInXmlIgnoresProducerMethodDeclaredInJava()
- {
- assert false;
- }
-
- @Test(groups={"stub", "disposalMethod", "webbeansxml"}) @SpecAssertion(section="3.2.4")
- public void testBeanDeclaredInXmlIgnoresDisposalMethodDeclaredInJava()
- {
- assert false;
- }
-
- @Test(groups={"stub", "observerMethod", "webbeansxml"}) @SpecAssertion(section="3.2.4")
- public void testBeanDeclaredInXmlIgnoresObserverMethodDeclaredInJava()
- {
- assert false;
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.4")
- public void testAbstractClassDeclaredInXmlIsNotAllowed()
- {
-
- }
-
- @Test(groups={"stub", "innerClass", "webbeansxml"}) @SpecAssertion(section="3.2.4")
- public void testStaticInnerClassDeclaredInXmlAllowed()
- {
- assert false;
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups={"stub", "innerClass", "webbeansxml"}) @SpecAssertion(section="3.2.4")
- public void testNonStaticInnerClassDeclaredInXmlNotAllowed()
- {
- assert false;
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.4")
- public void testParameterizedClassDeclaredInXmlIsNotAllowed()
- {
- assert false;
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups={"stub", "interceptors"}) @SpecAssertion(section="3.2.4")
- public void testClassHasInterceptorInJavaMustHaveInterceptorInXml()
- {
- assert false;
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups={"stub", "interceptors"}) @SpecAssertion(section="3.2.4")
- public void testClassHasDecoratorInJavaMustHaveDecoratorInXml()
- {
- assert false;
- }
-
- @Test @SpecAssertion(section="3.2.5.1")
- public void testInitializerAnnotatedConstructor()
- {
- AnnotatedConstructor<Sheep> constructor = SimpleBean.of(Sheep.class, manager).getConstructor();
- assert constructor.getDeclaringClass().getType().equals(Sheep.class);
- assert constructor.getParameters().size() == 2;
-
- Map<Class<?>, Set<? extends Annotation>> map = new HashMap<Class<?>, Set<? extends Annotation>>();
- for (AnnotatedParameter<?> parameter : constructor.getParameters())
- {
- map.put(parameter.getType(), parameter.getBindingTypes());
- }
- assert map.containsKey(String.class);
- assert map.containsKey(Double.class);
- assert map.get(String.class).size() == 1;
- assert map.get(String.class).contains(new CurrentBinding());
- assert map.get(Double.class).size() == 1;
- assert map.get(Double.class).contains(new CurrentBinding());
- }
-
- @Test @SpecAssertion(section="3.2.5.1")
- public void testImplicitConstructorUsed()
- {
- AnnotatedConstructor<Order> constructor = SimpleBean.of(Order.class, manager).getConstructor();
- assert constructor.getDeclaringClass().getType().equals(Order.class);
- assert constructor.getParameters().size() == 0;
- }
-
- @Test @SpecAssertion(section="3.2.5.1")
- public void testEmptyConstructorUsed()
- {
- AnnotatedConstructor<Donkey> constructor = SimpleBean.of(Donkey.class, manager).getConstructor();
- assert constructor.getDeclaringClass().getType().equals(Donkey.class);
- assert constructor.getParameters().size() == 0;
- }
-
- @Test @SpecAssertion(section="3.2.5.1")
- public void testInitializerAnnotatedConstructorUsedOverEmptyConstuctor()
- {
- AnnotatedConstructor<Turkey> constructor = SimpleBean.of(Turkey.class, manager).getConstructor();
- assert constructor.getParameters().size() == 2;
- Map<Class<?>, Set<? extends Annotation>> map = new HashMap<Class<?>, Set<? extends Annotation>>();
- for (AnnotatedParameter<?> parameter : constructor.getParameters())
- {
- map.put(parameter.getType(), parameter.getBindingTypes());
- }
- assert map.containsKey(String.class);
- assert map.containsKey(Integer.class);
- }
-
- @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2.5.1")
- public void testTooManyInitializerAnnotatedConstructor()
- {
- SimpleBean.of(Goose.class, manager);
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups={"stub", "disposalMethod"}) @SpecAssertion(section="3.2.5.1")
- public void testConstructorHasDisposesParameter()
- {
- assert false;
- }
-
- @Test(expectedExceptions=DefinitionException.class, groups={"stub", "observerMethod"}) @SpecAssertion(section="3.2.5.1")
- public void testConstructorHasObservesParameter()
- {
- assert false;
- }
-
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
- public void testImplicitConstructorDeclaredInXmlUsed()
- {
- assert false;
- }
-
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
- public void testEmptyConstructorDeclaredInXmlUsed()
- {
- AnnotatedConstructor<Donkey> constructor = SimpleBean.of(Donkey.class, manager).getConstructor();
- assert constructor.getParameters().size() == 0;
- assert false;
- }
-
- @Test(expectedExceptions=NonexistentConstructorException.class, groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
- public void testConstructorDeclaredInXmlDoesNotExist()
- {
- assert false;
- }
-
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
- public void testConstructorDeclaredInXmlIgnoresBindingTypesDeclaredInJava()
- {
- assert false;
- }
-
- @Test @SpecAssertion(section="3.2.5.3")
- public void testBindingTypeAnnotatedConstructor()
- {
- AnnotatedConstructor<Duck> constructor = SimpleBean.of(Duck.class, manager).getConstructor();
- assert constructor.getDeclaringClass().getType().equals(Duck.class);
- assert constructor.getParameters().size() == 2;
- Map<Class<?>, Set<? extends Annotation>> map = new HashMap<Class<?>, Set<? extends Annotation>>();
- for (AnnotatedParameter<?> parameter : constructor.getParameters())
- {
- map.put(parameter.getType(), parameter.getBindingTypes());
- }
- assert map.containsKey(String.class);
- assert map.containsKey(Integer.class);
- assert map.get(String.class).size() == 1;
- assert map.get(String.class).contains(new CurrentBinding());
- assert map.get(Integer.class).size() == 1;
- assert map.get(Integer.class).contains(new SynchronousAnnotationLiteral());
- }
-
- @Test(groups="specializationInherit") @SpecAssertion(section="3.2.6")
- public void testSpecializedClassInheritsBindingTypes()
- {
- SimpleBean<Tractor> bean = SimpleBean.of(Tractor.class, manager);
- assert bean.getBindings().size()==2;
- assert bean.getBindings().contains( new AnnotationLiteral<Motorized>() {} );
- assert bean.getBindings().contains( new AnnotationLiteral<HeavyDuty>() {} );
- }
-
- @Test(groups="specializationInherit") @SpecAssertion(section="3.2.6")
- public void testSpecializedClassInheritsName()
- {
- SimpleBean<Tractor> bean = SimpleBean.of(Tractor.class, manager);
- assert bean.getName()!=null;
- assert bean.getName().equals("plough");
- }
-
- @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.2.6")
- public void testLessSpecializedClassNotInstantiated()
- {
- assert false;
- }
-
- @Test(groups={"stub", "specialization"},expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2.6")
- public void testSpecializedClassMustExtendAnotherWebBean()
- {
- assert false;
- }
-
- @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.2.6")
- public void testSpecializedClassDeclaredInXmlInheritsBindingTypes()
- {
- assert false;
- }
-
- @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.2.6")
- public void testSpecializedClassDeclaredInXmlInheritsName()
- {
- assert false;
- }
-
- @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.2.6")
- public void testLessSpecializedClassDeclaredInXmlNotInstantiated()
- {
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EnterpriseBeanWebBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EnterpriseBeanWebBean.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EnterpriseBeanWebBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,8 +0,0 @@
-package org.jboss.webbeans.test.beans.nonBeans;
-
-import javax.ejb.EnterpriseBean;
-
-public class EnterpriseBeanWebBean implements EnterpriseBean
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EntityBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EntityBean.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EntityBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.beans.nonBeans;
-
-public class EntityBean
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/FilterBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/FilterBean.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/FilterBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,30 +0,0 @@
-package org.jboss.webbeans.test.beans.nonBeans;
-
-import java.io.IOException;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-public class FilterBean implements Filter
-{
-
- public void destroy()
- {
-
- }
-
- public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException
- {
-
- }
-
- public void init(FilterConfig arg0) throws ServletException
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/HttpSessionListenerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/HttpSessionListenerBean.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/HttpSessionListenerBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,18 +0,0 @@
-package org.jboss.webbeans.test.beans.nonBeans;
-
-import javax.servlet.http.HttpSessionEvent;
-
-public class HttpSessionListenerBean implements javax.servlet.http.HttpSessionListener
-{
-
- public void sessionCreated(HttpSessionEvent arg0)
- {
-
- }
-
- public void sessionDestroyed(HttpSessionEvent arg0)
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletBean.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,39 +0,0 @@
-package org.jboss.webbeans.test.beans.nonBeans;
-
-import java.io.IOException;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-public class ServletBean implements Servlet
-{
-
- public void destroy()
- {
-
- }
-
- public ServletConfig getServletConfig()
- {
- return null;
- }
-
- public String getServletInfo()
- {
- return null;
- }
-
- public void init(ServletConfig arg0) throws ServletException
- {
-
- }
-
- public void service(ServletRequest arg0, ServletResponse arg1) throws ServletException, IOException
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletContextListenerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletContextListenerBean.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletContextListenerBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,19 +0,0 @@
-package org.jboss.webbeans.test.beans.nonBeans;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-public class ServletContextListenerBean implements ServletContextListener
-{
-
- public void contextDestroyed(ServletContextEvent arg0)
- {
-
- }
-
- public void contextInitialized(ServletContextEvent arg0)
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletRequestListenerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletRequestListenerBean.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/ServletRequestListenerBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,19 +0,0 @@
-package org.jboss.webbeans.test.beans.nonBeans;
-
-import javax.servlet.ServletRequestEvent;
-import javax.servlet.ServletRequestListener;
-
-public class ServletRequestListenerBean implements ServletRequestListener
-{
-
- public void requestDestroyed(ServletRequestEvent arg0)
- {
-
- }
-
- public void requestInitialized(ServletRequestEvent arg0)
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/UIComponentBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/UIComponentBean.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/UIComponentBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -1,255 +0,0 @@
-package org.jboss.webbeans.test.beans.nonBeans;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-import javax.faces.render.Renderer;
-
-public class UIComponentBean extends UIComponent
-{
-
- @Override
- protected void addFacesListener(FacesListener arg0)
- {
-
- }
-
- @Override
- public void broadcast(FacesEvent arg0) throws AbortProcessingException
- {
-
- }
-
- @Override
- public void decode(FacesContext arg0)
- {
-
- }
-
- @Override
- public void encodeBegin(FacesContext arg0) throws IOException
- {
-
- }
-
- @Override
- public void encodeChildren(FacesContext arg0) throws IOException
- {
-
- }
-
- @Override
- public void encodeEnd(FacesContext arg0) throws IOException
- {
-
- }
-
- @Override
- public UIComponent findComponent(String arg0)
- {
- return null;
- }
-
- @Override
- public Map<String, Object> getAttributes()
- {
- return null;
- }
-
- @Override
- public int getChildCount()
- {
- return 0;
- }
-
- @Override
- public List<UIComponent> getChildren()
- {
- return null;
- }
-
- @Override
- public String getClientId(FacesContext arg0)
- {
- return null;
- }
-
- @Override
- protected FacesContext getFacesContext()
- {
- return null;
- }
-
- @Override
- protected FacesListener[] getFacesListeners(Class arg0)
- {
- return null;
- }
-
- @Override
- public UIComponent getFacet(String arg0)
- {
- return null;
- }
-
- @Override
- public Map<String, UIComponent> getFacets()
- {
- return null;
- }
-
- @Override
- public Iterator<UIComponent> getFacetsAndChildren()
- {
- return null;
- }
-
- @Override
- public String getFamily()
- {
- return null;
- }
-
- @Override
- public String getId()
- {
- return null;
- }
-
- @Override
- public UIComponent getParent()
- {
- return null;
- }
-
- @Override
- protected Renderer getRenderer(FacesContext arg0)
- {
- return null;
- }
-
- @Override
- public String getRendererType()
- {
- return null;
- }
-
- @Override
- public boolean getRendersChildren()
- {
- return false;
- }
-
- @Override
- public ValueBinding getValueBinding(String arg0)
- {
- return null;
- }
-
- @Override
- public boolean isRendered()
- {
- return false;
- }
-
- @Override
- public void processDecodes(FacesContext arg0)
- {
-
- }
-
- @Override
- public void processRestoreState(FacesContext arg0, Object arg1)
- {
-
- }
-
- @Override
- public Object processSaveState(FacesContext arg0)
- {
- return null;
- }
-
- @Override
- public void processUpdates(FacesContext arg0)
- {
-
- }
-
- @Override
- public void processValidators(FacesContext arg0)
- {
-
- }
-
- @Override
- public void queueEvent(FacesEvent arg0)
- {
-
- }
-
- @Override
- protected void removeFacesListener(FacesListener arg0)
- {
-
- }
-
- @Override
- public void setId(String arg0)
- {
-
- }
-
- @Override
- public void setParent(UIComponent arg0)
- {
-
- }
-
- @Override
- public void setRendered(boolean arg0)
- {
-
- }
-
- @Override
- public void setRendererType(String arg0)
- {
-
- }
-
- @Override
- public void setValueBinding(String arg0, ValueBinding arg1)
- {
-
- }
-
- public boolean isTransient()
- {
- return false;
- }
-
- public void restoreState(FacesContext arg0, Object arg1)
- {
-
- }
-
- public Object saveState(FacesContext arg0)
- {
- return null;
- }
-
- public void setTransient(boolean arg0)
- {
-
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java 2009-01-16 19:38:00 UTC (rev 1035)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -27,6 +27,36 @@
public class AbstractTest
{
+ protected abstract static class RunInDependentContext
+ {
+
+ protected void setup()
+ {
+ AbstractTest.activateDependentContext();
+ }
+
+ protected void cleanup()
+ {
+ AbstractTest.deactivateDependentContext();
+ }
+
+ public final void run() throws Exception
+ {
+ try
+ {
+ setup();
+ execute();
+ }
+ finally
+ {
+ cleanup();
+ }
+ }
+
+ protected abstract void execute() throws Exception;
+
+ }
+
private static final List<Class<? extends Annotation>> STANDARD_DEPLOYMENT_TYPES = Collections.unmodifiableList(Arrays.asList(Standard.class, Production.class));
protected static final int BUILT_IN_BEANS = 3;
@@ -92,12 +122,12 @@
return in.readObject();
}
- protected void activateDependentContext()
+ protected static void activateDependentContext()
{
configuration().getContexts().setActive(configuration().getContexts().getDependentContext());
}
- protected void deactivateDependentContext()
+ protected static void deactivateDependentContext()
{
configuration().getContexts().setInactive(configuration().getContexts().getDependentContext());
}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Cow_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Cow_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Cow_Broken.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Production;
+
+@Production
+abstract class Cow_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Cow_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Donkey.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Donkey.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Donkey.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Production;
+
+@Production
+class Donkey
+{
+
+ public static boolean constructedCorrectly = false;
+
+ public Donkey()
+ {
+ constructedCorrectly = true;
+ }
+
+ public Donkey(String foo)
+ {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Donkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Duck.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Duck.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Duck.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,29 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.Produces;
+import javax.webbeans.Production;
+
+
+@Production
+class Duck
+{
+
+ @Produces public static String foo = "foo";
+
+ @Produces public static Integer bar = 1;
+
+ @Produces @Synchronous public static Integer synchronousBar = 2;
+
+ public static boolean constructedCorrectly = false;
+
+ @Initializer
+ public Duck(String foo, @Synchronous Integer bar)
+ {
+ if (foo.equals(Duck.foo) && bar.equals(Duck.synchronousBar))
+ {
+ constructedCorrectly = true;
+ }
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Duck.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/EntityBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/EntityBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/EntityBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+class EntityBean
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goose_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goose_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goose_Broken.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.Production;
+
+@Production
+public class Goose_Broken
+{
+
+ @Initializer
+ public Goose_Broken(String foo)
+ {
+ }
+
+ @Initializer
+ public Goose_Broken(String foo, Double bar)
+ {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goose_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/HeavyDuty.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/HeavyDuty.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/HeavyDuty.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface HeavyDuty
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/HeavyDuty.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockEnterpriseBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockEnterpriseBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockEnterpriseBean.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.ejb.EnterpriseBean;
+
+class MockEnterpriseBean implements EnterpriseBean
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockFilter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockFilter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockFilter.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,30 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+class MockFilter implements Filter
+{
+
+ public void destroy()
+ {
+
+ }
+
+ public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException
+ {
+
+ }
+
+ public void init(FilterConfig arg0) throws ServletException
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockHttpSessionListener.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockHttpSessionListener.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockHttpSessionListener.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.servlet.http.HttpSessionEvent;
+
+class MockHttpSessionListener implements javax.servlet.http.HttpSessionListener
+{
+
+ public void sessionCreated(HttpSessionEvent arg0)
+ {
+
+ }
+
+ public void sessionDestroyed(HttpSessionEvent arg0)
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServlet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServlet.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServlet.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,39 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import java.io.IOException;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+class MockServlet implements Servlet
+{
+
+ public void destroy()
+ {
+
+ }
+
+ public ServletConfig getServletConfig()
+ {
+ return null;
+ }
+
+ public String getServletInfo()
+ {
+ return null;
+ }
+
+ public void init(ServletConfig arg0) throws ServletException
+ {
+
+ }
+
+ public void service(ServletRequest arg0, ServletResponse arg1) throws ServletException, IOException
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServletContextListener.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServletContextListener.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServletContextListener.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+class MockServletContextListener implements ServletContextListener
+{
+
+ public void contextDestroyed(ServletContextEvent arg0)
+ {
+
+ }
+
+ public void contextInitialized(ServletContextEvent arg0)
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServletRequestListener.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServletRequestListener.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockServletRequestListener.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.ServletRequestListener;
+
+class MockServletRequestListener implements ServletRequestListener
+{
+
+ public void requestDestroyed(ServletRequestEvent arg0)
+ {
+
+ }
+
+ public void requestInitialized(ServletRequestEvent arg0)
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockUIComponent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockUIComponent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/MockUIComponent.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,255 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+import javax.faces.render.Renderer;
+
+class MockUIComponent extends UIComponent
+{
+
+ @Override
+ protected void addFacesListener(FacesListener arg0)
+ {
+
+ }
+
+ @Override
+ public void broadcast(FacesEvent arg0) throws AbortProcessingException
+ {
+
+ }
+
+ @Override
+ public void decode(FacesContext arg0)
+ {
+
+ }
+
+ @Override
+ public void encodeBegin(FacesContext arg0) throws IOException
+ {
+
+ }
+
+ @Override
+ public void encodeChildren(FacesContext arg0) throws IOException
+ {
+
+ }
+
+ @Override
+ public void encodeEnd(FacesContext arg0) throws IOException
+ {
+
+ }
+
+ @Override
+ public UIComponent findComponent(String arg0)
+ {
+ return null;
+ }
+
+ @Override
+ public Map<String, Object> getAttributes()
+ {
+ return null;
+ }
+
+ @Override
+ public int getChildCount()
+ {
+ return 0;
+ }
+
+ @Override
+ public List<UIComponent> getChildren()
+ {
+ return null;
+ }
+
+ @Override
+ public String getClientId(FacesContext arg0)
+ {
+ return null;
+ }
+
+ @Override
+ protected FacesContext getFacesContext()
+ {
+ return null;
+ }
+
+ @Override
+ protected FacesListener[] getFacesListeners(Class arg0)
+ {
+ return null;
+ }
+
+ @Override
+ public UIComponent getFacet(String arg0)
+ {
+ return null;
+ }
+
+ @Override
+ public Map<String, UIComponent> getFacets()
+ {
+ return null;
+ }
+
+ @Override
+ public Iterator<UIComponent> getFacetsAndChildren()
+ {
+ return null;
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return null;
+ }
+
+ @Override
+ public String getId()
+ {
+ return null;
+ }
+
+ @Override
+ public UIComponent getParent()
+ {
+ return null;
+ }
+
+ @Override
+ protected Renderer getRenderer(FacesContext arg0)
+ {
+ return null;
+ }
+
+ @Override
+ public String getRendererType()
+ {
+ return null;
+ }
+
+ @Override
+ public boolean getRendersChildren()
+ {
+ return false;
+ }
+
+ @Override
+ public ValueBinding getValueBinding(String arg0)
+ {
+ return null;
+ }
+
+ @Override
+ public boolean isRendered()
+ {
+ return false;
+ }
+
+ @Override
+ public void processDecodes(FacesContext arg0)
+ {
+
+ }
+
+ @Override
+ public void processRestoreState(FacesContext arg0, Object arg1)
+ {
+
+ }
+
+ @Override
+ public Object processSaveState(FacesContext arg0)
+ {
+ return null;
+ }
+
+ @Override
+ public void processUpdates(FacesContext arg0)
+ {
+
+ }
+
+ @Override
+ public void processValidators(FacesContext arg0)
+ {
+
+ }
+
+ @Override
+ public void queueEvent(FacesEvent arg0)
+ {
+
+ }
+
+ @Override
+ protected void removeFacesListener(FacesListener arg0)
+ {
+
+ }
+
+ @Override
+ public void setId(String arg0)
+ {
+
+ }
+
+ @Override
+ public void setParent(UIComponent arg0)
+ {
+
+ }
+
+ @Override
+ public void setRendered(boolean arg0)
+ {
+
+ }
+
+ @Override
+ public void setRendererType(String arg0)
+ {
+
+ }
+
+ @Override
+ public void setValueBinding(String arg0, ValueBinding arg1)
+ {
+
+ }
+
+ public boolean isTransient()
+ {
+ return false;
+ }
+
+ public void restoreState(FacesContext arg0, Object arg1)
+ {
+
+ }
+
+ public Object saveState(FacesContext arg0)
+ {
+ return null;
+ }
+
+ public void setTransient(boolean arg0)
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Modern.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Modern.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Modern.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface Modern
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Modern.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Motorized.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Motorized.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Motorized.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Motorized
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Motorized.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Order.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Order.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Production;
+
+@Production
+class Order
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Order.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/OuterBean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/OuterBean_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/OuterBean_Broken.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Production;
+
+class OuterBean_Broken
+{
+
+ @Production
+ class InnerBean_Broken
+ {
+
+ public InnerBean_Broken()
+ {
+
+ }
+
+ }
+
+ static class StaticInnerBean_Broken
+ {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/OuterBean_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/ParameterizedBean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/ParameterizedBean_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/ParameterizedBean_Broken.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,5 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+class ParameterizedBean_Broken<T>
+{
+
+}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/ParameterizedBean_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Plough.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Plough.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Plough.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Named;
+
+
+@HeavyDuty
+@Named("plough")
+class Plough
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Plough.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Sheep.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Sheep.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Sheep.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,27 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.Produces;
+import javax.webbeans.Production;
+
+@Production
+class Sheep
+{
+
+ public static boolean constructedCorrectly = false;
+
+ @Produces
+ public static String foo = "foo";
+
+ @Produces public static Double bar = 5.5;
+
+ @Initializer
+ public Sheep(String foo, Double bar)
+ {
+ if (foo.equals(Sheep.foo) && bar.equals(Sheep.bar))
+ {
+ constructedCorrectly = true;
+ }
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Sheep.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SimpleBeanModelTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SimpleBeanModelTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SimpleBeanModelTest.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,304 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.DefinitionException;
+import javax.webbeans.NonexistentConstructorException;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.jboss.webbeans.tck.tests.implementation.simple.OuterBean_Broken.InnerBean_Broken;
+import org.jboss.webbeans.tck.tests.implementation.simple.OuterBean_Broken.StaticInnerBean_Broken;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class SimpleBeanModelTest extends AbstractTest
+{
+
+ @Override
+ protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ {
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
+ deploymentTypes.add(AnotherDeploymentType.class);
+ return deploymentTypes;
+ }
+
+ //*** BEAN CLASS CHECKS ****//
+
+ @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2")
+ public void testAbstractClassDeclaredInJavaIsNotAllowed()
+ {
+ createSimpleBean(Cow_Broken.class);
+ }
+
+ @Test(groups="innerClass") @SpecAssertion(section="3.2")
+ public void testStaticInnerClassDeclaredInJavaAllowed()
+ {
+ createSimpleBean(StaticInnerBean_Broken.class);
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups="innerClass") @SpecAssertion(section="3.2")
+ public void testNonStaticInnerClassDeclaredInJavaNotAllowed()
+ {
+ createSimpleBean(InnerBean_Broken.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2")
+ public void testParameterizedClassDeclaredInJavaIsNotAllowed()
+ {
+ createSimpleBean(ParameterizedBean_Broken.class);
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups={"stub", "interceptors", "decorators"}) @SpecAssertion(section="3.2")
+ public void testClassCannotBeInterceptorAndDecorator()
+ {
+
+ }
+
+ @Test(groups="stub")
+ public void testEntitiesNotDiscoveredAsSimpleBeans()
+ {
+ assert false;
+ }
+
+ @Test
+ public void testClassesImplementingServletInterfacesNotDiscoveredAsSimpleBeans()
+ {
+ deployBeans(MockFilter.class, MockHttpSessionListener.class, MockServlet.class, MockServletContextListener.class, MockServletRequestListener.class);
+ assert manager.resolveByType(MockFilter.class).size() == 0;
+ assert manager.resolveByType(MockHttpSessionListener.class).size() == 0;
+ assert manager.resolveByType(MockServlet.class).size() == 0;
+ assert manager.resolveByType(MockServletContextListener.class).size() == 0;
+ assert manager.resolveByType(MockServletRequestListener.class).size() == 0;
+ }
+
+ @Test
+ public void testClassesImplementingEnterpriseBeanInterfaceNotDiscoveredAsSimpleBean()
+ {
+ deployBeans(MockEnterpriseBean.class);
+ assert manager.resolveByType(MockEnterpriseBean.class).size() == 0;
+ }
+
+ @Test
+ public void testClassExtendingUiComponentNotDiscoveredAsSimpleBean()
+ {
+ deployBeans(MockUIComponent.class);
+ assert manager.resolveByType(MockUIComponent.class).size() == 0;
+ }
+
+ @Test(groups="stub")
+ public void testEjbsNotDiscoveredAsSimpleBean()
+ {
+
+ }
+
+ @Test(groups={"stub", "producerMethod", "webbeansxml"}) @SpecAssertion(section="3.2.4")
+ public void testBeanDeclaredInXmlIgnoresProducerMethodDeclaredInJava()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "disposalMethod", "webbeansxml"}) @SpecAssertion(section="3.2.4")
+ public void testBeanDeclaredInXmlIgnoresDisposalMethodDeclaredInJava()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "observerMethod", "webbeansxml"}) @SpecAssertion(section="3.2.4")
+ public void testBeanDeclaredInXmlIgnoresObserverMethodDeclaredInJava()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.4")
+ public void testAbstractClassDeclaredInXmlIsNotAllowed()
+ {
+
+ }
+
+ @Test(groups={"stub", "innerClass", "webbeansxml"}) @SpecAssertion(section="3.2.4")
+ public void testStaticInnerClassDeclaredInXmlAllowed()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups={"stub", "innerClass", "webbeansxml"}) @SpecAssertion(section="3.2.4")
+ public void testNonStaticInnerClassDeclaredInXmlNotAllowed()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.4")
+ public void testParameterizedClassDeclaredInXmlIsNotAllowed()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups={"stub", "interceptors"}) @SpecAssertion(section="3.2.4")
+ public void testClassHasInterceptorInJavaMustHaveInterceptorInXml()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups={"stub", "interceptors"}) @SpecAssertion(section="3.2.4")
+ public void testClassHasDecoratorInJavaMustHaveDecoratorInXml()
+ {
+ assert false;
+ }
+
+ @Test @SpecAssertion(section="3.2.5.1")
+ public void testInitializerAnnotatedConstructor() throws Exception
+ {
+ deployBeans(Sheep.class);
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Sheep.class);
+ assert Sheep.constructedCorrectly;
+
+ }
+ }.run();
+
+ }
+
+ @Test @SpecAssertion(section="3.2.5.1")
+ public void testImplicitConstructorUsed()
+ {
+ Bean<Order> order = createSimpleBean(Order.class);
+ // TODO Test this properly!
+ }
+
+ @Test @SpecAssertion(section="3.2.5.1")
+ public void testEmptyConstructorUsed()
+ {
+ createSimpleBean(Donkey.class).create();
+ assert Donkey.constructedCorrectly;
+ }
+
+ @Test @SpecAssertion(section="3.2.5.1")
+ public void testInitializerAnnotatedConstructorUsedOverEmptyConstuctor() throws Exception
+ {
+ deployBeans(Turkey.class);
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Turkey.class);
+ assert Turkey.constructedCorrectly;
+ }
+ }.run();
+ }
+
+ @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2.5.1")
+ public void testTooManyInitializerAnnotatedConstructor()
+ {
+ createSimpleBean(Goose_Broken.class);
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups={"stub", "disposalMethod"}) @SpecAssertion(section="3.2.5.1")
+ public void testConstructorHasDisposesParameter()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions=DefinitionException.class, groups={"stub", "observerMethod"}) @SpecAssertion(section="3.2.5.1")
+ public void testConstructorHasObservesParameter()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
+ public void testImplicitConstructorDeclaredInXmlUsed()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
+ public void testEmptyConstructorDeclaredInXmlUsed()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions=NonexistentConstructorException.class, groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
+ public void testConstructorDeclaredInXmlDoesNotExist()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
+ public void testConstructorDeclaredInXmlIgnoresBindingTypesDeclaredInJava()
+ {
+ assert false;
+ }
+
+ @Test @SpecAssertion(section="3.2.5.3")
+ public void testBindingTypeAnnotatedConstructor() throws Exception
+ {
+ deployBeans(Duck.class);
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Duck.class);
+ assert Duck.constructedCorrectly;
+ }
+ }.run();
+ }
+
+ @Test(groups="specializationInherit") @SpecAssertion(section="3.2.6")
+ public void testSpecializedClassInheritsBindingTypes()
+ {
+ Bean<Tractor> bean = createSimpleBean(Tractor.class);
+ assert bean.getBindings().size()==2;
+ assert bean.getBindings().contains( new AnnotationLiteral<Motorized>() {} );
+ assert bean.getBindings().contains( new AnnotationLiteral<HeavyDuty>() {} );
+ }
+
+ @Test(groups="specializationInherit") @SpecAssertion(section="3.2.6")
+ public void testSpecializedClassInheritsName()
+ {
+ Bean<Tractor> bean = createSimpleBean(Tractor.class);
+ assert bean.getName()!=null;
+ assert bean.getName().equals("plough");
+ }
+
+ @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.2.6")
+ public void testLessSpecializedClassNotInstantiated()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "specialization"},expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2.6")
+ public void testSpecializedClassMustExtendAnotherWebBean()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.2.6")
+ public void testSpecializedClassDeclaredInXmlInheritsBindingTypes()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.2.6")
+ public void testSpecializedClassDeclaredInXmlInheritsName()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.2.6")
+ public void testLessSpecializedClassDeclaredInXmlNotInstantiated()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Synchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Synchronous.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Synchronous.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Synchronous
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Synchronous.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SynchronousAnnotationLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SynchronousAnnotationLiteral.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SynchronousAnnotationLiteral.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.AnnotationLiteral;
+
+class SynchronousAnnotationLiteral extends AnnotationLiteral<Synchronous> implements Synchronous
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SynchronousAnnotationLiteral.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tractor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tractor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tractor.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Specializes;
+
+@Modern @Motorized @Specializes
+class Tractor extends Plough
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tractor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Turkey.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Turkey.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Turkey.java 2009-01-16 20:28:23 UTC (rev 1036)
@@ -0,0 +1,31 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.Produces;
+import javax.webbeans.Production;
+
+@Production
+class Turkey
+{
+
+ @Produces public static String foo = "foo";
+
+ @Produces static Integer bar = 1;
+
+ public static boolean constructedCorrectly = false;
+
+ public Turkey()
+ {
+
+ }
+
+ @Initializer
+ public Turkey(String foo, Integer bar)
+ {
+ if (foo.equals(Turkey.foo) && bar.equals(Turkey.bar))
+ {
+ constructedCorrectly = true;
+ }
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Turkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
[webbeans-commits] Webbeans SVN: r1035 - tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-16 14:38:00 -0500 (Fri, 16 Jan 2009)
New Revision: 1035
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Animal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Farm.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FarmOffice.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishPond.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goldfish.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RedSnapper.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RequestScopedAnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tuna.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/TunaFarm.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/inheritance/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/inheritance/specialization/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/inheritance/specialization/SpecializationTest.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SpecializationTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/scope/RedSnapper.java
Log:
Port specialization and simple bean tests
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java 2009-01-16 19:26:29 UTC (rev 1034)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -1,109 +0,0 @@
-package org.jboss.webbeans.test;
-
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.test.beans.Farm;
-import org.jboss.webbeans.test.beans.FarmOffice;
-import org.jboss.webbeans.test.beans.FishPond;
-import org.jboss.webbeans.test.beans.Goldfish;
-import org.jboss.webbeans.test.beans.RedSnapper;
-import org.jboss.webbeans.test.beans.Tuna;
-import org.jboss.webbeans.test.beans.TunaFarm;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class SimpleBeanLifecycleTest extends AbstractTest
-{
-
- @Test(groups="beanConstruction") @SpecAssertion(section="3.1.3")
- public void testInjectionOfParametersIntoBeanConstructor()
- {
- Bean<FishPond> goldfishPondBean = SimpleBean.of(FishPond.class, manager);
- Bean<Goldfish> goldfishBean = SimpleBean.of(Goldfish.class, manager);
- manager.addBean(goldfishBean);
- manager.addBean(goldfishPondBean);
- FishPond fishPond = goldfishPondBean.create();
- assert fishPond.goldfish != null;
- }
-
- @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.1.4")
- public void testSpecializedBeanAlwaysUsed()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="beanLifecycle") @SpecAssertion(section="5.3")
- public void testCreateReturnsInstanceOfBean()
- {
- Bean<RedSnapper> bean = SimpleBean.of(RedSnapper.class, manager);
- assert bean.create() instanceof RedSnapper;
- }
-
- @Test(groups={"stub", "beanLifecycle", "interceptors"}) @SpecAssertion(section="5.3")
- public void testCreateBindsInterceptorStack()
- {
- assert false;
- }
-
- @Test(groups={"stub", "beanLifecycle", "decorators"}) @SpecAssertion(section="5.3")
- public void testCreateBindsDecoratorStack()
- {
- assert false;
- }
-
- @Test(groups={"stub", "beanLifecycle", "commonAnnotations"}) @SpecAssertion(section="5.3")
- public void testCreateInjectsEjb()
- {
- assert false;
- }
-
- @Test(groups={"stub", "beanLifecycle", "commonAnnotations"}) @SpecAssertion(section="5.3")
- public void testCreateInjectsPersistenceContext()
- {
- assert false;
- }
-
- @Test(groups={"stub", "beanLifecycle", "commonAnnotations"}) @SpecAssertion(section="5.3")
- public void testCreateInjectsResource()
- {
- assert false;
- }
-
- @Test(groups={"beanLifecycle", "lifecycleCallbacks"}) @SpecAssertion(section="5.3")
- public void testPostConstructPreDestroy() throws Exception
- {
- Bean<FarmOffice> farmOfficeBean = SimpleBean.of(FarmOffice.class, manager);
- Bean<Farm> farmBean = SimpleBean.of(Farm.class, manager);
- manager.addBean(farmOfficeBean);
- manager.addBean(farmBean);
- Farm farm = farmBean.create();
- assert farm.founded!=null;
- assert farm.initialStaff==20;
- assert farm.closed==null;
- farmBean.destroy(farm);
- assert farm.closed!=null;
- }
-
- @Test(groups="injection") @SpecAssertion(section="5.3")
- public void testCreateInjectsFieldsDeclaredInJava()
- {
- SimpleBean<TunaFarm> tunaFarmBean = SimpleBean.of(TunaFarm.class, manager);
- Bean<Tuna> tunaBean = SimpleBean.of(Tuna.class, manager);
- manager.addBean(tunaBean);
- TunaFarm tunaFarm = tunaFarmBean.create();
- assert tunaFarm.tuna != null;
- }
-
- @Test(groups="injection")
- public void testFieldMissingBindingAnnotationsAreNotInjected()
- {
- SimpleBean<TunaFarm> tunaFarmBean = SimpleBean.of(TunaFarm.class, manager);
- Bean<Tuna> tunaBean = SimpleBean.of(Tuna.class, manager);
- manager.addBean(tunaBean);
- TunaFarm tunaFarm = tunaFarmBean.create();
- assert tunaFarm.notInjectedTuna != manager.getInstance(tunaBean);
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SpecializationTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SpecializationTest.java 2009-01-16 19:26:29 UTC (rev 1034)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SpecializationTest.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test;
-
-import javax.webbeans.InconsistentSpecializationException;
-
-import org.testng.annotations.Test;
-
-public class SpecializationTest
-{
-
- @Test(expectedExceptions=InconsistentSpecializationException.class, groups={"stub", "specialization"})
- public void testInconsistentSpecialization()
- {
-
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/scope/RedSnapper.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/scope/RedSnapper.java 2009-01-16 19:26:29 UTC (rev 1034)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/scope/RedSnapper.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -4,7 +4,7 @@
@FishStereotype
@RequestScoped
-public class RedSnapper implements Animal
+class RedSnapper implements Animal
{
}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Animal.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+interface Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Animal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnotherDeploymentType.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Farm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Farm.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Farm.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.webbeans.Current;
+
+class Farm
+{
+
+ public Date founded;
+ public Date closed;
+ public int initialStaff;
+
+ @Current
+ FarmOffice farmOffice;
+
+ @PostConstruct
+ private void postConstruct()
+ {
+ founded = new Date();
+ initialStaff = farmOffice.noOfStaff;
+ }
+
+ @PreDestroy
+ private void preDestroy()
+ {
+ closed = new Date();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Farm.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FarmOffice.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FarmOffice.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FarmOffice.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+
+class FarmOffice
+{
+
+ public int noOfStaff = 20;
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FarmOffice.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishPond.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishPond.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishPond.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Initializer;
+
+class FishPond
+{
+
+ public Animal goldfish;
+
+ @Initializer
+ public FishPond(Goldfish goldfish)
+ {
+ this.goldfish = goldfish;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishPond.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishStereotype.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.Named;
+import javax.webbeans.Stereotype;
+
+(a)Stereotype(requiredTypes=Animal.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@ApplicationScoped
+@Named
+@interface FishStereotype
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/FishStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goldfish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goldfish.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goldfish.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+@RequestScopedAnimalStereotype
+@RequestScoped
+@Production
+class Goldfish implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Goldfish.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RedSnapper.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RedSnapper.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RedSnapper.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.RequestScoped;
+
+@FishStereotype
+@RequestScoped
+class RedSnapper implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RedSnapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RequestScopedAnimalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RequestScopedAnimalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RequestScopedAnimalStereotype.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.RequestScoped;
+import javax.webbeans.Stereotype;
+
+(a)Stereotype(requiredTypes=Animal.class, supportedScopes=RequestScoped.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@interface RequestScopedAnimalStereotype
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/RequestScopedAnimalStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SimpleBeanLifecycleTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/SimpleBeanLifecycleTest.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,115 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class SimpleBeanLifecycleTest extends AbstractTest
+{
+
+ @Override
+ protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ {
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
+ deploymentTypes.add(AnotherDeploymentType.class);
+ return deploymentTypes;
+ }
+
+ @Test(groups="beanConstruction") @SpecAssertion(section="3.1.3")
+ public void testInjectionOfParametersIntoBeanConstructor()
+ {
+ Bean<FishPond> goldfishPondBean = createSimpleBean(FishPond.class);
+ Bean<Goldfish> goldfishBean = createSimpleBean(Goldfish.class);
+ manager.addBean(goldfishBean);
+ manager.addBean(goldfishPondBean);
+ FishPond fishPond = goldfishPondBean.create();
+ assert fishPond.goldfish != null;
+ }
+
+ @Test(groups={"stub", "specialization"}) @SpecAssertion(section="3.1.4")
+ public void testSpecializedBeanAlwaysUsed()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="beanLifecycle") @SpecAssertion(section="5.3")
+ public void testCreateReturnsInstanceOfBean()
+ {
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
+ assert bean.create() instanceof RedSnapper;
+ }
+
+ @Test(groups={"stub", "beanLifecycle", "interceptors"}) @SpecAssertion(section="5.3")
+ public void testCreateBindsInterceptorStack()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "beanLifecycle", "decorators"}) @SpecAssertion(section="5.3")
+ public void testCreateBindsDecoratorStack()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "beanLifecycle", "commonAnnotations"}) @SpecAssertion(section="5.3")
+ public void testCreateInjectsEjb()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "beanLifecycle", "commonAnnotations"}) @SpecAssertion(section="5.3")
+ public void testCreateInjectsPersistenceContext()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "beanLifecycle", "commonAnnotations"}) @SpecAssertion(section="5.3")
+ public void testCreateInjectsResource()
+ {
+ assert false;
+ }
+
+ @Test(groups={"beanLifecycle", "lifecycleCallbacks"}) @SpecAssertion(section="5.3")
+ public void testPostConstructPreDestroy() throws Exception
+ {
+ Bean<FarmOffice> farmOfficeBean = createSimpleBean(FarmOffice.class);
+ Bean<Farm> farmBean = createSimpleBean(Farm.class);
+ manager.addBean(farmOfficeBean);
+ manager.addBean(farmBean);
+ Farm farm = farmBean.create();
+ assert farm.founded!=null;
+ assert farm.initialStaff==20;
+ assert farm.closed==null;
+ farmBean.destroy(farm);
+ assert farm.closed!=null;
+ }
+
+ @Test(groups="injection") @SpecAssertion(section="5.3")
+ public void testCreateInjectsFieldsDeclaredInJava()
+ {
+ Bean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ manager.addBean(tunaBean);
+ TunaFarm tunaFarm = tunaFarmBean.create();
+ assert tunaFarm.tuna != null;
+ }
+
+ @Test(groups="injection")
+ public void testFieldMissingBindingAnnotationsAreNotInjected()
+ {
+ Bean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ manager.addBean(tunaBean);
+ TunaFarm tunaFarm = tunaFarmBean.create();
+ assert tunaFarm.notInjectedTuna != manager.getInstance(tunaBean);
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tuna.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tuna.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tuna.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.RequestScoped;
+
+@AnotherDeploymentType
+@RequestScoped
+class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/Tuna.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/TunaFarm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/TunaFarm.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/TunaFarm.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.tck.tests.implementation.simple;
+
+import javax.webbeans.Current;
+import javax.webbeans.Production;
+
+@Production
+class TunaFarm
+{
+
+ @SuppressWarnings("unused")
+ @Current
+ public Tuna tuna;
+
+ public Tuna notInjectedTuna = new Tuna();
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/simple/TunaFarm.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/inheritance/specialization/SpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/inheritance/specialization/SpecializationTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/inheritance/specialization/SpecializationTest.java 2009-01-16 19:38:00 UTC (rev 1035)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.tests.inheritance.specialization;
+
+import javax.webbeans.InconsistentSpecializationException;
+
+import org.testng.annotations.Test;
+
+public class SpecializationTest
+{
+
+ @Test(expectedExceptions=InconsistentSpecializationException.class, groups={"stub", "specialization"})
+ public void testInconsistentSpecialization()
+ {
+
+ }
+
+}
17 years, 3 months
[webbeans-commits] Webbeans SVN: r1034 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-16 14:26:29 -0500 (Fri, 16 Jan 2009)
New Revision: 1034
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/ResolutionByTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/AnimalFarmer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMember_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMember_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ChunkyLiteral.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DaddyLongLegs.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlyAnimal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlySpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Expensive.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ExpensiveLiteral.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Farmer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Haddock.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Halibut.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/LadybirdSpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Plaice.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ResolutionByTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/RoundWhitefish.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ScottishFishFarmer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SeaBass.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Spider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Tarantula.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
Log:
port resolution by type tests
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2009-01-16 18:58:14 UTC (rev 1033)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -1,333 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.lang.reflect.Method;
-import java.util.Set;
-
-import javax.webbeans.AnnotationLiteral;
-import javax.webbeans.DefinitionException;
-import javax.webbeans.DuplicateBindingTypeException;
-import javax.webbeans.TypeLiteral;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.bean.ProducerMethodBean;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.binding.CurrentBinding;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedField;
-import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
-import org.jboss.webbeans.introspector.jlr.AnnotatedFieldImpl;
-import org.jboss.webbeans.test.annotations.Expensive;
-import org.jboss.webbeans.test.annotations.Whitefish;
-import org.jboss.webbeans.test.beans.Animal;
-import org.jboss.webbeans.test.beans.AnimalFarmer;
-import org.jboss.webbeans.test.beans.Cod;
-import org.jboss.webbeans.test.beans.Farmer;
-import org.jboss.webbeans.test.beans.FishFarm;
-import org.jboss.webbeans.test.beans.Haddock;
-import org.jboss.webbeans.test.beans.Halibut;
-import org.jboss.webbeans.test.beans.Plaice;
-import org.jboss.webbeans.test.beans.RoundWhitefish;
-import org.jboss.webbeans.test.beans.Salmon;
-import org.jboss.webbeans.test.beans.ScottishFish;
-import org.jboss.webbeans.test.beans.ScottishFishFarmer;
-import org.jboss.webbeans.test.beans.SeaBass;
-import org.jboss.webbeans.test.beans.Sole;
-import org.jboss.webbeans.test.beans.Spider;
-import org.jboss.webbeans.test.beans.SpiderProducer;
-import org.jboss.webbeans.test.beans.Tuna;
-import org.jboss.webbeans.test.beans.broken.ParameterizedBean;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.BindingTypeWithBindingAnnotationMemberAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.BindingTypeWithBindingArrayTypeMemberAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.ChunkyAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.ExpensiveAnnotationLiteral;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class ResolutionByTypeTest extends AbstractTest
-{
-
- private AnnotatedClass<FishFarm> fishFarmClass = new AnnotatedClassImpl<FishFarm>(FishFarm.class);
-
- @Test(groups="resolution")
- public void testAnnotatedField() throws Exception
- {
- AnnotatedField<Tuna> tuna = new AnnotatedFieldImpl<Tuna>(FishFarm.class.getDeclaredField("tuna"), fishFarmClass);
- assert tuna.getType().isAssignableFrom(Tuna.class);
- assert tuna.getBindingTypes().size() == 1;
- assert tuna.getBindingTypes().contains(new CurrentBinding());
- assert tuna.getType().isAssignableFrom(Tuna.class);
- }
-
- @Test(groups="resolution") @SpecAssertion(section="5.9.2")
- public void testDefaultBindingTypeAssumed() throws Exception
- {
- AnnotatedField<Tuna> tunaField = new AnnotatedFieldImpl<Tuna>(FishFarm.class.getDeclaredField("tuna"), fishFarmClass);
- Bean<Tuna> tunaBean = SimpleBean.of(Tuna.class, manager);
- manager.addBean(tunaBean);
- Set<Bean<Tuna>> possibleTargets = manager.resolveByType(tunaField);
- assert possibleTargets.size() == 1;
- assert possibleTargets.contains(tunaBean);
- }
-
- @Test(groups="resolution", expectedExceptions=IllegalArgumentException.class) @SpecAssertion(section="5.9")
- public void testParameterizedTypeWithWildcardParameter()
- {
- manager.resolveByType(new TypeLiteral<ParameterizedBean<?>>(){});
- }
-
- @Test(groups="resolution", expectedExceptions=IllegalArgumentException.class) @SpecAssertion(section="5.9")
- public <T> void testParameterizedTypeWithTypeParameter()
- {
- manager.resolveByType(new TypeLiteral<ParameterizedBean<T>>(){});
- }
-
- @Test(groups="resolution", expectedExceptions=DuplicateBindingTypeException.class) @SpecAssertion(section="5.9.2")
- public void testDuplicateBindingTypesUsed()
- {
- manager.resolveByType(Tuna.class, new CurrentBinding(), new CurrentBinding());
- }
-
- @Test(groups="resolution", expectedExceptions=IllegalArgumentException.class) @SpecAssertion(section="5.9.2")
- public void testNonBindingTypeUsed()
- {
- manager.resolveByType(Tuna.class, new AnotherDeploymentTypeAnnotationLiteral());
- }
-
- @Test
- public void testOneBindingType() throws Exception
- {
- AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
- Bean<Cod> codBean = SimpleBean.of(Cod.class, manager);
- Bean<Salmon> salmonBean = SimpleBean.of(Salmon.class, manager);
- Bean<Sole> soleBean = SimpleBean.of(Sole.class, manager);
- manager.addBean(codBean);
- manager.addBean(salmonBean);
- manager.addBean(soleBean);
- Set<Bean<ScottishFish>> possibleTargets = manager.resolveByType(whiteScottishFishField);
- assert possibleTargets.size() == 2;
- assert possibleTargets.contains(codBean);
- assert possibleTargets.contains(soleBean);
- }
-
- @Test
- public void testABindingType() throws Exception
- {
- AnnotatedField<Animal> whiteChunkyFishField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"), fishFarmClass);
-
- Bean<Cod> codBean = SimpleBean.of(Cod.class, manager);
- Bean<Salmon> salmonBean = SimpleBean.of(Salmon.class, manager);
- Bean<Sole> soleBean = SimpleBean.of(Sole.class, manager);
-
- manager.addBean(codBean);
- manager.addBean(salmonBean);
- manager.addBean(soleBean);
- Set<Bean<Animal>> possibleTargets = manager.resolveByType(whiteChunkyFishField);
- assert possibleTargets.size() == 1;
- assert possibleTargets.contains(codBean);
- }
-
- @Test
- public void testMultipleApiTypeWithCurrent() throws Exception
- {
- AnnotatedField<Animal> animalField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("animal"), fishFarmClass);
- Bean<SeaBass> seaBassBean = SimpleBean.of(SeaBass.class, manager);
- Bean<Haddock> haddockBean = SimpleBean.of(Haddock.class, manager);
- manager.addBean(seaBassBean);
- manager.addBean(haddockBean);
- Set<Bean<Animal>> possibleTargets = manager.resolveByType(animalField);
- assert possibleTargets.size() == 2;
- assert possibleTargets.contains(seaBassBean);
- assert possibleTargets.contains(haddockBean);
- }
-
- @Test(groups="resolution") @SpecAssertion(section={"5.9.2"})
- public void testResolveByType() throws Exception
- {
- Bean<Tuna> tunaBean = SimpleBean.of(Tuna.class, manager);
- Bean<Salmon> salmonBean = SimpleBean.of(Salmon.class, manager);
- Bean<SeaBass> seaBassBean = SimpleBean.of(SeaBass.class, manager);
- Bean<Haddock> haddockBean = SimpleBean.of(Haddock.class, manager);
-
- manager.addBean(tunaBean);
- manager.addBean(salmonBean);
- manager.addBean(haddockBean);
- manager.addBean(seaBassBean);
-
- assert manager.resolveByType(Tuna.class, new CurrentBinding()).size() == 1;
- assert manager.resolveByType(Tuna.class, new CurrentBinding()).contains(tunaBean);
-
- assert manager.resolveByType(Tuna.class).size() == 1;
- assert manager.resolveByType(Tuna.class).contains(tunaBean);
-
- assert manager.resolveByType(Animal.class, new CurrentBinding()).size() == 3;
- assert manager.resolveByType(Animal.class, new CurrentBinding()).contains(salmonBean);
- assert manager.resolveByType(Animal.class, new CurrentBinding()).contains(seaBassBean);
- assert manager.resolveByType(Animal.class, new CurrentBinding()).contains(haddockBean);
- }
-
- @Test(groups="injection") @SpecAssertion(section={"2.3.5","5.9.2.2"})
- public void testAllBindingTypesSpecifiedForResolutionMustAppearOnWebBean()
- {
- Bean<Cod> codBean = SimpleBean.of(Cod.class, manager);
- Bean<Salmon> salmonBean = SimpleBean.of(Salmon.class, manager);
- Bean<Sole> soleBean = SimpleBean.of(Sole.class, manager);
-
- manager.addBean(codBean);
- manager.addBean(salmonBean);
- manager.addBean(soleBean);
-
- assert manager.resolveByType(Animal.class, new ChunkyAnnotationLiteral() {
-
- public boolean realChunky()
- {
- return true;
- }
-
- }, new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert manager.resolveByType(Animal.class, new ChunkyAnnotationLiteral() {
-
- public boolean realChunky()
- {
- return true;
- }
-
- }, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
-
- assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).size() == 2;
- assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
- assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(soleBean);
- }
-
- @Test(groups="resolution") @SpecAssertion(section="5.9.2")
- public void testResolveByTypeWithTypeParameter() throws Exception
- {
- AnnotatedField<Farmer<ScottishFish>> scottishFishFarmerField = new AnnotatedFieldImpl<Farmer<ScottishFish>>(FishFarm.class.getDeclaredField("scottishFishFarmer"), fishFarmClass);
-
- Bean<ScottishFishFarmer> scottishFishFarmerBean = SimpleBean.of(ScottishFishFarmer.class, manager);
- Bean<AnimalFarmer> farmerBean = SimpleBean.of(AnimalFarmer.class, manager);
-
- manager.addBean(scottishFishFarmerBean);
- manager.addBean(farmerBean);
-
- assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
- assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).contains(scottishFishFarmerBean);
- }
-
- @Test(groups={"resolution", "producerMethod"}) @SpecAssertion(section="5.9.2")
- public void testResolveByTypeWithArray() throws Exception
- {
- SimpleBean<SpiderProducer> spiderProducerBean = SimpleBean.of(SpiderProducer.class, manager);
- manager.addBean(spiderProducerBean);
- Method method = SpiderProducer.class.getMethod("getSpiders");
- Bean<Spider[]> spidersModel = ProducerMethodBean.of(method, spiderProducerBean, manager);
- manager.addBean(spidersModel);
- method = SpiderProducer.class.getMethod("getStrings");
- Bean<String[]> stringModel = ProducerMethodBean.of(method, spiderProducerBean, manager);
- manager.addBean(stringModel);
-
- assert manager.resolveByType(Spider[].class).size() == 1;
- }
-
- @Test @SpecAssertion(section="5.9.2")
- public void testOnlyHighestEnabledPreecedenceWebBeansResolved() throws Exception
- {
- AnnotatedField<Animal> whiteFishField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("whiteFish"), fishFarmClass);
- Bean<Cod> codBean = SimpleBean.of(Cod.class, manager);
- Bean<Sole> soleBean = SimpleBean.of(Sole.class, manager);
- Bean<Plaice> plaiceBean = SimpleBean.of(Plaice.class, manager);
-
-
- manager.addBean(plaiceBean);
- manager.addBean(codBean);
- manager.addBean(soleBean);
-
- assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).contains(plaiceBean);
-
- }
-
-
- @Test(groups="resolution") @SpecAssertion(section="5.9.2")
- public void testNoWebBeansFound() throws Exception
- {
- AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
- Bean<Salmon> salmonBean = SimpleBean.of(Salmon.class, manager);
- Bean<Sole> soleBean = SimpleBean.of(Sole.class, manager);
- Bean<Plaice> plaiceBean = SimpleBean.of(Plaice.class, manager);
- manager.addBean(plaiceBean);
- manager.addBean(salmonBean);
- manager.addBean(soleBean);
-
- assert manager.resolveByType(Tuna.class, new CurrentBinding()).size() == 0;
- }
-
- @Test(groups="resolution") @SpecAssertion(section="5.9.2.1")
- public void testResolveByTypeWithNonBindingMembers() throws Exception
- {
- AnnotatedField<Animal> veryExpensiveWhitefishField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("veryExpensiveWhitefish"), fishFarmClass);
- Bean<Halibut> halibutBean = SimpleBean.of(Halibut.class, manager);
- Bean<RoundWhitefish> roundWhiteFishBean = SimpleBean.of(RoundWhitefish.class, manager);
- Bean<Sole> soleBean = SimpleBean.of(Sole.class, manager);
- manager.addBean(halibutBean);
- manager.addBean(roundWhiteFishBean);
- manager.addBean(soleBean);
-
- Set<Bean<Animal>> beans = manager.resolveByType(Animal.class, new ExpensiveAnnotationLiteral()
- {
-
- public int cost()
- {
- return 60;
- }
-
- public boolean veryExpensive()
- {
- return true;
- }
-
- }, new AnnotationLiteral<Whitefish>() {});
- assert beans.size() == 2;
- assert beans.contains(halibutBean);
- assert beans.contains(roundWhiteFishBean);
- }
-
- @Test(groups="resolution", expectedExceptions=DefinitionException.class) @SpecAssertion(section="5.9.2.1")
- public void testArrayValuedAnnotationMemberWithoutNonBinding()
- {
- manager.resolveByType(Animal.class, new BindingTypeWithBindingArrayTypeMemberAnnotationLiteral() {
-
- public boolean[] bool()
- {
- return new boolean[0];
- }
-
- });
- }
-
- @Test(groups="resolution", expectedExceptions=DefinitionException.class) @SpecAssertion(section="5.9.2.1")
- public void testAnnotationValuedAnnotationMemberWithoutNonBinding()
- {
- manager.resolveByType(Animal.class, new BindingTypeWithBindingAnnotationMemberAnnotationLiteral()
- {
-
- public Expensive expensive()
- {
- return new ExpensiveAnnotationLiteral()
- {
- public int cost()
- {
- return 0;
- }
-
- public boolean veryExpensive()
- {
- return false;
- }
- };
- }
-
- });
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/ResolutionByTypeTest.java (from rev 1030, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/ResolutionByTypeTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/ResolutionByTypeTest.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,89 @@
+package org.jboss.webbeans.test.unit;
+
+import java.util.Set;
+
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.binding.CurrentBinding;
+import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.AnnotatedField;
+import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
+import org.jboss.webbeans.introspector.jlr.AnnotatedFieldImpl;
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecVersion;
+import org.jboss.webbeans.test.beans.Animal;
+import org.jboss.webbeans.test.beans.Cod;
+import org.jboss.webbeans.test.beans.FishFarm;
+import org.jboss.webbeans.test.beans.Haddock;
+import org.jboss.webbeans.test.beans.Salmon;
+import org.jboss.webbeans.test.beans.ScottishFish;
+import org.jboss.webbeans.test.beans.SeaBass;
+import org.jboss.webbeans.test.beans.Sole;
+import org.jboss.webbeans.test.beans.Tuna;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class ResolutionByTypeTest extends AbstractTest
+{
+
+ private AnnotatedClass<FishFarm> fishFarmClass = new AnnotatedClassImpl<FishFarm>(FishFarm.class);
+
+ @Test(groups="resolution")
+ public void testAnnotatedField() throws Exception
+ {
+ AnnotatedField<Tuna> tuna = new AnnotatedFieldImpl<Tuna>(FishFarm.class.getDeclaredField("tuna"), fishFarmClass);
+ assert tuna.getType().isAssignableFrom(Tuna.class);
+ assert tuna.getBindingTypes().size() == 1;
+ assert tuna.getBindingTypes().contains(new CurrentBinding());
+ assert tuna.getType().isAssignableFrom(Tuna.class);
+ }
+
+ @Test
+ public void testOneBindingType() throws Exception
+ {
+ AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
+ Bean<Cod> codBean = SimpleBean.of(Cod.class, manager);
+ Bean<Salmon> salmonBean = SimpleBean.of(Salmon.class, manager);
+ Bean<Sole> soleBean = SimpleBean.of(Sole.class, manager);
+ manager.addBean(codBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+ Set<Bean<ScottishFish>> possibleTargets = manager.resolveByType(whiteScottishFishField);
+ assert possibleTargets.size() == 2;
+ assert possibleTargets.contains(codBean);
+ assert possibleTargets.contains(soleBean);
+ }
+
+ @Test
+ public void testABindingType() throws Exception
+ {
+ AnnotatedField<Animal> whiteChunkyFishField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"), fishFarmClass);
+
+ Bean<Cod> codBean = SimpleBean.of(Cod.class, manager);
+ Bean<Salmon> salmonBean = SimpleBean.of(Salmon.class, manager);
+ Bean<Sole> soleBean = SimpleBean.of(Sole.class, manager);
+
+ manager.addBean(codBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+ Set<Bean<Animal>> possibleTargets = manager.resolveByType(whiteChunkyFishField);
+ assert possibleTargets.size() == 1;
+ assert possibleTargets.contains(codBean);
+ }
+
+ @Test
+ public void testMultipleApiTypeWithCurrent() throws Exception
+ {
+ AnnotatedField<Animal> animalField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("animal"), fishFarmClass);
+ Bean<SeaBass> seaBassBean = SimpleBean.of(SeaBass.class, manager);
+ Bean<Haddock> haddockBean = SimpleBean.of(Haddock.class, manager);
+ manager.addBean(seaBassBean);
+ manager.addBean(haddockBean);
+ Set<Bean<Animal>> possibleTargets = manager.resolveByType(animalField);
+ assert possibleTargets.size() == 2;
+ assert possibleTargets.contains(seaBassBean);
+ assert possibleTargets.contains(haddockBean);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/ResolutionByTypeTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/AnimalFarmer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/AnimalFarmer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/AnimalFarmer.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+class AnimalFarmer extends Farmer<Animal>
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/AnimalFarmer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.AnnotationLiteral;
+
+abstract class BindingTypeWithBindingAnnotationMemberLiteral_Broken extends AnnotationLiteral<BindingTypeWithBindingAnnotationMember_Broken> implements BindingTypeWithBindingAnnotationMember_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMember_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMember_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMember_Broken.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface BindingTypeWithBindingAnnotationMember_Broken
+{
+
+ Expensive expensive();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingAnnotationMember_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.AnnotationLiteral;
+
+abstract class BindingTypeWithBindingArrayTypeMemberLiteral_Broken extends AnnotationLiteral<BindingTypeWithBindingArrayTypeMember_Broken> implements BindingTypeWithBindingArrayTypeMember_Broken
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMember_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMember_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMember_Broken.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface BindingTypeWithBindingArrayTypeMember_Broken
+{
+
+ boolean[] bool();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/BindingTypeWithBindingArrayTypeMember_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ChunkyLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ChunkyLiteral.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ChunkyLiteral.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.AnnotationLiteral;
+
+abstract class ChunkyLiteral extends AnnotationLiteral<Chunky> implements Chunky
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ChunkyLiteral.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DaddyLongLegs.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DaddyLongLegs.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DaddyLongLegs.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+class DaddyLongLegs extends Spider
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DaddyLongLegs.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlyAnimal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlyAnimal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlyAnimal.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+interface DeadlyAnimal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlyAnimal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlySpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlySpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlySpider.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/DeadlySpider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Expensive.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Expensive.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Expensive.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,28 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+import javax.webbeans.NonBinding;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Expensive
+{
+
+ boolean veryExpensive();
+
+ @NonBinding
+ int cost();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Expensive.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ExpensiveLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ExpensiveLiteral.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ExpensiveLiteral.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.AnnotationLiteral;
+
+abstract class ExpensiveLiteral extends AnnotationLiteral<Expensive> implements Expensive
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ExpensiveLiteral.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Farmer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Farmer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Farmer.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.Production;
+
+@Production
+class Farmer<T>
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Farmer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Haddock.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Haddock.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Haddock.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+@Production
+@Named
+class Haddock implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Haddock.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Halibut.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Halibut.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Halibut.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+
+@Expensive(cost=50, veryExpensive=true)
+@Whitefish
+class Halibut implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Halibut.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/LadybirdSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/LadybirdSpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/LadybirdSpider.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.ApplicationScoped;
+
+@ApplicationScoped
+class LadybirdSpider extends Spider
+{
+
+ public void spinWeb()
+ {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/LadybirdSpider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Plaice.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Plaice.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Plaice.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.Named;
+
+@AnotherDeploymentType
+@Whitefish
+@Named("whitefish")
+final class Plaice implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Plaice.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ResolutionByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ResolutionByTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ResolutionByTypeTest.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,250 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Set;
+
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.DefinitionException;
+import javax.webbeans.DuplicateBindingTypeException;
+import javax.webbeans.TypeLiteral;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.impl.literals.CurrentBinding;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class ResolutionByTypeTest extends AbstractTest
+{
+
+ @Override
+ protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ {
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
+ deploymentTypes.add(AnotherDeploymentType.class);
+ return deploymentTypes;
+ }
+
+ @Test(groups="resolution") @SpecAssertion(section="5.9.2")
+ public void testDefaultBindingTypeAssumed() throws Exception
+ {
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ manager.addBean(tunaBean);
+ Set<Bean<Tuna>> possibleTargets = manager.resolveByType(Tuna.class);
+ assert possibleTargets.size() == 1;
+ assert possibleTargets.contains(tunaBean);
+ }
+
+ @Test(groups="resolution", expectedExceptions=IllegalArgumentException.class) @SpecAssertion(section="5.9")
+ public void testParameterizedTypeWithWildcardParameter()
+ {
+ manager.resolveByType(new TypeLiteral<ParameterizedBean_Broken<?>>(){});
+ }
+
+ @Test(groups="resolution", expectedExceptions=IllegalArgumentException.class) @SpecAssertion(section="5.9")
+ public <T> void testParameterizedTypeWithTypeParameter()
+ {
+ manager.resolveByType(new TypeLiteral<ParameterizedBean_Broken<T>>(){});
+ }
+
+ @Test(groups="resolution", expectedExceptions=DuplicateBindingTypeException.class) @SpecAssertion(section="5.9.2")
+ public void testDuplicateBindingTypesUsed()
+ {
+ manager.resolveByType(Tuna.class, new CurrentBinding(), new CurrentBinding());
+ }
+
+ @Test(groups="resolution", expectedExceptions=IllegalArgumentException.class) @SpecAssertion(section="5.9.2")
+ public void testNonBindingTypeUsed()
+ {
+ manager.resolveByType(Tuna.class, new AnotherDeploymentTypeLiteral());
+ }
+
+ @Test(groups="resolution") @SpecAssertion(section={"5.9.2"})
+ public void testResolveByType() throws Exception
+ {
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
+
+ manager.addBean(tunaBean);
+ manager.addBean(salmonBean);
+ manager.addBean(haddockBean);
+ manager.addBean(seaBassBean);
+
+ assert manager.resolveByType(Tuna.class, new CurrentBinding()).size() == 1;
+ assert manager.resolveByType(Tuna.class, new CurrentBinding()).contains(tunaBean);
+
+ assert manager.resolveByType(Tuna.class).size() == 1;
+ assert manager.resolveByType(Tuna.class).contains(tunaBean);
+
+ assert manager.resolveByType(Animal.class, new CurrentBinding()).size() == 3;
+ assert manager.resolveByType(Animal.class, new CurrentBinding()).contains(salmonBean);
+ assert manager.resolveByType(Animal.class, new CurrentBinding()).contains(seaBassBean);
+ assert manager.resolveByType(Animal.class, new CurrentBinding()).contains(haddockBean);
+ }
+
+ @Test(groups="injection") @SpecAssertion(section={"2.3.5","5.9.2.2"})
+ public void testAllBindingTypesSpecifiedForResolutionMustAppearOnWebBean()
+ {
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+
+ manager.addBean(codBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+
+ assert manager.resolveByType(Animal.class, new ChunkyLiteral() {
+
+ public boolean realChunky()
+ {
+ return true;
+ }
+
+ }, new AnnotationLiteral<Whitefish>() {}).size() == 1;
+ assert manager.resolveByType(Animal.class, new ChunkyLiteral() {
+
+ public boolean realChunky()
+ {
+ return true;
+ }
+
+ }, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
+
+ assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).size() == 2;
+ assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
+ assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(soleBean);
+ }
+
+ @Test(groups="resolution") @SpecAssertion(section="5.9.2")
+ public void testResolveByTypeWithTypeParameter() throws Exception
+ {
+ Bean<ScottishFishFarmer> scottishFishFarmerBean = createSimpleBean(ScottishFishFarmer.class);
+ Bean<AnimalFarmer> farmerBean = createSimpleBean(AnimalFarmer.class);
+
+ manager.addBean(scottishFishFarmerBean);
+ manager.addBean(farmerBean);
+
+ assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
+ assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).contains(scottishFishFarmerBean);
+ }
+
+ @Test(groups={"resolution", "producerMethod"}) @SpecAssertion(section="5.9.2")
+ public void testResolveByTypeWithArray() throws Exception
+ {
+ Bean<SpiderProducer> spiderProducerBean = createSimpleBean(SpiderProducer.class);
+ manager.addBean(spiderProducerBean);
+ Method method = SpiderProducer.class.getMethod("getSpiders");
+ Bean<Spider[]> spidersModel = createProducerMethodBean(method, spiderProducerBean);
+ manager.addBean(spidersModel);
+ method = SpiderProducer.class.getMethod("getStrings");
+ Bean<String[]> stringModel = createProducerMethodBean(method, spiderProducerBean);
+ manager.addBean(stringModel);
+
+ assert manager.resolveByType(Spider[].class).size() == 1;
+ }
+
+ @Test @SpecAssertion(section="5.9.2")
+ public void testOnlyHighestEnabledPreecedenceWebBeansResolved() throws Exception
+ {
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
+
+
+ manager.addBean(plaiceBean);
+ manager.addBean(codBean);
+ manager.addBean(soleBean);
+
+ assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
+ assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).contains(plaiceBean);
+
+ }
+
+
+ @Test(groups="resolution") @SpecAssertion(section="5.9.2")
+ public void testNoWebBeansFound() throws Exception
+ {
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
+ manager.addBean(plaiceBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+
+ assert manager.resolveByType(Tuna.class, new CurrentBinding()).size() == 0;
+ }
+
+ @Test(groups="resolution") @SpecAssertion(section="5.9.2.1")
+ public void testResolveByTypeWithNonBindingMembers() throws Exception
+ {
+ Bean<Halibut> halibutBean = createSimpleBean(Halibut.class);
+ Bean<RoundWhitefish> roundWhiteFishBean = createSimpleBean(RoundWhitefish.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ manager.addBean(halibutBean);
+ manager.addBean(roundWhiteFishBean);
+ manager.addBean(soleBean);
+
+ Set<Bean<Animal>> beans = manager.resolveByType(Animal.class, new ExpensiveLiteral()
+ {
+
+ public int cost()
+ {
+ return 60;
+ }
+
+ public boolean veryExpensive()
+ {
+ return true;
+ }
+
+ }, new AnnotationLiteral<Whitefish>() {});
+ assert beans.size() == 2;
+ assert beans.contains(halibutBean);
+ assert beans.contains(roundWhiteFishBean);
+ }
+
+ @Test(groups="resolution", expectedExceptions=DefinitionException.class) @SpecAssertion(section="5.9.2.1")
+ public void testArrayValuedAnnotationMemberWithoutNonBinding()
+ {
+ manager.resolveByType(Animal.class, new BindingTypeWithBindingArrayTypeMemberLiteral_Broken() {
+
+ public boolean[] bool()
+ {
+ return new boolean[0];
+ }
+
+ });
+ }
+
+ @Test(groups="resolution", expectedExceptions=DefinitionException.class) @SpecAssertion(section="5.9.2.1")
+ public void testAnnotationValuedAnnotationMemberWithoutNonBinding()
+ {
+ manager.resolveByType(Animal.class, new BindingTypeWithBindingAnnotationMemberLiteral_Broken()
+ {
+
+ public Expensive expensive()
+ {
+ return new ExpensiveLiteral()
+ {
+ public int cost()
+ {
+ return 0;
+ }
+
+ public boolean veryExpensive()
+ {
+ return false;
+ }
+ };
+ }
+
+ });
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ResolutionByTypeTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/RoundWhitefish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/RoundWhitefish.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/RoundWhitefish.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+@Expensive(cost=60, veryExpensive=true)
+@Whitefish
+class RoundWhitefish implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/RoundWhitefish.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ScottishFishFarmer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ScottishFishFarmer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ScottishFishFarmer.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.Production;
+
+@Production
+class ScottishFishFarmer extends Farmer<ScottishFish>
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/ScottishFishFarmer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SeaBass.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SeaBass.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SeaBass.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+@Production
+@RequestScoped
+class SeaBass implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SeaBass.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Spider.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+
+class Spider implements Animal
+{
+
+ public final void layEggs()
+ {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Spider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SpiderProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SpiderProducer.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+import javax.webbeans.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer
+{
+
+ private static Spider[] ALL_SPIDERS = { new Tarantula(), new LadybirdSpider(), new DaddyLongLegs() };
+
+ @Produces public Spider[] getSpiders()
+ {
+ return ALL_SPIDERS;
+ }
+
+ @Produces public String[] getStrings()
+ {
+ return new String[0];
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/SpiderProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Tarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Tarantula.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Tarantula.java 2009-01-16 19:26:29 UTC (rev 1034)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.tests.lookup.typesafe;
+
+class Tarantula extends Spider implements DeadlySpider
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/Tarantula.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
[webbeans-commits] Webbeans SVN: r1033 - in tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests: definition/binding and 13 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-16 13:58:14 -0500 (Fri, 16 Jan 2009)
New Revision: 1033
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/binding/BindingTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/common/CommonWebBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/deployment/DeploymentTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/name/NameTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/scope/ScopeTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/type/TypeTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/initializer/InitializerMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/field/ProducerFieldBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/field/ProducerFieldBeanModelTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/method/ProducerMethodBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/method/ProducerMethodBeanModelTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/byname/InstantiationByNameTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/byname/ResolutionByNameTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/clientProxy/ClientProxyTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/injection/InjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/manager/ManagerTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/InstantiationByTypeTest.java
Log:
Refactor to fix method names and signatures
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -48,17 +48,17 @@
manager = null;
}
- public <T> Bean<T> getSimpleBean(Class<T> beanClass)
+ public <T> Bean<T> createSimpleBean(Class<T> beanClass)
{
return configuration().getBeans().createSimpleBean(beanClass);
}
- public <T> Bean<T> getProducerMethodBean(Method method, Bean<?> producerBean)
+ public <T> Bean<T> createProducerMethodBean(Method method, Bean<?> producerBean)
{
return configuration().getBeans().createProducerMethodBean(method, producerBean);
}
- public <T> Bean<?> getProducerFieldBean(Field field, Bean<?> producerBean)
+ public <T> Bean<T> createProducerFieldBean(Field field, Bean<?> producerBean)
{
return configuration().getBeans().createProducerFieldBean(field, producerBean);
}
@@ -67,42 +67,16 @@
{
manager = configuration().getContainers().deploy(classes);
}
-
- protected <T> Bean<T> registerBean(Class<T> clazz)
- {
- Bean<T> bean = null;
- if (configuration().getBeans().isEnterpriseBean(clazz))
- {
- bean = configuration().getBeans().createEnterpriseBean(clazz);
- }
- else
- {
- bean = getSimpleBean(clazz);
- }
- manager.addBean(bean);
- return bean;
- }
- protected void registerBeans(Class<?>... classes)
+ protected List<Class<? extends Annotation>> getStandardDeploymentTypes()
{
- for (Class<?> clazz : classes)
- {
- registerBean(clazz);
- }
+ return new ArrayList<Class<? extends Annotation>>(STANDARD_DEPLOYMENT_TYPES);
}
-
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
- return new ArrayList<Class<? extends Annotation>>(STANDARD_DEPLOYMENT_TYPES);
+ return getStandardDeploymentTypes();
}
-
-/*
- protected <T> void addToEjbCache(Class<T> clazz)
- {
- manager.getEjbDescriptorCache().add(new MockEjbDescriptor<T>(clazz));
- }
- */
protected byte[] serialize(Object instance) throws IOException
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/binding/BindingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/binding/BindingTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/binding/BindingTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -24,7 +24,7 @@
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
- List<Class<? extends Annotation>> deploymentTypes = super.getEnabledDeploymentTypes();
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
deploymentTypes.add(AnotherDeploymentType.class);
return deploymentTypes;
}
@@ -32,7 +32,7 @@
@Test @SpecAssertion(section={"2.3.3", "2.3.1"})
public void testDefaultBindingDeclaredInJava()
{
- Bean<Order> order = getSimpleBean(Order.class);
+ Bean<Order> order = createSimpleBean(Order.class);
assert order.getBindings().size() == 1;
order.getBindings().iterator().next().annotationType().equals(Production.class);
}
@@ -59,7 +59,7 @@
@Test @SpecAssertion(section="2.3.3")
public void testBindingsDeclaredInJava()
{
- Bean<Cat> cat = getSimpleBean(Cat.class);
+ Bean<Cat> cat = createSimpleBean(Cat.class);
assert cat.getBindings().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindings(), Synchronous.class);
}
@@ -67,7 +67,7 @@
@Test @SpecAssertion(section="2.3.3")
public void testMultipleBindings()
{
- Bean<?> model = getSimpleBean(Cod.class);
+ Bean<?> model = createSimpleBean(Cod.class);
assert model.getBindings().size() == 2;
}
@@ -111,7 +111,7 @@
@Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section={"2.3.4", "2.3.1"})
public void testDefaultBindingDeclaredInXml()
{
- Bean<?> model = getSimpleBean(Tuna.class);
+ Bean<?> model = createSimpleBean(Tuna.class);
assert model.getBindings().size() == 1;
assert model.getBindings().contains(new CurrentBinding());
assert false;
@@ -120,11 +120,11 @@
@Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(getProducerMethodBean(method, spiderProducer));
- Barn barn = getSimpleBean(Barn.class).create();
+ manager.addBean(createProducerMethodBean(method, spiderProducer));
+ Barn barn = createSimpleBean(Barn.class).create();
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
}
@@ -145,12 +145,12 @@
@Test(groups={"injection", "producerMethod"})
public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
{
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(getProducerMethodBean(method, spiderProducer));
+ manager.addBean(createProducerMethodBean(method, spiderProducer));
method = SpiderProducer.class.getMethod("produceSpiderFromInjection", Tarantula.class);
- Bean<Spider> spiderBean = getProducerMethodBean(method, spiderProducer);
+ Bean<Spider> spiderBean = createProducerMethodBean(method, spiderProducer);
Spider spider = spiderBean.create();
assert spider != null;
assert spider instanceof DefangedTarantula;
@@ -171,7 +171,7 @@
@Test @SpecAssertion(section="4.1")
public void testBindingDeclaredInheritedIsInherited() throws Exception
{
- Set<? extends Annotation> bindings = getSimpleBean(BorderCollie.class).getBindings();
+ Set<? extends Annotation> bindings = createSimpleBean(BorderCollie.class).getBindings();
assert bindings.size() == 1;
assert bindings.iterator().next().annotationType().equals(Hairy.class);
}
@@ -179,7 +179,7 @@
@Test @SpecAssertion(section="4.1")
public void testBindingNotDeclaredInheritedIsNotInherited()
{
- Set<? extends Annotation> bindings = getSimpleBean(ShetlandPony.class).getBindings();
+ Set<? extends Annotation> bindings = createSimpleBean(ShetlandPony.class).getBindings();
assert bindings.size() == 1;
assert bindings.iterator().next().annotationType().equals(Current.class);
}
@@ -187,7 +187,7 @@
@Test @SpecAssertion(section="4.1")
public void testBindingDeclaredInheritedIsBlockedByIntermediateClass()
{
- Set<? extends Annotation> bindings = getSimpleBean(ClippedBorderCollie.class).getBindings();
+ Set<? extends Annotation> bindings = createSimpleBean(ClippedBorderCollie.class).getBindings();
assert bindings.size() == 1;
Annotation binding = bindings.iterator().next();
assert binding.annotationType().equals(Hairy.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/common/CommonWebBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/common/CommonWebBeanTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/common/CommonWebBeanTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -28,7 +28,7 @@
@SpecAssertion(section = "2")
public void testApiTypesNonEmpty()
{
- Bean<?> model = getSimpleBean(RedSnapper.class);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getTypes().size() > 0;
}
@@ -36,7 +36,7 @@
@SpecAssertion(section = "2")
public void testBindingTypesNonEmpty()
{
- Bean<?> model = getSimpleBean(RedSnapper.class);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getBindings().size() > 0;
}
@@ -44,7 +44,7 @@
@SpecAssertion(section = "2")
public void testHasScopeType()
{
- Bean<?> model = getSimpleBean(RedSnapper.class);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getScopeType().equals(RequestScoped.class);
}
@@ -52,7 +52,7 @@
@SpecAssertion(section = "2")
public void testHasDeploymentType()
{
- Bean<?> model = getSimpleBean(RedSnapper.class);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getDeploymentType().equals(Production.class);
}
@@ -61,13 +61,13 @@
@SpecAssertion(section = "5.2")
public void testIsNullable() throws Exception
{
- Bean<SpiderProducer> spiderProducerBean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> spiderProducerBean = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducerBean);
Method method = SpiderProducer.class.getMethod("getWolfSpiderSize");
- Bean<Integer> bean = getProducerMethodBean(method, spiderProducerBean);
+ Bean<Integer> bean = createProducerMethodBean(method, spiderProducerBean);
assert !bean.isNullable();
method = SpiderProducer.class.getMethod("makeASpider");
- Bean<Spider> spiderBean = getProducerMethodBean(method, spiderProducerBean);
+ Bean<Spider> spiderBean = createProducerMethodBean(method, spiderProducerBean);
assert spiderBean.isNullable();
}
@@ -75,7 +75,7 @@
@SpecAssertion(section = { "3.2.2", "2.2" })
public void testApiTypes()
{
- Bean<Tarantula> bean = getSimpleBean(Tarantula.class);
+ Bean<Tarantula> bean = createSimpleBean(Tarantula.class);
assert bean.getTypes().size() == 6;
assert bean.getTypes().contains(Tarantula.class);
assert bean.getTypes().contains(Spider.class);
@@ -89,7 +89,7 @@
@SpecAssertion(section = "2.2")
public void testFinalApiType()
{
- getSimpleBean(DependentFinalTuna.class);
+ createSimpleBean(DependentFinalTuna.class);
}
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/deployment/DeploymentTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/deployment/DeploymentTypeTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/deployment/DeploymentTypeTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -26,7 +26,7 @@
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
- List<Class<? extends Annotation>> deploymentTypes = super.getEnabledDeploymentTypes();
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
deploymentTypes.add(HornedAnimalDeploymentType.class);
return deploymentTypes;
}
@@ -34,7 +34,7 @@
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.5.1")
public void testNonBuiltInComponentUsesStandard()
{
- getSimpleBean(Gazelle_Broken.class);
+ createSimpleBean(Gazelle_Broken.class);
}
@Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.5.2")
@@ -58,17 +58,17 @@
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.5.3")
public void testTooManyDeploymentTypes()
{
- getSimpleBean(BeanWithTooManyDeploymentTypes_Broken.class);
+ createSimpleBean(BeanWithTooManyDeploymentTypes_Broken.class);
}
@SuppressWarnings("unchecked")
@Test @SpecAssertion(section="2.5.3")
public void testDeploymentTypeInhertitedFromDeclaringBean() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceBlackWidow");
- Bean<BlackWidow> blackWidowSpiderModel = getProducerMethodBean(method, bean);
+ Bean<BlackWidow> blackWidowSpiderModel = createProducerMethodBean(method, bean);
assert blackWidowSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
@@ -107,7 +107,7 @@
@Test @SpecAssertion(section="2.5.5")
public void testHighestPrecedenceDeploymentTypeFromStereotype()
{
- Bean<?> bean = getSimpleBean(Rhinoceros.class);
+ Bean<?> bean = createSimpleBean(Rhinoceros.class);
assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
@@ -119,7 +119,7 @@
Arrays.asList(Standard.class, AnotherDeploymentType.class,
HornedAnimalDeploymentType.class));
- Bean<RedSnapper> bean = getSimpleBean(RedSnapper.class);
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
manager.addBean(bean);
manager.getInstanceByType(RedSnapper.class);
}
@@ -154,7 +154,7 @@
@Test @SpecAssertion(section={"2.5.5", "2.7.2"})
public void testWebBeanDeploymentTypeOverridesStereotype()
{
- Bean<Reindeer> bean = getSimpleBean(Reindeer.class);
+ Bean<Reindeer> bean = createSimpleBean(Reindeer.class);
assert bean.getDeploymentType().equals(Production.class);
}
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/name/NameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/name/NameTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/name/NameTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -18,7 +18,7 @@
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
- List<Class<? extends Annotation>> deploymentTypes = super.getEnabledDeploymentTypes();
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
deploymentTypes.add(AnotherDeploymentType.class);
return deploymentTypes;
}
@@ -32,7 +32,7 @@
@Test @SpecAssertion(section="2.6.1")
public void testNonDefaultNamed()
{
- Bean<Moose> moose = getSimpleBean(Moose.class);
+ Bean<Moose> moose = createSimpleBean(Moose.class);
assert moose.getName().equals("aMoose");
}
@@ -88,7 +88,7 @@
@Test @SpecAssertion(section={"2.6.3", "3.2.7"})
public void testDefaultNamed()
{
- Bean<Haddock> haddock = getSimpleBean(Haddock.class);
+ Bean<Haddock> haddock = createSimpleBean(Haddock.class);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
@@ -116,28 +116,28 @@
@Test @SpecAssertion(section={"2.6.3", "2.7"})
public void testSterotypeDefaultsName()
{
- Bean<RedSnapper> model = getSimpleBean(RedSnapper.class);
+ Bean<RedSnapper> model = createSimpleBean(RedSnapper.class);
assert model.getName().equals("redSnapper");
}
@Test @SpecAssertion(section="2.6.4")
public void testNotNamedInJava()
{
- Bean<SeaBass> model = getSimpleBean(SeaBass.class);
+ Bean<SeaBass> model = createSimpleBean(SeaBass.class);
assert model.getName() == null;
}
@Test @SpecAssertion(section="2.6.4")
public void testNotNamedInXml()
{
- Bean<SeaBass> model = getSimpleBean(SeaBass.class);
+ Bean<SeaBass> model = createSimpleBean(SeaBass.class);
assert model.getName() == null;
}
@Test @SpecAssertion(section="2.6.4")
public void testNotNamedInStereotype()
{
- Bean<Minnow> model = getSimpleBean(Minnow.class);
+ Bean<Minnow> model = createSimpleBean(Minnow.class);
assert model.getName() == null;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/scope/ScopeTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/scope/ScopeTypeTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/scope/ScopeTypeTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -19,7 +19,7 @@
@Test @SpecAssertion(section="2.4")
public void testScopeTypesAreExtensible()
{
- Bean<Mullet> mullet = getSimpleBean(Mullet.class);
+ Bean<Mullet> mullet = createSimpleBean(Mullet.class);
assert mullet.getScopeType().equals(AnotherScopeType.class);
}
@@ -44,14 +44,14 @@
@Test @SpecAssertion(section="2.4.3")
public void testScopeDeclaredInJava()
{
- Bean<SeaBass> trout = getSimpleBean(SeaBass.class);
+ Bean<SeaBass> trout = createSimpleBean(SeaBass.class);
assert trout.getScopeType().equals(RequestScoped.class);
}
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.4.3")
public void testTooManyScopesSpecifiedInJava()
{
- getSimpleBean(BeanWithTooManyScopeTypes.class);
+ createSimpleBean(BeanWithTooManyScopeTypes.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub", "webbeansxml"})
@@ -101,54 +101,54 @@
@Test @SpecAssertion(section="2.4.5")
public void testDefaultScope()
{
- Bean<Order> order = getSimpleBean(Order.class);
+ Bean<Order> order = createSimpleBean(Order.class);
assert order.getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section={"2.4.5", "2.7.2"})
public void testScopeSpecifiedAndStereotyped()
{
- Bean<Minnow> minnow = getSimpleBean(Minnow.class);
+ Bean<Minnow> minnow = createSimpleBean(Minnow.class);
assert minnow.getScopeType().equals(RequestScoped.class);
}
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.4.5")
public void testMutipleIncompatibleScopeStereotypes()
{
- getSimpleBean(Scallop_Broken.class);
+ createSimpleBean(Scallop_Broken.class);
}
@Test @SpecAssertion(section="2.4.5")
public void testMutipleIncompatibleScopeStereotypesWithScopeSpecified()
{
- Bean<Pollock> pollock = getSimpleBean(Pollock.class);
+ Bean<Pollock> pollock = createSimpleBean(Pollock.class);
assert pollock.getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section="2.4.5")
public void testMutipleCompatibleScopeStereotypes()
{
- Bean<Grayling> grayling = getSimpleBean(Grayling.class);
+ Bean<Grayling> grayling = createSimpleBean(Grayling.class);
assert grayling.getScopeType().equals(ApplicationScoped.class);
}
@Test @SpecAssertion(section="2.7.2")
public void testWebBeanScopeTypeOverridesStereotype()
{
- Bean<RedSnapper> bean = getSimpleBean(RedSnapper.class);
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
assert bean.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="4.1")
public void testScopeTypeDeclaredInheritedIsInherited() throws Exception
{
- assert getSimpleBean(BorderCollie.class).getScopeType().equals(RequestScoped.class);
+ assert createSimpleBean(BorderCollie.class).getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="4.1")
public void testScopeTypeNotDeclaredInheritedIsNotInherited()
{
- assert getSimpleBean(ShetlandPony.class).getScopeType().equals(Dependent.class);
+ assert createSimpleBean(ShetlandPony.class).getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section="4.1")
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/type/TypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/type/TypeTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/type/TypeTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -12,7 +12,7 @@
@Test @SpecAssertion(section="2.6.3")
public void testDefaultNamed()
{
- Bean<Haddock> haddock = getSimpleBean(Haddock.class);
+ Bean<Haddock> haddock = createSimpleBean(Haddock.class);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/initializer/InitializerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -16,7 +16,7 @@
@Test(expectedExceptions=DefinitionException.class, groups="initializerMethod") @SpecAssertion(section="3.8")
public void testStaticInitializerMethodNotAllowed()
{
- getSimpleBean(Dottrel.class);
+ createSimpleBean(Dottrel.class);
}
@Test(groups={"stub", "initializerMethod", "servlet"}) @SpecAssertion(section="3.8")
@@ -58,10 +58,10 @@
@Test(groups={"initializerMethod"}) @SpecAssertion(section={"3.8", "5.3", "3.8.2", "3.8.3"})
public void testMultipleInitializerMethodsAreCalled()
{
- manager.addBean(getSimpleBean(Fox.class));
- manager.addBean(getSimpleBean(Chicken.class));
+ manager.addBean(createSimpleBean(Fox.class));
+ manager.addBean(createSimpleBean(Chicken.class));
- Bean<ChickenHutch> chickenHutchBean = getSimpleBean(ChickenHutch.class);
+ Bean<ChickenHutch> chickenHutchBean = createSimpleBean(ChickenHutch.class);
ChickenHutch chickenHutch = chickenHutchBean.create();
assert chickenHutch.fox != null;
assert chickenHutch.chicken != null;
@@ -70,25 +70,25 @@
@Test(groups="initializerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section={"3.8.1", "3.4.2"})
public void testInitializerMethodAnnotatedProduces()
{
- getSimpleBean(Pheasant.class);
+ createSimpleBean(Pheasant.class);
}
@Test(groups="initializerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.8.1")
public void testInitializerMethodAnnotatedDestructor()
{
- getSimpleBean(Shrike.class);
+ createSimpleBean(Shrike.class);
}
@Test(groups="initializerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.8.1")
public void testInitializerMethodHasParameterAnnotatedDisposes()
{
- getSimpleBean(Capercaillie.class);
+ createSimpleBean(Capercaillie.class);
}
@Test(groups="initializerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.8.1")
public void testInitializerMethodHasParameterAnnotatedObserves()
{
- getSimpleBean(Grouse.class);
+ createSimpleBean(Grouse.class);
}
@Test(groups={"stub", "initializerMethod", "webbeansxml"}) @SpecAssertion(section="3.8.2")
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/field/ProducerFieldBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/field/ProducerFieldBeanLifecycleTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/field/ProducerFieldBeanLifecycleTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -18,10 +18,10 @@
@Test(groups={"producerField", "broken"}) @SpecAssertion(section="5.6")
public void testProducerFieldBeanCreate() throws Exception
{
- Bean<OtherSpiderProducer> spiderProducer = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> spiderProducer = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(spiderProducer);
Field method = OtherSpiderProducer.class.getField("produceTarantula");
- Bean<Tarantula> tarantulaBean = (Bean<Tarantula>) getProducerFieldBean(method, spiderProducer);
+ Bean<Tarantula> tarantulaBean = createProducerFieldBean(method, spiderProducer);
Tarantula tarantula = tarantulaBean.create();
assert tarantula != null;
}
@@ -38,10 +38,10 @@
@Test(groups={"producerField", "broken"}) @SpecAssertion(section={"3.5", "5.6", "8.3"})
public void testProducerFieldReturnsNullIsDependent() throws Exception
{
- Bean<OtherSpiderProducer> spiderProducer = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> spiderProducer = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(spiderProducer);
Field method = OtherSpiderProducer.class.getField("getNullSpider");
- Bean<Spider> spiderBean = (Bean<Spider>) getProducerFieldBean(method, spiderProducer);
+ Bean<Spider> spiderBean = createProducerFieldBean(method, spiderProducer);
Spider spider = spiderBean.create();
assert spider == null;
}
@@ -49,10 +49,10 @@
@Test(groups="producerField", expectedExceptions=IllegalProductException.class) @SpecAssertion(section={"3.5", "5.6"})
public void testProducerFieldReturnsNullIsNotDependent() throws Exception
{
- Bean<OtherSpiderProducer_Broken> spiderProducer = getSimpleBean(OtherSpiderProducer_Broken.class);
+ Bean<OtherSpiderProducer_Broken> spiderProducer = createSimpleBean(OtherSpiderProducer_Broken.class);
manager.addBean(spiderProducer);
Field method = OtherSpiderProducer_Broken.class.getField("getRequestScopedSpider");
- getProducerFieldBean(method, spiderProducer).create();
+ createProducerFieldBean(method, spiderProducer).create();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/field/ProducerFieldBeanModelTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/field/ProducerFieldBeanModelTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/field/ProducerFieldBeanModelTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -21,10 +21,10 @@
@Test(groups="producerField") @SpecAssertion(section="2.5.3")
public void testProducerFieldInheritsDeploymentTypeOfDeclaringWebBean() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("produceTameTarantula");
- Bean<Tarantula> tarantulaModel = (Bean<Tarantula>) getProducerFieldBean(field, bean);
+ Bean<Tarantula> tarantulaModel = createProducerFieldBean(field, bean);
tarantulaModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
@@ -46,19 +46,19 @@
@Test(groups="producerField") @SpecAssertion(section="3.5")
public void testParameterizedReturnType() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("getFunnelWeaverSpider");
- getProducerFieldBean(field, bean);
+ createProducerFieldBean(field, bean);
}
@Test(groups="producerField", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.5")
public void testParameterizedReturnTypeWithWildcard() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("getAnotherFunnelWeaver");
- getProducerFieldBean(field, bean);
+ createProducerFieldBean(field, bean);
}
@Test(groups={"stub", "producerField", "deployment"}) @SpecAssertion(section="3.5")
@@ -71,10 +71,10 @@
@Test(groups="producerField") @SpecAssertion(section={"3.5", "2.3.1"})
public void testDefaultBindingType() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("produceTarantula");
- Bean<Tarantula> tarantulaModel = (Bean<Tarantula>) getProducerFieldBean(field, bean);
+ Bean<Tarantula> tarantulaModel = createProducerFieldBean(field, bean);
assert tarantulaModel.getBindings().size() == 1;
assert tarantulaModel.getBindings().iterator().next().annotationType().equals(Current.class);
}
@@ -83,10 +83,10 @@
@Test(groups="producerField") @SpecAssertion(section="3.5.1")
public void testApiTypeForClassReturn() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("produceTarantula");
- Bean<Tarantula> tarantulaModel = (Bean<Tarantula>) getProducerFieldBean(field, bean);
+ Bean<Tarantula> tarantulaModel = createProducerFieldBean(field, bean);
assert tarantulaModel.getTypes().size() == 6;
assert tarantulaModel.getTypes().contains(Tarantula.class);
assert tarantulaModel.getTypes().contains(DeadlySpider.class);
@@ -100,10 +100,10 @@
@Test(groups="producerField") @SpecAssertion(section="3.5.1")
public void testApiTypeForInterfaceReturn() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("makeASpider");
- Bean<Animal> animalModel = (Bean<Animal>) getProducerFieldBean(field, bean);
+ Bean<Animal> animalModel = createProducerFieldBean(field, bean);
assert animalModel.getTypes().size() == 2;
assert animalModel.getTypes().contains(Animal.class);
assert animalModel.getTypes().contains(Object.class);
@@ -113,10 +113,10 @@
@Test(groups="producerField") @SpecAssertion(section="3.5.1")
public void testApiTypeForPrimitiveReturn() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("getWolfSpiderSize");
- Bean<Integer> intModel = (Bean<Integer>) getProducerFieldBean(field, bean);
+ Bean<Integer> intModel = createProducerFieldBean(field, bean);
assert intModel.getTypes().size() == 2;
assert intModel.getTypes().contains(int.class);
assert intModel.getTypes().contains(Object.class);
@@ -126,10 +126,10 @@
@Test(groups="producerField") @SpecAssertion(section={"3.5.1", "2.2"})
public void testApiTypeForArrayTypeReturn() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("getSpiders");
- Bean<Spider[]> spidersModel = (Bean<Spider[]>) getProducerFieldBean(field, bean);
+ Bean<Spider[]> spidersModel = createProducerFieldBean(field, bean);
assert spidersModel.getTypes().size() == 2;
assert spidersModel.getTypes().contains(Spider[].class);
assert spidersModel.getTypes().contains(Object.class);
@@ -139,10 +139,10 @@
@Test(groups="producerField") @SpecAssertion(section="3.5.2")
public void testBindingType() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("produceTameTarantula");
- Bean<Tarantula> tarantulaModel = (Bean<Tarantula>) getProducerFieldBean(field, bean);
+ Bean<Tarantula> tarantulaModel = createProducerFieldBean(field, bean);
assert tarantulaModel.getBindings().size() == 1;
assert tarantulaModel.getBindings().iterator().next().annotationType().equals(Tame.class);
}
@@ -151,10 +151,10 @@
@Test(groups="producerField") @SpecAssertion(section="3.5.2")
public void testScopeType() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("produceDaddyLongLegs");
- Bean<DaddyLongLegs> daddyLongLegsModel = (Bean<DaddyLongLegs>) getProducerFieldBean(field, bean);
+ Bean<DaddyLongLegs> daddyLongLegsModel = createProducerFieldBean(field, bean);
assert daddyLongLegsModel.getScopeType().equals(RequestScoped.class);
// TODO Inherit scope from returned web bean?
@@ -164,10 +164,10 @@
@Test(groups="producerField") @SpecAssertion(section="3.5.2")
public void testDeploymentType() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("getLadybirdSpider");
- Bean<LadybirdSpider> ladybirdSpiderModel = (Bean<LadybirdSpider>) getProducerFieldBean(field, bean);
+ Bean<LadybirdSpider> ladybirdSpiderModel = createProducerFieldBean(field, bean);
assert ladybirdSpiderModel.getDeploymentType().equals(Production.class);
}
@@ -175,10 +175,10 @@
@Test(groups="producerField") @SpecAssertion(section="3.5.2")
public void testNamedField() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("produceBlackWidow");
- Bean<BlackWidow> blackWidowSpiderModel = (Bean<BlackWidow>) getProducerFieldBean(field, bean);
+ Bean<BlackWidow> blackWidowSpiderModel = createProducerFieldBean(field, bean);
assert blackWidowSpiderModel.getName().equals("blackWidow");
}
@@ -186,10 +186,10 @@
@Test(groups="producerField") @SpecAssertion(section="3.5.2")
public void testDefaultNamedField() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("produceDaddyLongLegs");
- Bean<DaddyLongLegs> daddyLongLegsSpiderModel = (Bean<DaddyLongLegs>) getProducerFieldBean(field, bean);
+ Bean<DaddyLongLegs> daddyLongLegsSpiderModel = createProducerFieldBean(field, bean);
assert daddyLongLegsSpiderModel.getName().equals("produceDaddyLongLegs");
}
@@ -257,10 +257,10 @@
@Test(groups="producerField") @SpecAssertion(section={"2.7.2", "3.5.2", "2.2"})
public void testStereotype() throws Exception
{
- Bean<OtherSpiderProducer> bean = getSimpleBean(OtherSpiderProducer.class);
+ Bean<OtherSpiderProducer> bean = createSimpleBean(OtherSpiderProducer.class);
manager.addBean(bean);
Field field = OtherSpiderProducer.class.getField("produceWolfSpider");
- Bean<WolfSpider> wolfSpiderModel = (Bean<WolfSpider>) getProducerFieldBean(field, bean);
+ Bean<WolfSpider> wolfSpiderModel = createProducerFieldBean(field, bean);
// TODO reimplement stereotype tests
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/method/ProducerMethodBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/method/ProducerMethodBeanLifecycleTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/method/ProducerMethodBeanLifecycleTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -17,10 +17,10 @@
@Test(groups={"producerMethod", "broken"}) @SpecAssertion(section="5.6")
public void testProducerMethodBeanCreate() throws Exception
{
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- Bean<Tarantula> tarantulaBean = getProducerMethodBean(method, spiderProducer);
+ Bean<Tarantula> tarantulaBean = createProducerMethodBean(method, spiderProducer);
Tarantula tarantula = tarantulaBean.create();
assert tarantula != null;
}
@@ -50,10 +50,10 @@
@Test(groups={"producerMethod", "broken"}) @SpecAssertion(section={"3.4", "5.6", "8.3"})
public void testProducerMethodReturnsNullIsDependent() throws Exception
{
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("getNullSpider");
- Bean<Spider> spiderBean = getProducerMethodBean(method, spiderProducer);
+ Bean<Spider> spiderBean = createProducerMethodBean(method, spiderProducer);
Spider spider = spiderBean.create();
assert spider == null;
}
@@ -61,10 +61,10 @@
@Test(groups="producerMethod", expectedExceptions=IllegalProductException.class) @SpecAssertion(section={"3.4", "5.6"})
public void testProducerMethodReturnsNullIsNotDependent() throws Exception
{
- Bean<SpiderProducer_Broken> spiderProducer = getSimpleBean(SpiderProducer_Broken.class);
+ Bean<SpiderProducer_Broken> spiderProducer = createSimpleBean(SpiderProducer_Broken.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer_Broken.class.getMethod("getRequestScopedSpider");
- getProducerMethodBean(method, spiderProducer).create();
+ createProducerMethodBean(method, spiderProducer).create();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/method/ProducerMethodBeanModelTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/method/ProducerMethodBeanModelTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/producer/method/ProducerMethodBeanModelTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -20,20 +20,20 @@
@Test(groups="producerMethod") @SpecAssertion(section="2.5.3")
public void testProducerMethodInheritsDeploymentTypeOfDeclaringWebBean() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- Bean<Tarantula> tarantulaModel = getProducerMethodBean(method, bean);
+ Bean<Tarantula> tarantulaModel = createProducerMethodBean(method, bean);
tarantulaModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test(groups="producerMethod") @SpecAssertion(section="3.4")
public void testStaticMethod() throws Exception
{
- Bean<BeanWithStaticProducerMethod> bean = getSimpleBean(BeanWithStaticProducerMethod.class);
+ Bean<BeanWithStaticProducerMethod> bean = createSimpleBean(BeanWithStaticProducerMethod.class);
manager.addBean(bean);
Method method = BeanWithStaticProducerMethod.class.getMethod("getString");
- getProducerMethodBean(method, bean);
+ createProducerMethodBean(method, bean);
}
@Test(groups={"stub", "producerMethod", "enterpriseBeans", "stub"}, expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
@@ -45,37 +45,37 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4")
public void testParameterizedReturnType() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getFunnelWeaverSpider");
- getProducerMethodBean(method, bean);
+ createProducerMethodBean(method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testParameterizedReturnTypeWithWildcard() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getAnotherFunnelWeaver");
- getProducerMethodBean(method, bean);
+ createProducerMethodBean(method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testParameterizedReturnTypeWithTypeParameter() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getFunnelWeaver");
- getProducerMethodBean(method, bean);
+ createProducerMethodBean(method, bean);
}
@Test(groups="producerMethod") @SpecAssertion(section={"3.4", "2.3.1"})
public void testDefaultBindingType() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- Bean<Tarantula> tarantulaModel = getProducerMethodBean(method, bean);
+ Bean<Tarantula> tarantulaModel = createProducerMethodBean(method, bean);
assert tarantulaModel.getBindings().size() == 1;
assert tarantulaModel.getBindings().iterator().next().annotationType().equals(Current.class);
}
@@ -83,10 +83,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForClassReturn() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- Bean<Tarantula> tarantulaModel = getProducerMethodBean(method, bean);
+ Bean<Tarantula> tarantulaModel = createProducerMethodBean(method, bean);
assert tarantulaModel.getTypes().size() == 6;
assert tarantulaModel.getTypes().contains(Tarantula.class);
assert tarantulaModel.getTypes().contains(DeadlySpider.class);
@@ -99,10 +99,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForInterfaceReturn() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("makeASpider");
- Bean<Animal> animalModel = getProducerMethodBean(method, bean);
+ Bean<Animal> animalModel = createProducerMethodBean(method, bean);
assert animalModel.getTypes().size() == 2;
assert animalModel.getTypes().contains(Animal.class);
assert animalModel.getTypes().contains(Object.class);
@@ -111,10 +111,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForPrimitiveReturn() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getWolfSpiderSize");
- Bean<Integer> intModel = getProducerMethodBean(method, bean);
+ Bean<Integer> intModel = createProducerMethodBean(method, bean);
assert intModel.getTypes().size() == 2;
assert intModel.getTypes().contains(int.class);
assert intModel.getTypes().contains(Object.class);
@@ -123,10 +123,10 @@
@Test(groups="producerMethod") @SpecAssertion(section={"3.4.1", "2.2"})
public void testApiTypeForArrayTypeReturn() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getSpiders");
- Bean<Spider[]> spidersModel = getProducerMethodBean(method, bean);
+ Bean<Spider[]> spidersModel = createProducerMethodBean(method, bean);
assert spidersModel.getTypes().size() == 2;
assert spidersModel.getTypes().contains(Spider[].class);
assert spidersModel.getTypes().contains(Object.class);
@@ -135,10 +135,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testBindingType() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- Bean<Tarantula> tarantulaModel = getProducerMethodBean(method, bean);
+ Bean<Tarantula> tarantulaModel = createProducerMethodBean(method, bean);
assert tarantulaModel.getBindings().size() == 1;
assert tarantulaModel.getBindings().iterator().next().annotationType().equals(Tame.class);
}
@@ -146,10 +146,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testScopeType() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- Bean<DaddyLongLegs> daddyLongLegsModel = getProducerMethodBean(method, bean);
+ Bean<DaddyLongLegs> daddyLongLegsModel = createProducerMethodBean(method, bean);
assert daddyLongLegsModel.getScopeType().equals(RequestScoped.class);
// TODO Inherit scope from returned web bean?
@@ -158,58 +158,58 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testDeploymentType() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
- Bean<LadybirdSpider> ladybirdSpiderModel = getProducerMethodBean(method, bean);
+ Bean<LadybirdSpider> ladybirdSpiderModel = createProducerMethodBean(method, bean);
assert ladybirdSpiderModel.getDeploymentType().equals(Production.class);
}
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testNamedMethod() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceBlackWidow");
- Bean<BlackWidow> blackWidowSpiderModel = getProducerMethodBean(method, bean);
+ Bean<BlackWidow> blackWidowSpiderModel = createProducerMethodBean(method, bean);
assert blackWidowSpiderModel.getName().equals("blackWidow");
}
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testDefaultNamedMethod() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- Bean<DaddyLongLegs> daddyLongLegsSpiderModel = getProducerMethodBean(method, bean);
+ Bean<DaddyLongLegs> daddyLongLegsSpiderModel = createProducerMethodBean(method, bean);
assert daddyLongLegsSpiderModel.getName().equals("produceDaddyLongLegs");
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testProducerMethodAnnotatedDestructor() throws Exception
{
- Bean<SpiderProducer_Broken> bean = getSimpleBean(SpiderProducer_Broken.class);
+ Bean<SpiderProducer_Broken> bean = createSimpleBean(SpiderProducer_Broken.class);
manager.addBean(bean);
Method method = SpiderProducer_Broken.class.getMethod("destroy");
- getProducerMethodBean(method, bean);
+ createProducerMethodBean(method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testProducerMethodWithParameterAnnotatedDisposes() throws Exception
{
- Bean<SpiderProducer_Broken> bean = getSimpleBean(SpiderProducer_Broken.class);
+ Bean<SpiderProducer_Broken> bean = createSimpleBean(SpiderProducer_Broken.class);
manager.addBean(bean);
Method method = SpiderProducer_Broken.class.getMethod("dispose", String.class);
- getProducerMethodBean(method, bean);
+ createProducerMethodBean(method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testProducerMethodWithParameterAnnotatedObserves() throws Exception
{
- Bean<SpiderProducer_Broken> bean = getSimpleBean(SpiderProducer_Broken.class);
+ Bean<SpiderProducer_Broken> bean = createSimpleBean(SpiderProducer_Broken.class);
manager.addBean(bean);
Method method = SpiderProducer_Broken.class.getMethod("observe", String.class);
- getProducerMethodBean(method, bean);
+ createProducerMethodBean(method, bean);
}
@Test(groups={"stub", "disposalMethod"}) @SpecAssertion(section="3.3.4")
@@ -275,10 +275,10 @@
@Test(groups="producerMethod") @SpecAssertion(section={"2.7.2", "3.4.2", "2.2"})
public void testStereotypeSpecifiesScope() throws Exception
{
- Bean<SpiderProducer> bean = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceWolfSpider");
- Bean<WolfSpider> wolfSpider = getProducerMethodBean(method, bean);
+ Bean<WolfSpider> wolfSpider = createProducerMethodBean(method, bean);
//assert wolfSpiderModel.getMergedStereotypes().getRequiredTypes().size() == 1;
//assert wolfSpiderModel.getMergedStereotypes().getRequiredTypes().contains(Animal.class);
assert wolfSpider.getScopeType().equals(RequestScoped.class);
@@ -287,9 +287,9 @@
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section={"2.7.2", "3.4.2", "2.2"})
public void testStereotypeEnforcesTypes() throws Exception
{
- Bean<SpiderProducer_Broken> bean = getSimpleBean(SpiderProducer_Broken.class);
+ Bean<SpiderProducer_Broken> bean = createSimpleBean(SpiderProducer_Broken.class);
manager.addBean(bean);
Method method = SpiderProducer_Broken.class.getMethod("produceInteger");
- getProducerMethodBean(method, bean);
+ createProducerMethodBean(method, bean);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/byname/InstantiationByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/byname/InstantiationByNameTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/byname/InstantiationByNameTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -15,8 +15,8 @@
@Test(groups="resolution") @SpecAssertion(section="4.10")
public void testNoWebBeansFound() throws Exception
{
- Bean<Cod> codBean = getSimpleBean(Cod.class);
- Bean<Salmon> salmonBean = getSimpleBean(Salmon.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
@@ -26,9 +26,9 @@
@Test(expectedExceptions=AmbiguousDependencyException.class) @SpecAssertion(section="4.10.1")
public void testAmbiguousDependencies() throws Exception
{
- Bean<Cod> codBean = getSimpleBean(Cod.class);
- Bean<Salmon> salmonBean = getSimpleBean(Salmon.class);
- Bean<Sole> soleBean = getSimpleBean(Sole.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -39,13 +39,13 @@
@Test(groups={"resolution", "beanLifecycle"}) @SpecAssertion(section="4.10.1")
public void testGetInstanceByName()
{
- Bean<Tuna> tunaBean = getSimpleBean(Tuna.class);
- Bean<Cod> codBean = getSimpleBean(Cod.class);
- Bean<Salmon> salmonBean = getSimpleBean(Salmon.class);
- Bean<Sole> soleBean = getSimpleBean(Sole.class);
- Bean<SeaBass> seaBassBean = getSimpleBean(SeaBass.class);
- Bean<Haddock> haddockBean = getSimpleBean(Haddock.class);
- Bean<Plaice> plaiceBean = getSimpleBean(Plaice.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(tunaBean);
manager.addBean(codBean);
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/byname/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/byname/ResolutionByNameTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/byname/ResolutionByNameTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -17,7 +17,7 @@
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
- List<Class<? extends Annotation>> deploymentTypes = super.getEnabledDeploymentTypes();
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
deploymentTypes.add(AnotherDeploymentType.class);
return deploymentTypes;
}
@@ -44,13 +44,13 @@
public void testNamedBasedResolution()
{
- Bean<Tuna> tunaBean = getSimpleBean(Tuna.class);
- Bean<Cod> codBean = getSimpleBean(Cod.class);
- Bean<Salmon> salmonBean = getSimpleBean(Salmon.class);
- Bean<Sole> soleBean = getSimpleBean(Sole.class);
- Bean<SeaBass> seaBassBean = getSimpleBean(SeaBass.class);
- Bean<Haddock> haddockBean = getSimpleBean(Haddock.class);
- Bean<Plaice> plaiceBean = getSimpleBean(Plaice.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(tunaBean);
manager.addBean(codBean);
@@ -75,8 +75,8 @@
@Test(groups="resolution") @SpecAssertion(section="5.11.1")
public void testNoWebBeansFound() throws Exception
{
- Bean<Cod> codBean = getSimpleBean(Cod.class);
- Bean<Salmon> salmonBean = getSimpleBean(Salmon.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/clientProxy/ClientProxyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -22,7 +22,7 @@
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
- List<Class<? extends Annotation>> deploymentTypes = super.getEnabledDeploymentTypes();
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
deploymentTypes.add(AnotherDeploymentType.class);
return deploymentTypes;
}
@@ -31,7 +31,7 @@
@SpecAssertion(section = { "5.4" })
public void testClientProxyUsedForNormalScope()
{
- Bean<Tuna> tunaBean = getSimpleBean(Tuna.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
Tuna tuna = manager.getInstance(tunaBean);
assert configuration().getBeans().isProxy(tuna);
@@ -41,7 +41,7 @@
@SpecAssertion(section = { "5.4" })
public void testClientProxyNotUsedForPseudoScope()
{
- Bean<Fox> foxBean = getSimpleBean(Fox.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
try
{
activateDependentContext();
@@ -58,7 +58,7 @@
@SpecAssertion(section = "5.4")
public void testSimpleWebBeanClientProxyIsSerializable() throws IOException, ClassNotFoundException
{
- Bean<TunedTuna> tunaBean = getSimpleBean(TunedTuna.class);
+ Bean<TunedTuna> tunaBean = createSimpleBean(TunedTuna.class);
manager.addBean(tunaBean);
TunedTuna tuna = manager.getInstance(tunaBean);
assert configuration().getBeans().isProxy(tuna);
@@ -72,7 +72,7 @@
@SpecAssertion(section = "5.4.1")
public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedWebBean()
{
- Bean<FinalTuna_Broken> tunaBean = getSimpleBean(FinalTuna_Broken.class);
+ Bean<FinalTuna_Broken> tunaBean = createSimpleBean(FinalTuna_Broken.class);
manager.addBean(tunaBean);
@SuppressWarnings("unused")
FinalTuna_Broken tuna = manager.getInstanceByType(FinalTuna_Broken.class);
@@ -83,7 +83,7 @@
@SpecAssertion(section = "5.4.2")
public void testClientProxyInvocation()
{
- Bean<TunedTuna> tunaBean = getSimpleBean(TunedTuna.class);
+ Bean<TunedTuna> tunaBean = createSimpleBean(TunedTuna.class);
manager.addBean(tunaBean);
TunedTuna tuna = manager.getInstance(tunaBean);
assert configuration().getBeans().isProxy(tuna);
@@ -92,7 +92,7 @@
@Test(groups = "configuration().getBeans()", expectedExceptions=DefinitionException.class)
public void testGettingUnknownBeanFails() {
- Bean<Tuna> tunaBean = getSimpleBean(Tuna.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
@SuppressWarnings("unused")
Tuna tuna = manager.getInstance(tunaBean);
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/injection/InjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/injection/InjectionTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/injection/InjectionTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -23,7 +23,7 @@
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
- List<Class<? extends Annotation>> deploymentTypes = super.getEnabledDeploymentTypes();
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
deploymentTypes.add(AnotherDeploymentType.class);
return deploymentTypes;
}
@@ -32,10 +32,10 @@
@SpecAssertion(section = "5.2")
public void testInjectionPerformsBoxingIfNecessary() throws Exception
{
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ Bean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
- Bean<SpiderNest> spiderNestBean = getSimpleBean(SpiderNest.class);
- manager.addBean(getProducerMethodBean(SpiderProducer.class.getMethod("getWolfSpiderSize"), spiderProducer));
+ Bean<SpiderNest> spiderNestBean = createSimpleBean(SpiderNest.class);
+ manager.addBean(createProducerMethodBean(SpiderProducer.class.getMethod("getWolfSpiderSize"), spiderProducer));
SpiderNest spiderNest = spiderNestBean.create();
assert spiderNest.numberOfSpiders != null;
assert spiderNest.numberOfSpiders.equals(4);
@@ -52,8 +52,8 @@
@SpecAssertion(section = "5.3")
public void testInvokeNormalInjectedWebBeanWhenContextNotActive()
{
- Bean<TunaFarm> tunaFarmBean = getSimpleBean(TunaFarm.class);
- Bean<Tuna> tunaBean = getSimpleBean(Tuna.class);
+ Bean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
TunaFarm tunaFarm = tunaFarmBean.create();
assert tunaFarm.tuna != null;
@@ -65,8 +65,8 @@
@SpecAssertion(section = "5.3")
public void testInvokeDependentScopeWhenContextNotActive()
{
- Bean<FoxRun> foxRunBean = getSimpleBean(FoxRun.class);
- Bean<Fox> foxBean = getSimpleBean(Fox.class);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox.getName().equals("gavin");
@@ -76,8 +76,8 @@
@SpecAssertion(section = "3.7")
public void testInjectingStaticField()
{
- Bean<BeanWithStaticBoundField_Broken> bean = getSimpleBean(BeanWithStaticBoundField_Broken.class);
- Bean<Tuna> tunaBean = getSimpleBean(Tuna.class);
+ Bean<BeanWithStaticBoundField_Broken> bean = createSimpleBean(BeanWithStaticBoundField_Broken.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
bean.create();
}
@@ -86,8 +86,8 @@
@SpecAssertion(section = "3.7")
public void testInjectingFinalField()
{
- Bean<BeanWithFinalBoundField_Broken> bean = getSimpleBean(BeanWithFinalBoundField_Broken.class);
- Bean<Tuna> tunaBean = getSimpleBean(Tuna.class);
+ Bean<BeanWithFinalBoundField_Broken> bean = createSimpleBean(BeanWithFinalBoundField_Broken.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
bean.create();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/manager/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/manager/ManagerTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/manager/ManagerTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -10,7 +10,7 @@
@Test(groups={"manager", "injection", "deployment"}) @SpecAssertion(section="5.8")
public void testInjectingManager()
{
- FishFarmOffice fishFarmOffice = getSimpleBean(FishFarmOffice.class).create();
+ FishFarmOffice fishFarmOffice = createSimpleBean(FishFarmOffice.class).create();
assert fishFarmOffice.manager != null;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/InstantiationByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/InstantiationByTypeTest.java 2009-01-16 18:51:53 UTC (rev 1032)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/lookup/typesafe/InstantiationByTypeTest.java 2009-01-16 18:58:14 UTC (rev 1033)
@@ -24,7 +24,7 @@
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
- List<Class<? extends Annotation>> deploymentTypes = super.getEnabledDeploymentTypes();
+ List<Class<? extends Annotation>> deploymentTypes = super.getStandardDeploymentTypes();
deploymentTypes.add(AnotherDeploymentType.class);
return deploymentTypes;
}
@@ -32,7 +32,7 @@
@Test(groups={"resolution", "beanLifecycle"}) @SpecAssertion(section="5.9")
public void testCurrentBindingTypeAssumed()
{
- Bean<Tuna> tunaBean = getSimpleBean(Tuna.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
assert manager.getInstanceByType(Tuna.class) != null;
}
@@ -65,9 +65,9 @@
@Test(expectedExceptions=AmbiguousDependencyException.class) @SpecAssertion(section="5.9")
public void testAmbiguousDependencies() throws Exception
{
- Bean<Cod> codBean = getSimpleBean(Cod.class);
- Bean<Salmon> salmonBean = getSimpleBean(Salmon.class);
- Bean<Sole> soleBean = getSimpleBean(Sole.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -77,9 +77,9 @@
@Test(expectedExceptions=UnsatisfiedDependencyException.class) @SpecAssertion(section="5.9")
public void testUnsatisfiedDependencies() throws Exception
{
- Bean<Cod> codBean = getSimpleBean(Cod.class);
- Bean<Salmon> salmonBean = getSimpleBean(Salmon.class);
- Bean<Sole> soleBean = getSimpleBean(Sole.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
17 years, 3 months