[jboss-cvs] JBossAS SVN: r58372 - trunk/testsuite/src/main/org/jboss/test/web/servlets
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Nov 14 21:02:45 EST 2006
Author: scott.stark at jboss.org
Date: 2006-11-14 21:02:43 -0500 (Tue, 14 Nov 2006)
New Revision: 58372
Modified:
trunk/testsuite/src/main/org/jboss/test/web/servlets/StandaloneENCServlet.java
Log:
Simplify the ejb tests
Modified: trunk/testsuite/src/main/org/jboss/test/web/servlets/StandaloneENCServlet.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/web/servlets/StandaloneENCServlet.java 2006-11-15 02:02:07 UTC (rev 58371)
+++ trunk/testsuite/src/main/org/jboss/test/web/servlets/StandaloneENCServlet.java 2006-11-15 02:02:43 UTC (rev 58372)
@@ -42,7 +42,7 @@
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
-import org.jboss.test.cts.interfaces.CtsBmpHome;
+import org.jboss.test.web.mock.EntityHome;
import org.jboss.test.web.interfaces.StatelessSessionHome;
import org.jboss.test.web.interfaces.StatelessSessionLocalHome;
@@ -87,7 +87,7 @@
{
try
{
- // Obtain the enterprise bean�s environment naming context.
+ // Obtain the environment naming context.
Context initCtx = new InitialContext();
Hashtable env = initCtx.getEnvironment();
Iterator keys = env.keySet().iterator();
@@ -144,67 +144,22 @@
private void testEjbRefs(Context initCtx, Context myEnv) throws NamingException
{
- // EJB References
- Object ejb = myEnv.lookup("ejb/bean0");
- if ((ejb instanceof StatelessSessionHome) == false)
- throw new NamingException("ejb/bean0 is not a StatelessSessionHome");
- log.debug("ejb/bean0 = " + ejb);
- ejb = initCtx.lookup("java:comp/env/ejb/bean1");
- if ((ejb instanceof StatelessSessionHome) == false)
- throw new NamingException("ejb/bean1 is not a StatelessSessionHome");
- log.debug("ejb/bean1 = " + ejb);
- ejb = initCtx.lookup("java:comp/env/ejb/bean2");
- if ((ejb instanceof StatelessSessionHome) == false)
- throw new NamingException("ejb/bean2 is not a StatelessSessionHome");
- log.debug("ejb/bean2 = " + ejb);
//do lookup on bean specified without ejb-link
- ejb = initCtx.lookup("java:comp/env/ejb/bean3");
+ Object ejb = initCtx.lookup("java:comp/env/ejb/bean3");
if ((ejb instanceof StatelessSessionHome) == false)
throw new NamingException("ejb/bean3 is not a StatelessSessionHome");
log.debug("ejb/bean3 = " + ejb);
- ejb = initCtx.lookup("java:comp/env/ejb/UnsecuredEJB");
- if ((ejb instanceof StatelessSessionHome) == false)
- throw new NamingException("ejb/UnsecuredEJB is not a StatelessSessionHome");
- log.debug("ejb/UnsecuredEJB = " + ejb);
- ejb = initCtx.lookup("java:comp/env/ejb/SecuredEJB");
- if ((ejb instanceof StatelessSessionHome) == false)
- throw new NamingException("ejb/SecuredEJB is not a StatelessSessionHome");
- log.debug("ejb/SecuredEJB = " + ejb);
ejb = initCtx.lookup("java:comp/env/ejb/CtsBmp");
- if ((ejb instanceof CtsBmpHome) == false)
- throw new NamingException("ejb/CtsBmp is not a CtsBmpHome");
- log.debug("ejb/CtsBmp = " + ejb);
- ejb = initCtx.lookup("java:comp/env/ejb/RelativeBean");
- if ((ejb instanceof StatelessSessionHome) == false )
- throw new NamingException("ejb/RelativeBean is not a StatelessSessionHome");
- log.debug("ejb/RelativeBean = " + ejb);
+ if ((ejb instanceof EntityHome) == false)
+ throw new NamingException("ejb/CtsBmp is not a EntityHome");
- // EJB Local References
- ejb = initCtx.lookup("java:comp/env/ejb/local/bean0");
- if ((ejb instanceof StatelessSessionLocalHome) == false)
- throw new NamingException("ejb/local/bean0 is not a StatelessSessionLocalHome");
- log.debug("ejb/local/bean0 = " + ejb);
- ejb = initCtx.lookup("java:comp/env/ejb/local/bean1");
- if ((ejb instanceof StatelessSessionLocalHome) == false)
- throw new NamingException("ejb/local/bean1 is not a StatelessSessionLocalHome");
- log.debug("ejb/local/bean1 = " + ejb);
-
//lookup of local-ejb-ref bean specified without ejb-link
ejb = initCtx.lookup("java:comp/env/ejb/local/bean3");
if ((ejb instanceof StatelessSessionLocalHome) == false)
throw new NamingException("ejb/local/bean3 is not a StatelessSessionLocalHome");
log.debug("ejb/local/bean3 = " + ejb);
-
- ejb = initCtx.lookup("java:comp/env/ejb/local/OptimizedEJB");
- if ((ejb instanceof StatelessSessionLocalHome) == false)
- throw new NamingException("ejb/local/OptimizedEJB is not a StatelessSessionLocalHome");
- log.debug("ejb/local/OptimizedEJB = " + ejb);
- ejb = initCtx.lookup("java:comp/env/ejb/local/RelativeBean");
- if ((ejb instanceof StatelessSessionLocalHome) == false )
- throw new NamingException("ejb/local/RelativeBean is not a StatelessSessionLocalHome");
- log.debug("ejb/local/RelativeBean = " + ejb);
}
private void testJdbcDataSource(Context initCtx, Context myEnv) throws NamingException
More information about the jboss-cvs-commits
mailing list