[jboss-cvs] jbosstest/src/main/org/jboss/test/security/test ...

Anil Saldhana anil.saldhana at jboss.com
Mon Jul 24 17:11:13 EDT 2006


  User: asaldhana
  Date: 06/07/24 17:11:13

  Modified:    src/main/org/jboss/test/security/test 
                        DynamicLoginConfigServiceUnitTestCase.java
  Log:
  JBAS-3105: Do not start the temp dynamic login config service until you have set the Auth Conf url to be the temp file
  
  Revision  Changes    Path
  1.3       +24 -9     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.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- DynamicLoginConfigServiceUnitTestCase.java	5 Jul 2006 22:45:05 -0000	1.2
  +++ DynamicLoginConfigServiceUnitTestCase.java	24 Jul 2006 21:11:13 -0000	1.3
  @@ -33,13 +33,13 @@
   import org.jboss.test.JBossTestCase;
   import org.jboss.test.JBossTestSetup; 
   
  -//$Id: DynamicLoginConfigServiceUnitTestCase.java,v 1.2 2006/07/05 22:45:05 asaldhana Exp $
  +//$Id: DynamicLoginConfigServiceUnitTestCase.java,v 1.3 2006/07/24 21:11:13 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.2 $
  + *  @version $Revision: 1.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