User: starksm 
  Date: 01/07/29 09:32:42

  Modified:    src/main/org/jboss/test/perf/test Tag: Branch_2_4 Setup.java
  Log:
  Need to flush the security manager authentication cache as different tests
  use the same security domain with different user to role mappings
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.3   +18 -1     jbosstest/src/main/org/jboss/test/perf/test/Setup.java
  
  Index: Setup.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/test/Setup.java,v
  retrieving revision 1.2.2.2
  retrieving revision 1.2.2.3
  diff -u -r1.2.2.2 -r1.2.2.3
  --- Setup.java        2001/07/18 20:10:37     1.2.2.2
  +++ Setup.java        2001/07/29 16:32:42     1.2.2.3
  @@ -1,8 +1,10 @@
   package org.jboss.test.perf.test;
   
   import java.io.IOException;
  +import java.net.InetAddress;
   import java.rmi.RemoteException;
   import javax.ejb.CreateException;
  +import javax.management.ObjectName;
   import javax.naming.InitialContext;
   import javax.naming.NamingException;
   import javax.rmi.PortableRemoteObject;
  @@ -11,6 +13,7 @@
   import junit.extensions.TestSetup;
   import junit.framework.TestSuite;
   
  +import org.jboss.jmx.interfaces.RMIConnector;
   import org.jboss.test.perf.interfaces.Entity;
   import org.jboss.test.perf.interfaces.EntityPK;
   import org.jboss.test.perf.interfaces.Entity2PK;
  @@ -23,7 +26,7 @@
   /** Setup utility class.
    
    @author [EMAIL PROTECTED]
  - @version $Revision: 1.2.2.2 $
  + @version $Revision: 1.2.2.3 $
    */
   public class Setup extends TestSetup 
   {
  @@ -118,8 +121,22 @@
            home.remove(new Entity2PK(n, "String"+n, new Double(n)));
      }
   
  +   private void flushAuthCache() throws Exception
  +   {
  +      String serverName = InetAddress.getLocalHost().getHostName();
  +      String connectorName = "jmx:" +serverName+ ":rmi";
  +      RMIConnector server = (RMIConnector) new 
InitialContext().lookup(connectorName);
  +      ObjectName jaasMgr = new ObjectName("Security:name=JaasSecurityManager");
  +      // Ask the deployer for the getWarDeployerName
  +      Object[] params = {"other"};
  +      String[] signature = {"java.lang.String"};
  +      String warDeployerName = (String) server.invoke(jaasMgr,
  +         "flushAuthenticationCache", params, signature);
  +
  +   }
      private void login() throws Exception
      {
  +      flushAuthCache();
         String username = "jduke";
         char[] password = "theduke".toCharArray();
         AppCallbackHandler handler = new AppCallbackHandler(username, password);
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to