User: starksm
Date: 01/07/29 11:17:39
Modified: src/main/org/jboss/test/perf/test Setup.java
Log:
Flush security auth cache to avoid conflicts due to tests using the same
security domain with different user to role mappings.
Clean up failures due to the JMS name changes
Revision Changes Path
1.3 +17 -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
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Setup.java 2001/07/14 16:02:42 1.2
+++ Setup.java 2001/07/29 18:17:39 1.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 $
+ @version $Revision: 1.3 $
*/
public class Setup extends TestSetup
{
@@ -102,8 +105,21 @@
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