geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r164653 [2/2] - in /geronimo/trunk/modules/tomcat/src: java/org/apache/geronimo/tomcat/ java/org/apache/geronimo/tomcat/deployment/ java/org/apache/geronimo/tomcat/realm/ java/org/apache/geronimo/tomcat/util/ java/org/apache/geronimo/tomcat/valve/ test-resources/deployables/war3/WEB-INF/ test/org/apache/geronimo/tomcat/
Date Mon, 25 Apr 2005 21:10:43 GMT
Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=164653&r1=164652&r2=164653&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
(original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
Mon Apr 25 14:10:42 2005
@@ -20,13 +20,16 @@
 import java.net.URI;
 import java.security.PermissionCollection;
 import java.security.Permissions;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
 
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
-import org.apache.catalina.authenticator.Constants;
-import org.apache.catalina.deploy.LoginConfig;
 
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
 import org.apache.geronimo.gbean.GBeanData;
@@ -45,9 +48,9 @@
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.security.realm.GenericSecurityRealm;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.geronimo.tomcat.connector.HTTPConnector;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
+import org.apache.geronimo.transaction.context.TransactionContextManager;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
 
 
@@ -56,7 +59,6 @@
  */
 public class AbstractWebModuleTest extends TestCase {
 
-    protected static final String securityRealmName = "demo-properties-realm";
     protected static final String POLICY_CONTEXT_ID = "securetest";
 
 
@@ -65,6 +67,12 @@
     private ObjectName containerName;
     private ObjectName connectorName;
     private GBeanData connector;
+    private ObjectName engineName;
+    private GBeanData engine;
+    private ObjectName hostName;
+    private GBeanData host;
+    private ObjectName realmName;
+    private GBeanData realm;
     private ObjectName webModuleName;
     private ObjectName tmName;
     private ObjectName ctcName;
@@ -87,9 +95,6 @@
     private ObjectName serverInfoName;
     private GBeanData serverInfoGBean;
 
-    public void testDummy() throws Exception {
-    }
-
     protected void setUpInsecureAppContext() throws Exception {
 
         GBeanData app = new GBeanData(webModuleName, TomcatWebAppContext.GBEAN_INFO);
@@ -100,14 +105,14 @@
         app.setReferencePattern("Container", containerName);
         OnlineUserTransaction userTransaction = new OnlineUserTransaction();
         app.setAttribute("userTransaction", userTransaction);
-        app.setReferencePattern("TransactionContextManager", tcmName);
-        app.setReferencePattern("TrackedConnectionAssociator", ctcName);
+        app.setReferencePattern("transactionContextManager", tcmName);
+        app.setReferencePattern("trackedConnectionAssociator", ctcName);
         app.setAttribute("path", "/test");
 
         start(app);
     }
 
-    protected ObjectName setUpJAASSecureAppContext(Set securityConstraints, Set securityRoles)
throws Exception {
+    protected ObjectName setUpJAASSecureAppContext() throws Exception {
         ObjectName jaccBeanName = NameFactory.getComponentName(null, null, null, null, "foo",
NameFactory.JACC_MANAGER, moduleContext);
         GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
         PermissionCollection excludedPermissions= new Permissions();
@@ -125,29 +130,12 @@
         app.setAttribute("webClassPath", new URI[]{});
         app.setAttribute("configurationBaseUrl", new File("target/var/catalina/webapps/war3/WEB-INF/web.xml").toURL());
         app.setAttribute("path", "/securetest");
-        app.setAttribute("policyContextID", POLICY_CONTEXT_ID);
         app.setReferencePattern("RoleDesignateSource", jaccBeanName);
  
-        LoginConfig loginConfig = new LoginConfig();
-        loginConfig.setAuthMethod(Constants.FORM_METHOD);
-        loginConfig.setRealmName("Test JAAS Realm");
-        loginConfig.setLoginPage("/auth/logon.html?param=test");
-        loginConfig.setErrorPage("/auth/logonError.html?param=test");
-        app.setAttribute("loginConfig", loginConfig);
-        app.setAttribute("loginConfig", loginConfig);
-
-        app.setAttribute("securityConstraints", securityConstraints);
-        app.setAttribute("securityRoles", securityRoles);
-
-        TomcatJAASRealm realm = new TomcatJAASRealm("demo-properties-realm");
-        realm.setUserClassNames("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
-        realm.setRoleClassNames("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
-        app.setAttribute("tomcatRealm", realm);
-
         OnlineUserTransaction userTransaction = new OnlineUserTransaction();
         app.setAttribute("userTransaction", userTransaction);
-        app.setReferencePattern("TransactionContextManager", tcmName);
-        app.setReferencePattern("TrackedConnectionAssociator", ctcName);
+        app.setReferencePattern("transactionContextManager", tcmName);
+        app.setReferencePattern("trackedConnectionAssociator", ctcName);
 
         app.setAttribute("componentContext", Collections.EMPTY_MAP);
         app.setReferencePattern("Container", containerName);
@@ -158,13 +146,11 @@
         return webModuleName;
     }
 
-    protected ObjectName setUpSecureAppContext(Set securityConstraints,
-                                               Map roleDesignates, 
+    protected ObjectName setUpSecureAppContext(Map roleDesignates, 
                                                Map principalRoleMap,
                                                ComponentPermissions componentPermissions,

                                                DefaultPrincipal defaultPrincipal, 
-                                               PermissionCollection checked,
-                                               Set securityRoles)
+                                               PermissionCollection checked)
             throws Exception {
         
         ObjectName jaccBeanName = NameFactory.getComponentName(null, null, null, null, "foo",
NameFactory.JACC_MANAGER, moduleContext);
@@ -176,38 +162,25 @@
         jaccBeanData.setAttribute("roleDesignates", roleDesignates);
         start(jaccBeanData);
 
+        SecurityHolder securityHolder = new SecurityHolder();
+        securityHolder.setChecked(checked);
+        securityHolder.setExcluded(componentPermissions.getExcludedPermissions());
+        securityHolder.setPolicyContextID(POLICY_CONTEXT_ID);
+        securityHolder.setDefaultPrincipal(defaultPrincipal);
         GBeanData app = new GBeanData(webModuleName, TomcatWebAppContext.GBEAN_INFO);
+        app.setAttribute("classLoader", cl);
         app.setAttribute("webAppRoot", new File("target/var/catalina/webapps/war3/").toURI());
         app.setAttribute("webClassPath", new URI[]{});
+        app.setAttribute("contextPriorityClassLoader", Boolean.FALSE);
+        app.setAttribute("securityHolder", securityHolder);
         app.setAttribute("configurationBaseUrl", new File("target/var/catalina/webapps/war3/WEB-INF/web.xml").toURL());
         app.setAttribute("path", "/securetest");
-        app.setAttribute("policyContextID", POLICY_CONTEXT_ID);
         app.setReferencePattern("RoleDesignateSource", jaccBeanName);
  
-        LoginConfig loginConfig = new LoginConfig();
-        loginConfig.setAuthMethod(Constants.FORM_METHOD);
-        loginConfig.setRealmName("Test JACC Realm");
-        loginConfig.setLoginPage("/auth/logon.html?param=test");
-        loginConfig.setErrorPage("/auth/logonError.html?param=test");
-        app.setAttribute("loginConfig", loginConfig);
-
-        app.setAttribute("securityConstraints", securityConstraints);
-        app.setAttribute("securityRoles", securityRoles);
-
-        TomcatGeronimoRealm realm = new TomcatGeronimoRealm(POLICY_CONTEXT_ID,
-                                                            defaultPrincipal,
-                                                            "demo-properties-realm",
-                                                            checked,
-                                                            componentPermissions.getExcludedPermissions(),
-                                                            roleDesignates);
-        realm.setUserClassNames("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
-        realm.setRoleClassNames("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
-        app.setAttribute("tomcatRealm", realm);
-
         OnlineUserTransaction userTransaction = new OnlineUserTransaction();
         app.setAttribute("userTransaction", userTransaction);
-        app.setReferencePattern("TransactionContextManager", tcmName);
-        app.setReferencePattern("TrackedConnectionAssociator", ctcName);
+        app.setReferencePattern("transactionContextManager", tcmName);
+        app.setReferencePattern("trackedConnectionAssociator", ctcName);
 
         app.setAttribute("componentContext", Collections.EMPTY_MAP);
         app.setReferencePattern("Container", containerName);
@@ -237,7 +210,7 @@
         loginServiceGBean.setAttribute("algorithm", "HmacSHA1");
         loginServiceGBean.setAttribute("password", "secret");
 
-        propertiesLMName = new ObjectName("geronimo.security:type=LoginModule,name=demo-properties-login");
+        propertiesLMName = new ObjectName("geronimo.security:type=LoginModule,name=Geronimo");
         propertiesLMGBean = new GBeanData(propertiesLMName, LoginModuleGBean.GBEAN_INFO);
         propertiesLMGBean.setAttribute("loginModuleClass", "org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule");
         propertiesLMGBean.setAttribute("serverSide", Boolean.TRUE);
@@ -245,12 +218,12 @@
         options.setProperty("usersURI", "src/test-resources/data/users.properties");
         options.setProperty("groupsURI", "src/test-resources/data/groups.properties");
         propertiesLMGBean.setAttribute("options", options);
-        propertiesLMGBean.setAttribute("loginDomainName", "demo-properties-realm");
+        propertiesLMGBean.setAttribute("loginDomainName", "geronimo-properties-realm");
 
-        propertiesRealmName = new ObjectName("geronimo.server:j2eeType=SecurityRealm,name=demo-properties-realm");
+        propertiesRealmName = new ObjectName("geronimo.server:j2eeType=SecurityRealm,name=geronimo-properties-realm");
         propertiesRealmGBean = new GBeanData(propertiesRealmName, GenericSecurityRealm.GBEAN_INFO);
         propertiesRealmGBean.setReferencePattern("ServerInfo", serverInfoName);
-        propertiesRealmGBean.setAttribute("realmName", "demo-properties-realm");
+        propertiesRealmGBean.setAttribute("realmName", "Geronimo");
         Properties config = new Properties();
         config.setProperty("LoginModule.1.REQUIRED", propertiesLMName.getCanonicalName());
         propertiesRealmGBean.setAttribute("loginModuleConfiguration", config);
@@ -287,10 +260,14 @@
         kernel.unloadGBean(name);
     }
 
-    protected void setUp() throws Exception {
+    protected void setUp(String realmClass) throws Exception {
         cl = this.getClass().getClassLoader();
         containerName = NameFactory.getWebComponentName(null, null, null, null, "tomcatContainer",
"WebResource", moduleContext);
         connectorName = NameFactory.getWebComponentName(null, null, null, null, "tomcatConnector",
"WebResource", moduleContext);
+        if (realmClass != null)
+            realmName = NameFactory.getWebComponentName(null, null, null, null, "tomcatRealm",
"WebResource", moduleContext);
+        engineName = NameFactory.getWebComponentName(null, null, null, null, "tomcatEngine",
"WebResource", moduleContext);
+        hostName = NameFactory.getWebComponentName(null, null, null, null, "tomcatHost",
"WebResource", moduleContext);
         webModuleName = NameFactory.getModuleName(null, null, null, null, "testModule", moduleContext);
 
         tmName = NameFactory.getComponentName(null, null, null, null, "TransactionManager",
NameFactory.JTA_RESOURCE, moduleContext);
@@ -301,19 +278,57 @@
         kernel = new Kernel("test.kernel");
         kernel.boot();
 
+        //ServerInfo
         serverInfoName = new ObjectName("geronimo.system:role=ServerInfo");
         serverInfoGBean = new GBeanData(serverInfoName, ServerInfo.GBEAN_INFO);
         serverInfoGBean.setAttribute("baseDirectory", ".");
 
         start(serverInfoGBean);
+        
+        //Default Realm
+        Map initParams = new HashMap();
+        
+        if (realmClass != null){
+            initParams.put("userClassNames","org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
+            initParams.put("roleClassNames","org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
+            realm = new GBeanData(realmName, RealmGBean.GBEAN_INFO);
+            realm.setAttribute("className", realmClass);
+            realm.setAttribute("initParams", initParams);
+            start(realm);
+        }
+        
+        //Default Engine
+        initParams.clear();
+        initParams.put("name","Geronimo");
+        initParams.put("defaultHost","localhost");
+        engine = new GBeanData(engineName, EngineGBean.GBEAN_INFO);
+        engine.setAttribute("className", "org.apache.geronimo.tomcat.TomcatEngine");
+        engine.setAttribute("initParams", initParams);
+        if (realmClass != null)
+            engine.setReferencePattern("realmGBean", realmName);
+        start(engine);        
+        
+        //Default Host
+        initParams.clear();
+        initParams.put("workDir","work");
+        initParams.put("name","localhost");
+        initParams.put("appBase","");
+        host = new GBeanData(hostName, HostGBean.GBEAN_INFO);
+        host.setAttribute("className", "org.apache.catalina.core.StandardHost");
+        host.setAttribute("initParams", initParams);
+        host.setReferencePattern("engineGBean", engineName);
+        start(host);        
 
         // Need to override the constructor for unit tests
         container = new GBeanData(containerName, TomcatContainer.GBEAN_INFO);
         container.setAttribute("catalinaHome", "target/var/catalina");
+        container.setReferencePattern("engineGBean", engineName);
         container.setReferencePattern("ServerInfo", serverInfoName);
 
-        connector = new GBeanData(connectorName, HTTPConnector.GBEAN_INFO);
-        connector.setAttribute("port", new Integer(8080));
+        initParams.clear();
+        initParams.put("port","8080");
+        connector = new GBeanData(connectorName, ConnectorGBean.GBEAN_INFO);
+        connector.setAttribute("initParams", initParams);
         connector.setReferencePattern("TomcatContainer", containerName);
 
         start(container);
@@ -335,6 +350,11 @@
     protected void tearDown() throws Exception {
         stop(ctcName);
         stop(tmName);
+        if (realmName != null)
+            stop(realmName);
+        stop(hostName);
+        stop(engineName);
+        stop(connectorName);
         stop(containerName);
         stop(serverInfoName);
         kernel.shutdown();

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java?rev=164653&r1=164652&r2=164653&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java
(original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java
Mon Apr 25 14:10:42 2005
@@ -37,5 +37,8 @@
         assertEquals("Hello World", reader.readLine());
         connection.disconnect();
     }
-
+    
+    protected void setUp() throws Exception {
+        super.setUp(null);
+   }
 }

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java?rev=164653&r1=164652&r2=164653&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java
(original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JAASSecurityTest.java
Mon Apr 25 14:10:42 2005
@@ -20,14 +20,8 @@
 import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
 import javax.management.ObjectName;
 
-import org.apache.catalina.deploy.SecurityCollection;
-import org.apache.catalina.deploy.SecurityConstraint;
-
-
 /**
  * Tests the JAAS security for Tomcat
  *
@@ -39,29 +33,7 @@
 
     public void testNotAuthorized() throws Exception {
 
-        Set constraints = new HashSet();
-
-        SecurityConstraint sc = new SecurityConstraint();
-        sc.setAuthConstraint(true);
-        sc.addAuthRole("content-administrator");
-        sc.addAuthRole("auto-administrator");
-        SecurityCollection coll = new SecurityCollection("Admin Role");
-        coll.addPattern("/protected/*");
-        sc.addCollection(coll);
-        constraints.add(sc);
-
-        sc = new SecurityConstraint();
-        sc.setAuthConstraint(false);
-        coll = new SecurityCollection("NO ACCESS");
-        coll.addPattern("/auth/logon.html");
-        sc.addCollection(coll);
-        constraints.add(sc);
-
-        Set securityRoles = new HashSet();
-        securityRoles.add("content-administrator");
-        securityRoles.add("auto-administrator");
-
-        startWebApp(constraints, securityRoles);
+        startWebApp();
 
         //Begin the test
         HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:8080/securetest/protected/hello.txt").openConnection();
@@ -93,29 +65,7 @@
 
     public void testBadAuthentication() throws Exception {
 
-        Set constraints = new HashSet();
-
-        SecurityConstraint sc = new SecurityConstraint();
-        sc.setAuthConstraint(true);
-        sc.addAuthRole("content-administrator");
-        sc.addAuthRole("auto-administrator");
-        SecurityCollection coll = new SecurityCollection("Admin Role");
-        coll.addPattern("/protected/*");
-        sc.addCollection(coll);
-        constraints.add(sc);
-
-        sc = new SecurityConstraint();
-        sc.setAuthConstraint(false);
-        coll = new SecurityCollection("NO ACCESS");
-        coll.addPattern("/auth/logon.html");
-        sc.addCollection(coll);
-        constraints.add(sc);
-
-        Set securityRoles = new HashSet();
-        securityRoles.add("content-administrator");
-        securityRoles.add("auto-administrator");
-
-        startWebApp(constraints, securityRoles);
+        startWebApp();
 
         //Begin the test
         HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:8080/securetest/protected/hello.txt").openConnection();
@@ -150,29 +100,7 @@
     }
 
     public void testGoodAuthentication() throws Exception {
-        Set constraints = new HashSet();
-
-        SecurityConstraint sc = new SecurityConstraint();
-        sc.setAuthConstraint(true);
-        sc.addAuthRole("content-administrator");
-        sc.addAuthRole("auto-administrator");
-        SecurityCollection coll = new SecurityCollection("Admin Role");
-        coll.addPattern("/protected/*");
-        sc.addCollection(coll);
-        constraints.add(sc);
-
-        sc = new SecurityConstraint();
-        sc.setAuthConstraint(false);
-        coll = new SecurityCollection("NO ACCESS");
-        coll.addPattern("/auth/logon.html");
-        sc.addCollection(coll);
-        constraints.add(sc);
-
-        Set securityRoles = new HashSet();
-        securityRoles.add("content-administrator");
-        securityRoles.add("auto-administrator");
-
-        startWebApp(constraints, securityRoles);
+         startWebApp();
 
         //Give the container some time to load the web context
         //this is wierd..it only needs to be done on this test
@@ -210,8 +138,8 @@
         stopWebApp();
     }
 
-    protected void startWebApp(Set securityConstraints, Set securityRoles) throws Exception
{
-        appName = setUpJAASSecureAppContext(securityConstraints, securityRoles);
+    protected void startWebApp() throws Exception {
+        appName = setUpJAASSecureAppContext();
     }
 
     protected void stopWebApp() throws Exception {
@@ -219,7 +147,7 @@
     }
 
     protected void setUp() throws Exception {
-        super.setUp();
+        super.setUp("org.apache.geronimo.tomcat.realm.TomcatJAASRealm");
         setUpSecurity();        
    }
 

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java?rev=164653&r1=164652&r2=164653&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java
(original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java
Mon Apr 25 14:10:42 2005
@@ -28,15 +28,13 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+
 import javax.management.ObjectName;
 import javax.security.auth.Subject;
 import javax.security.auth.x500.X500Principal;
 import javax.security.jacc.WebResourcePermission;
 import javax.security.jacc.WebUserDataPermission;
 
-import org.apache.catalina.deploy.SecurityCollection;
-import org.apache.catalina.deploy.SecurityConstraint;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.security.RealmPrincipal;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
@@ -68,26 +66,8 @@
         Security securityConfig = new Security();
         securityConfig.setUseContextHandler(false);
 
-        Set constraints = new HashSet();
-
-        SecurityConstraint sc = new SecurityConstraint();
-        sc.setAuthConstraint(true);
-        sc.addAuthRole("content-administrator");
-        sc.addAuthRole("auto-administrator");
-        SecurityCollection coll = new SecurityCollection("Admin Role");
-        coll.addPattern("/protected/*");
-        sc.addCollection(coll);
-        constraints.add(sc);
-
-        sc = new SecurityConstraint();
-        sc.setAuthConstraint(false);
-        coll = new SecurityCollection("NO ACCESS");
-        coll.addPattern("/auth/logon.html");
-        sc.addCollection(coll);
-        constraints.add(sc);
-
         DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
-        defaultPrincipal.setRealmName("demo-properties-realm");
+        defaultPrincipal.setRealmName("geronimo-properties-realm");
         Principal principal = new Principal();
         principal.setClassName("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
         principal.setPrincipalName("izumi");
@@ -101,7 +81,7 @@
         principal.setClassName("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
         principal.setPrincipalName("it");
         Realm realm = new Realm();
-        realm.setRealmName("demo-properties-realm");
+        realm.setRealmName("geronimo-properties-realm");
         realm.getPrincipals().add(principal);
         role.getRealms().put(realm.getRealmName(), realm);
 
@@ -128,12 +108,8 @@
 
         ComponentPermissions componentPermissions = new ComponentPermissions(excludedPermissions,
uncheckedPermissions, rolePermissions);
        
-        Set securityRoles = new HashSet();
-        securityRoles.add("content-administrator");
-        securityRoles.add("auto-administrator");
-
-        startWebApp(constraints, roleDesignates, principalRoleMap,  componentPermissions,
-                defaultPrincipal, checked, securityRoles);
+        startWebApp(roleDesignates, principalRoleMap,  componentPermissions,
+                defaultPrincipal, checked);
 
         //Begin the test
         HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:8080/securetest/protected/hello.txt").openConnection();
@@ -203,16 +179,14 @@
     }
 
     protected void startWebApp(
-            Set securityConstraints,
             Map roleDesignates, 
             Map principalRoleMap,
             ComponentPermissions componentPermissions, 
             DefaultPrincipal defaultPrincipal, 
-            PermissionCollection checked,
-            Set securityRoles) throws Exception {
+            PermissionCollection checked) throws Exception {
 
-        appName = setUpSecureAppContext(securityConstraints, roleDesignates, principalRoleMap,
-                componentPermissions, defaultPrincipal, checked, securityRoles);
+        appName = setUpSecureAppContext(roleDesignates, principalRoleMap,
+                componentPermissions, defaultPrincipal, checked);
 
 
     }
@@ -298,7 +272,7 @@
     }
     
     protected void setUp() throws Exception {
-        super.setUp();
+        super.setUp("org.apache.geronimo.tomcat.realm.TomcatGeronimoRealm");
         setUpSecurity();
     }
 



Mime
View raw message