[jboss-cvs] jbosstest/src/main/org/jboss/test/security/test ...
Anil Saldhana
anil.saldhana at jboss.com
Mon Jul 24 17:18:48 EDT 2006
User: asaldhana
Date: 06/07/24 17:18:48
Modified: src/main/org/jboss/test/security/test Tag: Branch_4_0
DynamicLoginConfigServiceUnitTestCase.java
Log:
JBAS-3105: Do not start test dynamic login config service until the AuthConf attribute is set to the temp url
Revision Changes Path
No revision
No revision
1.1.4.3 +23 -8 jbosstest/src/main/org/jboss/test/security/test/DynamicLoginConfigServiceUnitTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DynamicLoginConfigServiceUnitTestCase.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/test/DynamicLoginConfigServiceUnitTestCase.java,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -b -r1.1.4.2 -r1.1.4.3
--- DynamicLoginConfigServiceUnitTestCase.java 5 Jul 2006 22:29:48 -0000 1.1.4.2
+++ DynamicLoginConfigServiceUnitTestCase.java 24 Jul 2006 21:18:48 -0000 1.1.4.3
@@ -33,13 +33,13 @@
import org.jboss.test.JBossTestCase;
import org.jboss.test.JBossTestSetup;
-//$Id: DynamicLoginConfigServiceUnitTestCase.java,v 1.1.4.2 2006/07/05 22:29:48 asaldhana Exp $
+//$Id: DynamicLoginConfigServiceUnitTestCase.java,v 1.1.4.3 2006/07/24 21:18:48 asaldhana Exp $
/**
* Unit tests for the Dynamic Login Config Service
* @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
* @since May 12, 2006
- * @version $Revision: 1.1.4.2 $
+ * @version $Revision: 1.1.4.3 $
*/
public class DynamicLoginConfigServiceUnitTestCase extends JBossTestCase
{
@@ -66,8 +66,9 @@
new String[] {"java.lang.String", "java.lang.String"});
assertNotNull(" config url != null",confURL);
ObjectName serviceOName = new ObjectName("jboss:service=TestDynamicLoginConfig");
- Attribute attr = new Attribute("AuthConfig", confURL.toExternalForm());
- server.setAttribute(serviceOName,attr);
+ prepareTestDynamicLoginConfig(server,serviceOName,confURL);
+ server.invoke(serviceOName,"create", new Object[0], new String[0]);
+ server.invoke(serviceOName,"start", new Object[0], new String[0]);
//Restart the service
server.invoke(serviceOName,"stop", new Object[0], new String[0]);
@@ -79,6 +80,22 @@
String authConfig = (String)server.getAttribute(serviceOName,"AuthConfig");
assertEquals(confURL + "matches", confURL.toExternalForm(), authConfig);
+ server.invoke(serviceOName,"stop", new Object[0], new String[0]);
+ server.invoke(serviceOName,"destroy", new Object[0], new String[0]);
+ server.unregisterMBean(serviceOName);
+ }
+
+ private void prepareTestDynamicLoginConfig(MBeanServerConnection server,
+ ObjectName serviceOName, URL confURL) throws Exception
+ {
+ server.createMBean("org.jboss.security.auth.login.DynamicLoginConfig",
+ serviceOName);
+ Attribute attr = new Attribute("AuthConfig", confURL.toExternalForm());
+ server.setAttribute(serviceOName,attr);
+
+ ObjectName lcs = new ObjectName("jboss.security:service=XMLLoginConfig");
+ Attribute attrLCS = new Attribute("LoginConfigService", lcs);
+ server.setAttribute(serviceOName,attrLCS);
}
public static Test suite()
@@ -96,7 +113,6 @@
this.delegate.init();
this.deploy("tempfilecreator.jar");
this.redeploy(getResourceURL("jmx/tempFileCreator-service.xml"));
- this.redeploy(getResourceURL("security/dynamicloginconfig/dynamicloginconfig-service.xml"));
}
catch (Exception ex)
{
@@ -108,7 +124,6 @@
protected void tearDown() throws Exception
{
this.undeploy(getResourceURL("jmx/tempFileCreator-service.xml"));
- this.undeploy(getResourceURL("security/dynamicloginconfig/dynamicloginconfig-service.xml"));
}
};
return wrapper;
More information about the jboss-cvs-commits
mailing list