[webbeans-commits] Webbeans SVN: r513 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sat Dec 13 16:51:48 EST 2008
Author: nickarls
Date: 2008-12-13 16:51:48 -0500 (Sat, 13 Dec 2008)
New Revision: 513
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
Log:
update tests to 20081206
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-11 11:36:01 UTC (rev 512)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-13 21:51:48 UTC (rev 513)
@@ -18,11 +18,16 @@
import org.jboss.webbeans.test.beans.Tarantula;
import org.testng.annotations.Test;
- at SpecVersion("PDR")
+ at SpecVersion("20081206")
public class DependentContextTest extends AbstractTest
{
-
- @Test(groups={"contexts", "injection"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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 = createSimpleBean(FoxRun.class);
@@ -31,17 +36,28 @@
FoxRun foxRun = foxRunBean.create();
assert !foxRun.fox.equals(foxRun.anotherFox);
}
-
- @Test(groups={"stub", "contexts", "el"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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;
}
-
- @Test(groups={"contexts", "producerMethod"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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" })
+ @SpecAssertion(section = "9.4")
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTarantula");
ProducerMethodBean<Tarantula> tarantulaBean = createProducerMethodBean(Tarantula.class, method, spiderProducer);
@@ -51,14 +67,50 @@
assert tarantula2 != null;
assert tarantula != tarantula2;
}
-
- @Test(groups={"stub", "contexts", "observerMethod"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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;
}
-
- @Test(groups="contexts") @SpecAssertion(section="9.4")
+
+ /**
+ * 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 = createSimpleBean(Fox.class);
@@ -68,8 +120,13 @@
assert context.get(foxBean, true) != null;
assert context.get(foxBean, true) instanceof Fox;
}
-
- @Test(groups="contexts") @SpecAssertion(section="9.4")
+
+ /**
+ * 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 = createSimpleBean(Fox.class);
@@ -78,27 +135,81 @@
context.setActive(true);
assert context.get(foxBean, false) == null;
}
-
- @Test(groups="contexts", expectedExceptions=ContextNotActiveException.class) @SpecAssertion(section="9.4")
+
+ /**
+ * The @Dependent scope is inactive except:
+ */
+ @Test(groups = "contexts", expectedExceptions = ContextNotActiveException.class)
+ @SpecAssertion(section = "9.4")
public void testContextIsInactive()
{
manager.getContext(Dependent.class).isActive();
}
-
- @Test(groups={"stub", "contexts", "observerMethod"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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;
}
-
-
- @Test(groups={"stub", "contexts", "el"}) @SpecAssertion(section="9.4")
+
+ /**
+ * while a Unified EL expression is evaluated, or
+ */
+ @Test(groups = { "stub", "contexts", "el" })
+ @SpecAssertion(section = "9.4")
public void testContextIsActiveWhenEvaluatingElExpression()
{
assert false;
}
-
- @Test(groups={"contexts", "beanLifecycle"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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
@@ -108,14 +219,24 @@
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox != null;
}
-
- @Test(groups={"stub", "contexts", "beanDestruction"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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;
}
-
- @Test(groups={"contexts", "injection"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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);
@@ -124,59 +245,334 @@
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox != null;
}
-
- @Test(groups={"stub", "contexts", "ejb3"}) @SpecAssertion(section="9.4")
- public void testEjbBeanMayMayCreateInstanceFromInitializer()
+
+ /**
+ * 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;
}
-
- @Test(groups={"stub", "contexts", "ejb3"}) @SpecAssertion(section="9.4")
- public void testEjbBeanMayMayCreateInstanceFromPostConstruct()
+
+ /**
+ * 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;
}
-
- @Test(groups={"stub", "contexts", "ejb3"}) @SpecAssertion(section="9.4")
- public void testEjbBeanMayMayCreateInstanceFromPreDestroy()
+
+ /**
+ * 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;
}
-
- @Test(groups={"stub", "contexts", "servlet"}) @SpecAssertion(section="9.4")
- public void testServletBeanMayMayCreateInstanceFromInitializer()
+
+ /**
+ * 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;
}
-
- @Test(groups={"stub", "contexts", "beanDestruction"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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;
}
-
- @Test(groups={"stub", "contexts", "ejb3"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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;
}
-
- @Test(groups={"stub", "contexts", "servlet"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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;
}
-
- @Test(groups={"stub", "contexts", "el"}) @SpecAssertion(section="9.4")
+
+ /**
+ * 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;
+ }
- @Test(groups={"stub", "contexts", "observerMethod"}) @SpecAssertion(section="9.4")
+ /**
+ * 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;
}
-
+
}
More information about the weld-commits
mailing list