geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r373669 - in /geronimo/trunk/modules/tomcat/src: java/org/apache/geronimo/tomcat/ java/org/apache/geronimo/tomcat/listener/ test/org/apache/geronimo/tomcat/
Date Tue, 31 Jan 2006 02:12:11 GMT
Author: jgenender
Date: Mon Jan 30 18:12:06 2006
New Revision: 373669

URL: http://svn.apache.org/viewcvs?rev=373669&view=rev
Log:
Fix Unit Tests

Added:
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/listener/
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/listener/DispatchListener.java
Modified:
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
    geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ApplicationTest.java
    geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java?rev=373669&r1=373668&r2=373669&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/EngineGBean.java Mon
Jan 30 18:12:06 2006
@@ -88,15 +88,16 @@
         //Set the parameters
         setParameters(engine, initParams);
         
+        //Set realm (must be before Hosts)
+        if (realmGBean != null){
+            engine.setRealm((Realm)realmGBean.getInternalObject());
+        }
+        
         //Set the default Host
         final String defaultHostName = ((Host)defaultHost.getInternalObject()).getName();
         engine.setDefaultHost(defaultHostName);
         addHost(defaultHost);
 
-        if (realmGBean != null){
-            engine.setRealm((Realm)realmGBean.getInternalObject());
-        }
-        
         if (manager != null)
             engine.setManager((Manager)manager.getInternalObject());
 

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=373669&r1=373668&r2=373669&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
Mon Jan 30 18:12:06 2006
@@ -164,6 +164,9 @@
         this.webServiceMap = ctx.getWebServices();
 
         this.setCrossContext(ctx.isCrossContext());
+        
+        //Set the Dispatch listener
+        this.addInstanceListener("org.apache.geronimo.tomcat.listener.DispatchListener");
     }
 
     public synchronized void start() throws LifecycleException {

Added: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/listener/DispatchListener.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/listener/DispatchListener.java?rev=373669&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/listener/DispatchListener.java
(added)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/listener/DispatchListener.java
Mon Jan 30 18:12:06 2006
@@ -0,0 +1,29 @@
+package org.apache.geronimo.tomcat.listener;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.apache.catalina.InstanceEvent;
+import org.apache.catalina.InstanceListener;
+
+public class DispatchListener implements InstanceListener{
+
+    public void instanceEvent(InstanceEvent event) {
+        
+        if (event.equals(event.BEFORE_DISPATCH_EVENT)){
+            beforeDispatch(event.getRequest(), event.getResponse());
+        }
+        if (event.equals(event.AFTER_DISPATCH_EVENT)){
+            afterDispatch(event.getRequest(), event.getResponse());
+        }
+    }
+    
+    private void beforeDispatch(ServletRequest request, ServletResponse respons){
+        
+    }
+    
+    private void afterDispatch(ServletRequest request, ServletResponse respons){
+        
+    }
+
+}

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=373669&r1=373668&r2=373669&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 Jan 30 18:12:06 2006
@@ -27,7 +27,7 @@
  */
 public class ApplicationTest extends AbstractWebModuleTest {
 
-    public void DavidJencksPleaseVisitMetestApplication() throws Exception {
+    public void testApplication() throws Exception {
         setUpInsecureAppContext();
 
         HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:8181/test/hello.txt")

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=373669&r1=373668&r2=373669&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 Jan 30 18:12:06 2006
@@ -54,7 +54,7 @@
      *
      * @throws Exception thrown if an error in the test occurs
      */
-    public void DavidJencksPleaseVisitMetestExplicitMapping() throws Exception {
+    public void testExplicitMapping() throws Exception {
 
         Security securityConfig = new Security();
         securityConfig.setUseContextHandler(false);
@@ -110,6 +110,7 @@
 
         connection = (HttpURLConnection) new URL(location).openConnection();
         connection.setRequestMethod("POST");
+        connection.setRequestProperty("Referer","http://localhost:8181/securetest/auth/logon.html?param=test");
         connection.setRequestProperty("Cookie", cookie);
         connection.setInstanceFollowRedirects(false);
         assertEquals(HttpURLConnection.HTTP_MOVED_TEMP, connection.getResponseCode());



Mime
View raw message