Author: nickarls
Date: 2008-12-08 08:15:18 -0500 (Mon, 08 Dec 2008)
New Revision: 476
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanDeclarationTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanSpecializationTest.java
Log:
test updates
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanDeclarationTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanDeclarationTest.java 2008-12-08
12:46:28 UTC (rev 475)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanDeclarationTest.java 2008-12-08
13:15:18 UTC (rev 476)
@@ -24,6 +24,17 @@
import org.jboss.webbeans.util.BeanFactory;
import org.testng.annotations.Test;
+/**
+ * Sections
+ *
+ * 3.3. Enterprise Web Beans
+ * 3.3.1. Which EJBs are enterprise Web Beans?
+ * 3.3.2. API types of an enterprise Web Bean
+ * 3.3.3. Declaring an enterprise Web Bean using annotations
+ * 3.3.4. Declaring an enterprise Web Bean using XML
+ *
+ * @author Nicklas Karlsson
+ */
@SpecVersion("20081206")
@SuppressWarnings("unused")
public class EnterpriseBeanDeclarationTest extends AbstractTest
@@ -354,7 +365,7 @@
EnterpriseBean<Pitbull> pitbull =
BeanFactory.createEnterpriseBean(Pitbull.class);
assert pitbull.getName().equals("pitbull");
}
-
+
/**
* An enterprise bean proxy implements all local interfaces of the EJB.
*/
@@ -363,6 +374,6 @@
public void testEnterpriseBeanProxyImplementsAllLocalInterfaces()
{
assert false;
- }
+ }
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java 2008-12-08
12:46:28 UTC (rev 475)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java 2008-12-08
13:15:18 UTC (rev 476)
@@ -1,10 +1,163 @@
package org.jboss.webbeans.test.ejb;
+import javax.webbeans.UnremovedException;
+
import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
+import org.testng.annotations.Test;
+/**
+ * Sections
+ *
+ * 6.4. Lifecycle of stateful session enterprise Web beans
+ * 6.5. Lifecycle of stateless session and singleton enterprise Web Beans
+ * 6.9. Lifecycle of EJB beans
+ *
+ * Mostly overlapping with other tests...
+ *
+ * @author Nicklas Karlsson
+ */
+
@SpecVersion("20081206")
public class EnterpriseBeanLifecycleTest extends AbstractTest
{
- // 6.4, 6.5 & 6.9
+
+ /**
+ * When the create() method is called, the Web Bean manager creates and
+ * returns an enterprise bean proxy
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle", "stub"
})
+ @SpecAssertion(section = "6.4")
+ public void testProxyCreated()
+ {
+ assert false;
+ }
+
+ /**
+ * When the destroy() method is called, the Web Bean manager calls the Web
+ * Bean remove method upon the proxy
+ */
+ @Test(groups = { "enterpriseBeans", "clientProxy",
"lifecycle", "stub" })
+ @SpecAssertion(section = "6.4")
+ public void testRemoveMethodCalled()
+ {
+ assert false;
+ }
+
+ /**
+ * For each remove method parameter, the Web Bean manager passes the object
+ * returned by Manager.getInstanceByType()
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle",
"removeMethod", "stub" })
+ @SpecAssertion(section = "6.4")
+ public void testFieldInjections()
+ {
+ assert false;
+ }
+
+ /**
+ * If the enterprise Web Bean has no Web Bean remove method, the Web Bean
+ * manager throws an UnremovedException.
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle",
"removeMethod", "stub" }, expectedExceptions =
UnremovedException.class)
+ @SpecAssertion(section = "6.4")
+ public void testNoRemoveMethodFails()
+ {
+ assert false;
+ }
+
+ /**
+ * If the underlying EJB was already destroyed by direct invocation of a
+ * remove method by the application, the Web Bean manager ignores the
+ * instance, and is not required to call any remove method
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle",
"removeMethod", "stub" })
+ @SpecAssertion(section = "6.4")
+ public void testNoRemoveMethodsCalledIfEnterpriseBeanAlreadyRemoved()
+ {
+ assert false;
+ }
+
+ /**
+ * When the destroy() method is called, the Web Bean manager simply discards
+ * the proxy and all EJB local object references.
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle",
"removeMethod", "stub" })
+ @SpecAssertion(section = "6.5")
+ public void testProxyAndLocalObjectReferencesDiscardedForStatelessEnterpriseBeans()
+ {
+ assert false;
+ }
+
+ /**
+ * The Web Bean manager initializes the values of all injected fields. For
+ * each injected field, the Web Bean manager sets the value to the object
+ * returned by Manager.getInstanceByType().
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle", "stub"
})
+ @SpecAssertion(section = "6.9")
+ public void testFieldInjectionsOnRemoveMethods()
+ {
+ assert false;
+ }
+
+ /**
+ * Next, if the EJB bean instance is an instance of a Web Bean, the Web Bean
+ * manager initializes the values of any fields with initial values specified
+ * in XML,
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle", "stub"
})
+ @SpecAssertion(section = "6.9")
+ public void testInitXMLDefinedValuesOnWebWeanEnterpriseBeans()
+ {
+ assert false;
+ }
+
+ /**
+ * Next, the Web Bean manager calls all initializer methods. For each
+ * initializer method parameter, the Web Bean manager passes the object
+ * returned by Manager.getInstanceByType().
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle", "stub"
})
+ @SpecAssertion(section = "6.9")
+ public void testInitializerMethodsCalledWithCurrentParameterValues()
+ {
+ assert false;
+ }
+
+ /**
+ * Finally, the Web Bean manager builds the interceptor and decorator stacks
+ * for the instance
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle",
"interceptors", "stub" })
+ @SpecAssertion(section = "6.9")
+ public void testInterceptorStackIsBuilt()
+ {
+ assert false;
+ }
+
+ /**
+ * Finally, the Web Bean manager builds the interceptor and decorator stacks
+ * for the instance
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle",
"decorators", "stub" })
+ @SpecAssertion(section = "6.9")
+ public void testDecoratorStackIsBuilt()
+ {
+ assert false;
+ }
+
+ /**
+ * When the EJB container destroys an instance of an EJB bean, the Web Bean
+ * manager intercepts the @PreDestroy callback and destroys all dependent
+ * objects, after the callback returns from the bean instance
+ */
+ @Test(groups = { "enterpriseBeans", "lifecycle", "stub"
})
+ @SpecAssertion(section = "6.9")
+ public void testDependentObjectsDestroyed()
+ {
+ assert false;
+ }
+
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java 2008-12-08
12:46:28 UTC (rev 475)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java 2008-12-08
13:15:18 UTC (rev 476)
@@ -24,6 +24,16 @@
import org.jboss.webbeans.util.BeanFactory;
import org.testng.annotations.Test;
+/**
+ * Sections
+ *
+ * 3.3.5. Web Bean remove methods
+ * 3.3.5.1. Declaring a Web Bean remove method using annotations.
+ * 3.3.5.2. Declaring a Web Bean remove method using XML
+ * 3.3.5.3. Remove method parameters
+ *
+ * @author Nicklas Karlsson
+ */
@SpecVersion("20081206")
@SuppressWarnings("unused")
public class EnterpriseBeanRemoveMethodTest extends AbstractTest
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanSpecializationTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanSpecializationTest.java 2008-12-08
12:46:28 UTC (rev 475)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanSpecializationTest.java 2008-12-08
13:15:18 UTC (rev 476)
@@ -13,6 +13,13 @@
import org.jboss.webbeans.util.BeanFactory;
import org.testng.annotations.Test;
+/**
+ * Sections
+ *
+ * 3.3.6. Specializing an enterprise Web Bean
+ *
+ * @author Nicklas Karlsson
+ */
@SpecVersion("20081206")
public class EnterpriseBeanSpecializationTest extends AbstractTest
{