geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: incubator-geronimo/modules/security/src/test/org/apache/geronimo/security/jaas ConfigurationEntryTest.java LoginKerberosNonGeronimoTest.java LoginPropertiesFileTest.java
Date Sun, 27 Jun 2004 18:07:14 GMT
adc         2004/06/27 11:07:14

  Modified:    modules/security/src/test/org/apache/geronimo/security/jaas
                        ConfigurationEntryTest.java
                        LoginKerberosNonGeronimoTest.java
                        LoginPropertiesFileTest.java
  Log:
  Removed direct setting of config.  Using GBean to do this.
  
  Revision  Changes    Path
  1.8       +9 -1      incubator-geronimo/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java
  
  Index: ConfigurationEntryTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ConfigurationEntryTest.java	31 May 2004 00:05:40 -0000	1.7
  +++ ConfigurationEntryTest.java	27 Jun 2004 18:07:14 -0000	1.8
  @@ -45,6 +45,7 @@
   
       protected Kernel kernel;
       protected ObjectName serverInfo;
  +    protected ObjectName loginConfiguration;
       protected ObjectName loginService;
       protected ObjectName testCE;
       protected ObjectName testRealm;
  @@ -89,6 +90,10 @@
           kernel.loadGBean(serverInfo, gbean);
           kernel.startGBean(serverInfo);
   
  +        gbean = new GBeanMBean("org.apache.geronimo.security.jaas.GeronimoLoginConfiguration");
  +        loginConfiguration = new ObjectName("geronimo.security:type=LoginConfiguration");
  +        kernel.loadGBean(loginConfiguration, gbean);
  +
           gbean = new GBeanMBean("org.apache.geronimo.security.jaas.LoginService");
           loginService = new ObjectName("geronimo.security:type=LoginService");
           gbean.setReferencePatterns("Realms", Collections.singleton(new ObjectName("geronimo.security:type=SecurityRealm,*")));
  @@ -134,6 +139,7 @@
           serverStub = new ObjectName("geronimo.remoting:target=LoginServiceStub");
           kernel.loadGBean(serverStub, gbean);
   
  +        kernel.startGBean(loginConfiguration);
           kernel.startGBean(loginService);
           kernel.startGBean(testCE);
           kernel.startGBean(testRealm);
  @@ -151,6 +157,7 @@
           kernel.stopGBean(testRealm);
           kernel.stopGBean(testCE);
           kernel.stopGBean(loginService);
  +        kernel.stopGBean(loginConfiguration);
           kernel.stopGBean(serverInfo);
   
           kernel.unloadGBean(loginService);
  @@ -160,6 +167,7 @@
           kernel.unloadGBean(asyncTransport);
           kernel.unloadGBean(jmxRouter);
           kernel.unloadGBean(serverStub);
  +        kernel.unloadGBean(loginConfiguration);
           kernel.unloadGBean(serverInfo);
   
           kernel.shutdown();
  
  
  
  1.6       +11 -9     incubator-geronimo/modules/security/src/test/org/apache/geronimo/security/jaas/LoginKerberosNonGeronimoTest.java
  
  Index: LoginKerberosNonGeronimoTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/security/src/test/org/apache/geronimo/security/jaas/LoginKerberosNonGeronimoTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LoginKerberosNonGeronimoTest.java	31 May 2004 00:05:40 -0000	1.5
  +++ LoginKerberosNonGeronimoTest.java	27 Jun 2004 18:07:14 -0000	1.6
  @@ -19,13 +19,10 @@
   
   import javax.management.ObjectName;
   import javax.security.auth.Subject;
  -import javax.security.auth.login.Configuration;
   import javax.security.auth.login.LoginContext;
   import javax.security.auth.login.LoginException;
   import java.util.Properties;
   
  -import com.sun.security.auth.login.ConfigFile;
  -
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
   import org.apache.geronimo.security.AbstractTest;
   import org.apache.geronimo.security.ContextManager;
  @@ -43,6 +40,7 @@
   public class LoginKerberosNonGeronimoTest extends AbstractTest {
   
       protected ObjectName kerberosCE;
  +    protected ObjectName loginConfiguration;
   
       /**
        * Install the <code>GeronimoLoginConfiguration</code> but setup a non-Geronimo
  @@ -52,16 +50,18 @@
        * @throws Exception
        */
       public void setUp() throws Exception {
  -        Configuration.setConfiguration(new GeronimoLoginConfiguration());
  -
           super.setUp();
   
  +        GBeanMBean gbean = new GBeanMBean("org.apache.geronimo.security.jaas.GeronimoLoginConfiguration");
  +        loginConfiguration = new ObjectName("geronimo.security:type=LoginConfiguration");
  +        kernel.loadGBean(loginConfiguration, gbean);
  +
           Properties options = new Properties();
           options.put("debug", "true");
           options.put("useTicketCache", "true");
           options.put("doNotPrompt", "true");
   
  -        GBeanMBean gbean = new GBeanMBean("org.apache.geronimo.security.jaas.ConfigurationEntryLocal");
  +        gbean = new GBeanMBean("org.apache.geronimo.security.jaas.ConfigurationEntryLocal");
           kerberosCE = new ObjectName("geronimo.security:type=ConfigurationEntry,jaasId=kerberos-foobar");
           gbean.setAttribute("ApplicationConfigName", "kerberos-foobar");
           gbean.setAttribute("LoginModuleName", "com.sun.security.auth.module.Krb5LoginModule");
  @@ -69,6 +69,7 @@
           gbean.setAttribute("Options", options);
           kernel.loadGBean(kerberosCE, gbean);
   
  +        kernel.startGBean(loginConfiguration);
           kernel.startGBean(kerberosCE);
       }
   
  @@ -80,11 +81,12 @@
        */
       public void tearDown() throws Exception {
           kernel.stopGBean(kerberosCE);
  +        kernel.stopGBean(loginConfiguration);
  +
           kernel.unloadGBean(kerberosCE);
  +        kernel.unloadGBean(loginConfiguration);
   
           super.tearDown();
  -
  -        Configuration.setConfiguration(new ConfigFile());
       }
   
       /**
  
  
  
  1.8       +10 -8     incubator-geronimo/modules/security/src/test/org/apache/geronimo/security/jaas/LoginPropertiesFileTest.java
  
  Index: LoginPropertiesFileTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/security/src/test/org/apache/geronimo/security/jaas/LoginPropertiesFileTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LoginPropertiesFileTest.java	31 May 2004 00:05:40 -0000	1.7
  +++ LoginPropertiesFileTest.java	27 Jun 2004 18:07:14 -0000	1.8
  @@ -19,14 +19,11 @@
   
   import javax.management.ObjectName;
   import javax.security.auth.Subject;
  -import javax.security.auth.login.Configuration;
   import javax.security.auth.login.LoginContext;
   import java.io.File;
   import java.util.Collections;
   import java.util.Properties;
   
  -import com.sun.security.auth.login.ConfigFile;
  -
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
   import org.apache.geronimo.security.AbstractTest;
   import org.apache.geronimo.security.ContextManager;
  @@ -41,12 +38,11 @@
   public class LoginPropertiesFileTest extends AbstractTest {
   
       protected ObjectName serverInfo;
  +    protected ObjectName loginConfiguration;
       protected ObjectName propertiesRealm;
       protected ObjectName propertiesCE;
   
       public void setUp() throws Exception {
  -        Configuration.setConfiguration(new GeronimoLoginConfiguration());
  -
           super.setUp();
   
           GBeanMBean gbean;
  @@ -57,6 +53,10 @@
           kernel.loadGBean(serverInfo, gbean);
           kernel.startGBean(serverInfo);
   
  +        gbean = new GBeanMBean("org.apache.geronimo.security.jaas.GeronimoLoginConfiguration");
  +        loginConfiguration = new ObjectName("geronimo.security:type=LoginConfiguration");
  +        kernel.loadGBean(loginConfiguration, gbean);
  +
           gbean = new GBeanMBean("org.apache.geronimo.security.realm.providers.PropertiesFileSecurityRealm");
           propertiesRealm = new ObjectName("geronimo.security:type=SecurityRealm,realm=properties-realm");
           gbean.setAttribute("RealmName", "properties-realm");
  @@ -74,6 +74,7 @@
           gbean.setAttribute("Options", new Properties());
           kernel.loadGBean(propertiesCE, gbean);
   
  +        kernel.startGBean(loginConfiguration);
           kernel.startGBean(propertiesRealm);
           kernel.startGBean(propertiesCE);
       }
  @@ -81,14 +82,15 @@
       public void tearDown() throws Exception {
           kernel.stopGBean(propertiesCE);
           kernel.stopGBean(propertiesRealm);
  +        kernel.stopGBean(loginConfiguration);
           kernel.stopGBean(serverInfo);
  +
           kernel.unloadGBean(propertiesRealm);
           kernel.unloadGBean(propertiesCE);
  +        kernel.unloadGBean(loginConfiguration);
           kernel.unloadGBean(serverInfo);
   
           super.tearDown();
  -
  -        Configuration.setConfiguration(new ConfigFile());
       }
   
       public void testLogin() throws Exception {
  
  
  

Mime
View raw message