Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@476 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
nickarls committed Dec 8, 2008
1 parent a2281e2 commit e4af55d
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 3 deletions.
Expand Up @@ -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
Expand Down Expand Up @@ -354,7 +365,7 @@ public void testDefaultName()
EnterpriseBean<Pitbull> pitbull = BeanFactory.createEnterpriseBean(Pitbull.class);
assert pitbull.getName().equals("pitbull");
}

/**
* An enterprise bean proxy implements all local interfaces of the EJB.
*/
Expand All @@ -363,6 +374,6 @@ public void testDefaultName()
public void testEnterpriseBeanProxyImplementsAllLocalInterfaces()
{
assert false;
}
}

}
@@ -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;
}

}
Expand Up @@ -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
Expand Down
Expand Up @@ -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
{
Expand Down

0 comments on commit e4af55d

Please sign in to comment.