[jboss-cvs] JBossAS SVN: r79946 - in projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial: unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 22 18:19:21 EDT 2008


Author: ALRubinger
Date: 2008-10-22 18:19:21 -0400 (Wed, 22 Oct 2008)
New Revision: 79946

Modified:
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/SecurityTester.java
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/Tester.java
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/TxTester.java
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/unit/RemoteUnitTestCase.java
Log:
[EJBTHREE-1241] Fix JNDI lookup names to expose test failures in "initial" tests

Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/SecurityTester.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/SecurityTester.java	2008-10-22 22:18:17 UTC (rev 79945)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/SecurityTester.java	2008-10-22 22:19:21 UTC (rev 79946)
@@ -25,8 +25,6 @@
 import javax.naming.InitialContext;
 
 import org.jboss.logging.Logger;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SimplePrincipal;
 import org.jboss.security.client.SecurityClient;
 import org.jboss.security.client.SecurityClientFactory;
 
@@ -44,7 +42,7 @@
    public void testSecurityAssociation() throws Exception
    {
       InitialContext ctx = new InitialContext();
-      SecuredTest test = (SecuredTest) ctx.lookup("SecuredTestBean/local");
+      SecuredTest test = (SecuredTest) ctx.lookup("initial-ejb3-test/SecuredTestBean/local");
 
       SecurityClient client = SecurityClientFactory.getSecurityClient();
       client.setSimple("somebody", "password");
@@ -102,7 +100,7 @@
    {
       
       InitialContext ctx = new InitialContext();
-      SecuredTest test = (SecuredTest) ctx.lookup("SecuredTestBean/local");
+      SecuredTest test = (SecuredTest) ctx.lookup("initial-ejb3-test/SecuredTestBean/local");
 
       SecurityClient sc = SecurityClientFactory.getSecurityClient();
       sc.setSimple("somebody","password");

Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/Tester.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/Tester.java	2008-10-22 22:18:17 UTC (rev 79945)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/Tester.java	2008-10-22 22:19:21 UTC (rev 79946)
@@ -22,6 +22,7 @@
 package org.jboss.ejb3.test.initial;
 
 import java.util.Map;
+
 import javax.naming.InitialContext;
 
 /**
@@ -35,8 +36,8 @@
    public void testSLSBCollocation() throws Exception
    {
       InitialContext ctx = new InitialContext();
-      TestLocal local = (TestLocal) ctx.lookup("TestBean/local");
-      TestRemote remote = (TestRemote) ctx.lookup("TestBean/remote");
+      TestLocal local = (TestLocal) ctx.lookup("initial-ejb3-test/TestBean/local");
+      TestRemote remote = (TestRemote) ctx.lookup("initial-ejb3-test/TestBean/remote");
 
       if (local.getObject() != TestBean.obj) throw new RuntimeException("Local call not equal");
       if (local.getObject() == remote.getObject()) throw new RuntimeException("Remote should not be equal");
@@ -60,8 +61,8 @@
    public void testSFSBCollocation() throws Exception
    {
       InitialContext ctx = new InitialContext();
-      StatefulTestLocal local = (StatefulTestLocal) ctx.lookup("StatefulTestBean/local");
-      StatefulTestRemote remote = (StatefulTestRemote) ctx.lookup("StatefulTestBean/remote");
+      StatefulTestLocal local = (StatefulTestLocal) ctx.lookup("initial-ejb3-test/StatefulTestBean/local");
+      StatefulTestRemote remote = (StatefulTestRemote) ctx.lookup("initial-ejb3-test/StatefulTestBean/remote");
 
       if (local.getObject() != StatefulTestBean.obj) throw new RuntimeException("Local call not equal");
       if (local.getObject() == remote.getObject()) throw new RuntimeException("Remote should not be equal");
@@ -84,7 +85,7 @@
    public void test() throws Exception
    {
       InitialContext ctx = new InitialContext();
-      Test test = (Test) ctx.lookup("TestBean/local");
+      Test test = (Test) ctx.lookup("initial-ejb3-test/TestBean/local");
       String echo = test.testMe("echo");
       if (!"echo".equals(echo)) throw new RuntimeException("ECHO FAILED!");
    }
@@ -92,7 +93,7 @@
    public void statefulTest() throws Exception
    {
       InitialContext ctx = new InitialContext();
-      StatefulTestLocal test = (StatefulTestLocal) ctx.lookup("StatefulTestBean/local");
+      StatefulTestLocal test = (StatefulTestLocal) ctx.lookup("initial-ejb3-test/StatefulTestBean/local");
       test.setState("hello world");
       if (!test.getState().equals("hello world")) throw new Exception("state was not retained");
    }
@@ -100,7 +101,7 @@
    public void testInterceptors() throws Exception
    {
       InitialContext ctx = new InitialContext();
-      InterceptedSLTest test = (InterceptedSLTest) ctx.lookup("InterceptedSLTestBean/local");
+      InterceptedSLTest test = (InterceptedSLTest) ctx.lookup("initial-ejb3-test/InterceptedSLTestBean/local");
       int ret = test.testMethod(5);
       int expected = 3010;
 
@@ -122,9 +123,9 @@
    {
       //Check the correct callbacks get invoked
       InitialContext ctx = new InitialContext();
-      TestStatus status = (TestStatus) ctx.lookup("TestStatusBean/remote");
+      TestStatus status = (TestStatus) ctx.lookup("initial-ejb3-test/TestStatusBean/remote");
       status.clear();
-      InterceptedSLTest test = (InterceptedSLTest) ctx.lookup("InterceptedSLTestBean/local");
+      InterceptedSLTest test = (InterceptedSLTest) ctx.lookup("initial-ejb3-test/InterceptedSLTestBean/local");
       test.testMethod(5);
       if (!status.postConstruct()) throw new Exception("PostConstruct should be called for SLSB");
       if (status.prePassivate()) throw new Exception("PrePassivate should not be called for SLSB");

Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/TxTester.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/TxTester.java	2008-10-22 22:18:17 UTC (rev 79945)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/TxTester.java	2008-10-22 22:19:21 UTC (rev 79946)
@@ -39,7 +39,7 @@
    {
       InitialContext ctx = new InitialContext();
       TransactionManager tm = TransactionManagerLocator.locateTransactionManager();
-      TestLocal test = (TestLocal) ctx.lookup("TestBean/local");
+      TestLocal test = (TestLocal) ctx.lookup("initial-ejb3-test/TestBean/local");
       callNever(tm, test);
       callNotSupported(tm, test);
       callSupportsWithTx(tm, test);

Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/unit/RemoteUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/unit/RemoteUnitTestCase.java	2008-10-22 22:18:17 UTC (rev 79945)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/initial/unit/RemoteUnitTestCase.java	2008-10-22 22:19:21 UTC (rev 79946)
@@ -24,18 +24,18 @@
 import javax.ejb.EJBAccessException;
 import javax.naming.InitialContext;
 import javax.transaction.UserTransaction;
+
+import junit.framework.Test;
+
 import org.jboss.ejb3.test.initial.ClassInjected;
 import org.jboss.ejb3.test.initial.InterceptedSFTest;
-import org.jboss.ejb3.test.initial.SecuredTest; 
+import org.jboss.ejb3.test.initial.SecuredTest;
 import org.jboss.ejb3.test.initial.StatefulTestRemote;
 import org.jboss.ejb3.test.initial.TestRemote;
 import org.jboss.logging.Logger;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SimplePrincipal;
 import org.jboss.security.client.SecurityClient;
 import org.jboss.security.client.SecurityClientFactory;
 import org.jboss.test.JBossTestCase;
-import junit.framework.Test;
 
 /**
  * Sample client for the jboss container.
@@ -61,7 +61,7 @@
 
    public void testStateful() throws Exception
    {
-      StatefulTestRemote test = (StatefulTestRemote) getInitialContext().lookup("StatefulTestBean/remote");
+      StatefulTestRemote test = (StatefulTestRemote) getInitialContext().lookup("initial-ejb3-test/StatefulTestBean/remote");
       test.setState("hello world");
       assertEquals(test.getState(), "hello world");
       test.endSession();
@@ -70,7 +70,7 @@
 
    public void testSimple() throws Exception
    {
-      TestRemote test = (TestRemote) this.getInitialContext().lookup("TestBean/remote");
+      TestRemote test = (TestRemote) this.getInitialContext().lookup("initial-ejb3-test/TestBean/remote");
       String echo = test.testMe("echo");
       assertEquals(echo, "echo");
    }
@@ -79,7 +79,7 @@
    {
       // Test basic tx propagation
       UserTransaction ut = (UserTransaction) getInitialContext().lookup("UserTransaction");
-      TestRemote test = (TestRemote) this.getInitialContext().lookup("TestBean/remote");
+      TestRemote test = (TestRemote) this.getInitialContext().lookup("initial-ejb3-test/TestBean/remote");
       ut.begin();
       test.mandatory();
       // call mandatory a second time to test that TX has been dissacciated correctly
@@ -92,7 +92,7 @@
    {
       // Test basic security propagation
       InitialContext ctx = getInitialContext();
-      SecuredTest test = (SecuredTest) ctx.lookup("SecuredTestBean/remote");
+      SecuredTest test = (SecuredTest) ctx.lookup("initial-ejb3-test/SecuredTestBean/remote");
       
       SecurityClient client = SecurityClientFactory.getSecurityClient();
       client.setSimple("somebody", "password");
@@ -153,7 +153,7 @@
 
    public void testInterceptors() throws Exception
    {
-      InterceptedSFTest test = (InterceptedSFTest) this.getInitialContext().lookup("InterceptedSFTestBean/remote");
+      InterceptedSFTest test = (InterceptedSFTest) this.getInitialContext().lookup("initial-ejb3-test/InterceptedSFTestBean/remote");
       int ret = test.testMethod(5);
       int expected = 1010;
       if (ret != expected) throw new Exception("return value was not " + expected + ", it was: " + ret);
@@ -162,9 +162,9 @@
    public void testCallbacks() throws Exception
    {
       org.jboss.ejb3.test.initial.TestStatus status =
-      (org.jboss.ejb3.test.initial.TestStatus) getInitialContext().lookup("TestStatusBean/remote");
+      (org.jboss.ejb3.test.initial.TestStatus) getInitialContext().lookup("initial-ejb3-test/TestStatusBean/remote");
       status.clear();
-      InterceptedSFTest test = (InterceptedSFTest) getInitialContext().lookup("InterceptedSFTestBean/remote");
+      InterceptedSFTest test = (InterceptedSFTest) getInitialContext().lookup("initial-ejb3-test/InterceptedSFTestBean/remote");
 
       test.testMethod(5);
       int val = test.getVal();
@@ -172,7 +172,7 @@
       if (!status.postConstruct()) throw new Exception("PostConstruct should be called for SFSB");
 
       //Exhaust cache to force passivation
-      InterceptedSFTest test2 = (InterceptedSFTest) getInitialContext().lookup("InterceptedSFTestBean/remote");
+      InterceptedSFTest test2 = (InterceptedSFTest) getInitialContext().lookup("initial-ejb3-test/InterceptedSFTestBean/remote");
       test2.testMethod(3);
 
       if (!status.prePassivate()) throw new Exception("PrePassivate should be called for SFSB");
@@ -191,7 +191,7 @@
 
    public void testClassInjected() throws Exception
    {
-      ClassInjected test = (ClassInjected)getInitialContext().lookup("ClassInjectedBean/remote");
+      ClassInjected test = (ClassInjected)getInitialContext().lookup("initial-ejb3-test/ClassInjectedBean/remote");
       assertTrue(test.isInjected());
    }
 




More information about the jboss-cvs-commits mailing list