Author: ajaquith
Date: Thu Jun 12 22:01:30 2008
New Revision: 667336
URL: http://svn.apache.org/viewvc?rev=667336&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/WikiEngine.java
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiEngine.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiEngine.java?rev=667336&r1=667335&r2=667336&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiEngine.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/WikiEngine.java Thu Jun 12
22:01:30 2008
@@ -380,22 +380,32 @@
protected WikiEngine( ServletContext context, String appid, Properties
props )
throws WikiException
{
+ super();
m_servletContext = context;
m_appid = appid;
+ // Stash the WikiEngine in the servlet context
+ if ( context != null )
+ {
+ context.setAttribute( ATTR_WIKIENGINE, this );
+ m_rootPath = context.getRealPath("/");
+ }
+
try
{
//
// Note: May be null, if JSPWiki has been deployed in a WAR file.
//
- m_rootPath = context.getRealPath("/");
initialize( props );
log.info("Root path for this Wiki is: '"+m_rootPath+"'");
}
catch( Exception e )
{
String msg = Release.APPNAME+": Unable to load and setup
properties from jspwiki.properties. "+e.getMessage();
- context.log( msg );
+ if ( context != null )
+ {
+ context.log( msg );
+ }
throw new WikiException( msg );
}
}