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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 22 05:30:44 EST 2008


Author: wolfc
Date: 2008-12-22 05:30:44 -0500 (Mon, 22 Dec 2008)
New Revision: 82464

Modified:
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/changexml/unit/ChangeXMLUnitTestCase.java
Log:
EJBTHREE-1241: using fake credentials to exercise the security domain change

Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/changexml/unit/ChangeXMLUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/changexml/unit/ChangeXMLUnitTestCase.java	2008-12-22 09:41:20 UTC (rev 82463)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/changexml/unit/ChangeXMLUnitTestCase.java	2008-12-22 10:30:44 UTC (rev 82464)
@@ -23,11 +23,21 @@
 
 import java.io.File;
 
+import junit.framework.Test;
+
 import org.jboss.ejb3.test.changexml.TesterRemote;
+import org.jboss.security.client.SecurityClient;
+import org.jboss.security.client.SecurityClientFactory;
 import org.jboss.test.JBossTestCase;
-import junit.framework.Test;
 
 /**
+ * The purpose of this test is to show that the meta data bridges dynamically
+ * pick up configuration changes.
+ * 
+ * As an example we modify the security domain. Note that because we have
+ * an unauthenticated principal on the "other" security domain, we set some fake
+ * credentials to make sure the security domain gets exercised.
+ * 
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
  */
 public class ChangeXMLUnitTestCase extends JBossTestCase
@@ -39,10 +49,20 @@
    
    public void testChangeXML() throws Exception
    {
-      TesterRemote tester = (TesterRemote)getInitialContext().lookup("TesterBean/remote");
-      String deployDir = System.getProperty("jbosstest.deploy.dir");
-      File file = new File(deployDir + "/" + "changexml.jar"); 
-      tester.runTest(file.toURL());
+      SecurityClient client = SecurityClientFactory.getSecurityClient();
+      client.setSimple("somebody", "password");
+      client.login();
+      try
+      {
+         TesterRemote tester = (TesterRemote)getInitialContext().lookup("TesterBean/remote");
+         String deployDir = System.getProperty("jbosstest.deploy.dir");
+         File file = new File(deployDir + "/" + "changexml.jar"); 
+         tester.runTest(file.toURL());
+      }
+      finally
+      {
+         client.logout();
+      }
    }
 
    public static Test suite() throws Exception




More information about the jboss-cvs-commits mailing list