[jboss-cvs] JBossAS SVN: r82465 - projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/service/unit.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 22 07:17:04 EST 2008


Author: wolfc
Date: 2008-12-22 07:17:04 -0500 (Mon, 22 Dec 2008)
New Revision: 82465

Modified:
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/service/unit/ServiceUnitTestCase.java
Log:
EJBTHREE-1241: using invalid credentials instead of relying on unauthenticated principal

Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/service/unit/ServiceUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/service/unit/ServiceUnitTestCase.java	2008-12-22 10:30:44 UTC (rev 82464)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/service/unit/ServiceUnitTestCase.java	2008-12-22 12:17:04 UTC (rev 82465)
@@ -28,7 +28,6 @@
 import javax.management.AttributeList;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
-import javax.naming.Context;
 
 import junit.framework.Test;
 
@@ -38,8 +37,6 @@
 import org.jboss.ejb3.test.service.ServiceTwoRemote;
 import org.jboss.ejb3.test.service.SessionRemote;
 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;
@@ -84,11 +81,12 @@
    
    public void testSecurityDomain() throws Exception
    {
+      SecurityClient client = SecurityClientFactory.getSecurityClient();
+      client.setSimple("invalid", "invalid");
+      client.login();
+      
       try
       {
-         SecurityClient client = SecurityClientFactory.getSecurityClient();
-         client.logout();
-         
          ServiceOneRemote test = (ServiceOneRemote) getInitialContext().lookup("ServiceOne/remote");
          test.testEjbInjection();
          fail("Should have thrown EJBAccessException");
@@ -97,6 +95,10 @@
       {
          
       }
+      finally
+      {
+         client.logout();
+      }
    }
 
    public void testServiceWithDefaultRemoteJNDIName() throws Exception




More information about the jboss-cvs-commits mailing list