Author: ajaquith
Date: Thu Jun 12 22:03:07 2008
New Revision: 667339

URL: http://svn.apache.org/viewvc?rev=667339&view=rev
Log:
Removed TestHttpServletRequest, TestHttpServletResponse, TestHttpSession, 
TestFilterChain, TestFilterConfig, TestServletContext in favor of the 
much-superior Stripes mock objects. TestEngine was retrofitted with the Stripes 
mocks and all unit tests were also changed. In particular, take note of the 
TestEngine.newHttpRequest() factory method, which should be used to create test 
request objects.

Modified:
    
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/WebContainerAuthorizer.java

Modified: 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/WebContainerAuthorizer.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/WebContainerAuthorizer.java?rev=667339&r1=667338&r2=667339&view=diff
==============================================================================
--- 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/WebContainerAuthorizer.java
 (original)
+++ 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/authorize/WebContainerAuthorizer.java
 Thu Jun 12 22:03:07 2008
@@ -31,6 +31,8 @@
 
 import javax.servlet.http.HttpServletRequest;
 
+import net.sourceforge.stripes.mock.MockServletContext;
+
 import org.apache.log4j.Logger;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -387,6 +389,12 @@
         else
         {
             url = m_engine.getServletContext().getResource( "/WEB-INF/web.xml" 
);
+            // Hack in case we're using Stripes mock servlet context
+            // See bug [STS-376] at 
http://stripesframework.org/jira/browse/STS-376. Will be fixed in Stripes 1.5.
+            if ( url == null && m_engine.getServletContext() instanceof 
MockServletContext )
+            {
+                url = m_engine.getServletContext().getResource( 
"WEB-INF/web.xml" );
+            }
             if( url != null )
                 log.info( "Examining " + url.toExternalForm() );
         }


Reply via email to