[jboss-cvs] JBossAS SVN: r81698 - projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/jacc/unit.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Nov 27 02:39:45 EST 2008
Author: ALRubinger
Date: 2008-11-27 02:39:45 -0500 (Thu, 27 Nov 2008)
New Revision: 81698
Modified:
projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/jacc/unit/JaccTestCase.java
Log:
[EJBTHREE-1241] Log out and log in again after changing security credentials in "jacc" tests
Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/jacc/unit/JaccTestCase.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/jacc/unit/JaccTestCase.java 2008-11-27 05:36:09 UTC (rev 81697)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/jacc/unit/JaccTestCase.java 2008-11-27 07:39:45 UTC (rev 81698)
@@ -24,17 +24,17 @@
import javax.ejb.EJBAccessException;
import javax.ejb.EJBException;
+
+import junit.framework.Test;
+
import org.jboss.ejb3.test.jacc.AllEntity;
import org.jboss.ejb3.test.jacc.SomeEntity;
import org.jboss.ejb3.test.jacc.StarEntity;
import org.jboss.ejb3.test.jacc.Stateful;
import org.jboss.ejb3.test.jacc.Stateless;
-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;
/**
*
@@ -98,7 +98,9 @@
result = stateless.checked(50);
assertEquals(50,result);
+ client.logout();
client.setSimple(JaccTestCase.PRINCIPAL_ROLEFAIL, JaccTestCase.PASSWORD_PASSWORD);
+ client.login();
boolean securityException = false;
try
@@ -145,12 +147,13 @@
System.out.println("Bad role");
client.setSimple(JaccTestCase.PRINCIPAL_ROLEFAIL, JaccTestCase.PASSWORD_PASSWORD);
+ client.logout();
+ client.login();
- AllEntity ae2 = null;
try
{
System.out.println("Inserting...");
- ae2 = stateless.insertAllEntity();
+ stateless.insertAllEntity();
throw new FailedException("Insert check not done for AllEntity");
}
catch(FailedException ex)
@@ -165,7 +168,7 @@
try
{
System.out.println("Reading...");
- ae2 = stateless.readAllEntity(e.id);
+ stateless.readAllEntity(e.id);
throw new FailedException("Read check not done for AllEntity");
}
catch(FailedException ex)
@@ -245,12 +248,13 @@
System.out.println("Bad role");
client.setSimple(JaccTestCase.PRINCIPAL_ROLEFAIL, JaccTestCase.PASSWORD_PASSWORD);
+ client.logout();
+ client.login();
- StarEntity ae2 = null;
try
{
System.out.println("Inserting...");
- ae2 = stateless.insertStarEntity();
+ stateless.insertStarEntity();
throw new FailedException("Insert check not done for StarEntity");
}
catch(FailedException ex)
@@ -265,7 +269,7 @@
try
{
System.out.println("Reading...");
- ae2 = stateless.readStarEntity(e.id);
+ stateless.readStarEntity(e.id);
throw new FailedException("Read check not done for StarEntity");
}
catch(FailedException ex)
@@ -372,12 +376,13 @@
System.out.println("Bad role");
client.setSimple(JaccTestCase.PRINCIPAL_ROLEFAIL, JaccTestCase.PASSWORD_PASSWORD);
+ client.logout();
+ client.login();
- SomeEntity ae2 = null;
try
{
System.out.println("Inserting...");
- ae2 = stateless.insertSomeEntity();
+ stateless.insertSomeEntity();
throw new FailedException("Insert check not done for SomeEntity");
}
catch(FailedException ex)
More information about the jboss-cvs-commits
mailing list