[jboss-cvs] JBossAS SVN: r79847 - in trunk/testsuite: src/main/org/jboss/test/security/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 21 10:56:49 EDT 2008


Author: mmoyses
Date: 2008-10-21 10:56:49 -0400 (Tue, 21 Oct 2008)
New Revision: 79847

Modified:
   trunk/testsuite/imports/sections/security.xml
   trunk/testsuite/src/main/org/jboss/test/security/test/EJBNullSecurityDomainUnitTestCase.java
Log:
JBAS-5960: verify that everything works after login

Modified: trunk/testsuite/imports/sections/security.xml
===================================================================
--- trunk/testsuite/imports/sections/security.xml	2008-10-21 14:48:42 UTC (rev 79846)
+++ trunk/testsuite/imports/sections/security.xml	2008-10-21 14:56:49 UTC (rev 79847)
@@ -378,6 +378,10 @@
 	   <include name="org/jboss/test/security/ejb/StatelessSessionBean.*"/>
 	   <include name="org/jboss/test/security/interfaces/StatelessSession*"/>
 	</fileset>
+	<fileset dir="${build.resources}/security">
+	   <include name="users.properties"/>
+	   <include name="roles.properties"/>
+        </fileset>
      </jar>
 
      <!--JASPI WEB Form -->

Modified: trunk/testsuite/src/main/org/jboss/test/security/test/EJBNullSecurityDomainUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/security/test/EJBNullSecurityDomainUnitTestCase.java	2008-10-21 14:48:42 UTC (rev 79846)
+++ trunk/testsuite/src/main/org/jboss/test/security/test/EJBNullSecurityDomainUnitTestCase.java	2008-10-21 14:56:49 UTC (rev 79847)
@@ -29,6 +29,8 @@
 import junit.framework.TestSuite;
 
 import org.jboss.security.auth.login.XMLLoginConfigImpl;
+import org.jboss.security.client.SecurityClient;
+import org.jboss.security.client.SecurityClientFactory;
 import org.jboss.test.JBossTestCase;
 import org.jboss.test.JBossTestSetup;
 import org.jboss.test.security.interfaces.StatelessSession;
@@ -59,6 +61,7 @@
       try
       {
          bean = home.create();
+         fail("Invoking create() should fail");
       }
       catch (Exception e)
       {
@@ -66,7 +69,6 @@
          if (t instanceof SecurityException)
          {
             log.debug("Invoking create() was correctly denied by a SecurityException:", e);
-            return;
          }
          else
          {
@@ -74,7 +76,18 @@
             fail("Unexpected exception");
          }
       }
-      fail("Invoking create() should fail");
+      SecurityClient client = SecurityClientFactory.getSecurityClient();
+      client.setSimple("scott", "echoman");
+      client.login();
+      try
+      {
+         bean = home.create();
+         bean.echo("hi");
+      }
+      catch (Exception e)
+      {
+         fail(e.getLocalizedMessage());
+      }
    }
 
    /**




More information about the jboss-cvs-commits mailing list