You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2009/10/26 04:57:52 UTC
svn commit: r829697 - in /incubator/jspwiki/trunk: ./ etc/schema/
src/WebContent/WEB-INF/lib/ src/java/org/apache/wiki/
src/java/org/apache/wiki/auth/ src/java/org/apache/wiki/auth/authorize/
src/java/org/apache/wiki/content/ src/java/org/apache/wiki/p...
Author: ajaquith
Date: Mon Oct 26 03:57:51 2009
New Revision: 829697
URL: http://svn.apache.org/viewvc?rev=829697&view=rev
Log:
Upgraded Priha to 0.5.5. Fixed several unit tests that broke as a result. Note that Priha is now *extremely* sensitive to incomplete shutdowns of JCR, particularly in unit tests. Unit tests *must* be very sure to call WikiEngine.shutdown() every time a WikiEngine is started up. Also, removed XML schema (not needed any more).
Added:
incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/priha-0.5.5.jar (with props)
Removed:
incubator/jspwiki/trunk/etc/schema/j2ee_1_4.xsd
incubator/jspwiki/trunk/etc/schema/j2ee_web_services_client_1_1.xsd
incubator/jspwiki/trunk/etc/schema/jsp_2_0.xsd
incubator/jspwiki/trunk/etc/schema/web-app_2_4.xsd
incubator/jspwiki/trunk/etc/schema/xml.xsd
incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/priha-0.5.3.jar
Modified:
incubator/jspwiki/trunk/ChangeLog
incubator/jspwiki/trunk/build.xml
incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SecurityVerifier.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/WebContainerAuthorizer.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/Image.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiRequestWrapper.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/HandlerInfo.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PageViewPluginTest.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/FileBasedActionResolverTest.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/workflow/OutcomeTest.java
Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Mon Oct 26 03:57:51 2009
@@ -1,5 +1,15 @@
2009-10-25 Andrew Jaquith <ajaquith AT apache DOT org>
+ * 3.0.0-svn-172
+
+ * Upgraded Priha to 0.5.5. Fixed several unit tests that broke as
+ a result. Note that Priha is now *extremely* sensitive to incomplete
+ shutdowns of JCR, particularly in unit tests. Unit tests *must*
+ be very sure to call WikiEngine.shutdown() every time a WikiEngine
+ is started up. Also, removed XML schema (not needed any more).
+
+2009-10-25 Andrew Jaquith <ajaquith AT apache DOT org>
+
* 3.0.0-svn-171
* Additional build.xml tweaks to fix broken WAR builds.
Modified: incubator/jspwiki/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/build.xml?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/build.xml (original)
+++ incubator/jspwiki/trunk/build.xml Mon Oct 26 03:57:51 2009
@@ -193,6 +193,7 @@
<target name="clean"
description="Cleans away all generated files.">
<delete dir="${build}" />
+ <mkdir dir="${tests.classpath}" />
<delete>
<fileset dir="." includes="**/*~" defaultexcludes="no"/>
<fileset dir="." includes="**/#*#" defaultexcludes="no"/>
@@ -322,7 +323,7 @@
<fileset dir="${code.build}" includes="**/*.class" />
<fileset dir="${code.src}" includes="org/**/*.properties" />
<!--fileset dir="${code.src}" includes="templates/**/*.properties" /-->
- <fileset dir="etc" includes="ini/*.xml ini/*.properties priha.properties" />
+ <fileset dir="etc" includes="ini/*.xml ini/*.properties" />
<metainf dir="${code.web}/WEB-INF" includes="jspwiki.tld" />
</jar>
</target>
@@ -357,19 +358,14 @@
of the WAR-file.
-->
- <target name="war-init" depends="installinit">
+ <target name="war" depends="installinit,jar,jar-compiled-jsps,compressedjs"
+ description="Builds the WAR file for installation.">
<mkdir dir="${war.build}" />
- <echo>Validating web.xml</echo>
- <schemavalidate file="${code.web}/WEB-INF/web.xml">
- <schema namespace="http://java.sun.com/xml/ns/j2ee"
- file="etc/schema/web-app_2_4.xsd" />
- </schemavalidate>
- <!-- Clean up stuff from last time -->
+
+ <!-- Build war.xml and the classes/properties files -->
<delete quiet="true">
<fileset dir="${war.build}" includes="JSPWiki-jsp.jar,jasper-runtime-*.jar,commons-el-*.jar,web-fragment.xmlf,web.xml"/>
</delete>
-
- <!-- Build war.xml and the classes/properties files -->
<copy toDir="${war.build}" overwrite="true">
<fileset dir="etc">
<include name="jspwiki.properties" />
@@ -381,10 +377,8 @@
</filterset>
</copy>
<copy file="${code.web}/WEB-INF/web.xml" toFile="${war.build}/web.xml" overwrite="false" />
- </target>
- <target name="war" depends="war-init,jar,jar-compiled-jsps,compressedjs"
- description="Builds the WAR file for installation.">
+ <!-- Build the actual WAR file -->
<delete file="${warfile}" />
<war destfile="${warfile}"
webxml="${war.build}/web.xml" duplicate="preserve">
@@ -685,7 +679,6 @@
<fileset dir="${tests}/etc">
<include name="CommentedPropertiesTest.properties" />
<include name="log4j.properties" />
- <include name="priha.properties" />
</fileset>
</copy>
@@ -705,6 +698,14 @@
</fileset>
</copy>
+ <!-- Create test WEB-INF/classes -->
+ <mkdir dir="${tests.webinf}/classes" />
+ <copy toDir="${tests.webinf}/classes" overwrite="true">
+ <fileset dir="${tests}/etc">
+ <include name="priha.properties" />
+ </fileset>
+ </copy>
+
<!-- Create web.xml files for testing -->
<copy file="${code.web}/WEB-INF/web.xml" tofile="${webtests.build}/web.xml.custom" overwrite="true" />
@@ -1151,7 +1152,7 @@
<!-- Here's a neat trick: import the JDBC runtime props from jspwiki.properties -->
<echo message="Getting JDBC runtime properties." />
- <loadproperties srcFile="${code.web}/WEB-INF/jspwiki.properties">
+ <loadproperties srcFile="${tests}/etc/jspwiki.properties">
<filterchain>
<linecontainsregexp>
<regexp pattern="^[jspwiki.userdatabase|jspwiki.groupdatabase]"/>
Added: incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/priha-0.5.5.jar
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/priha-0.5.5.jar?rev=829697&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/jspwiki/trunk/src/WebContent/WEB-INF/lib/priha-0.5.5.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Mon Oct 26 03:57:51 2009
@@ -77,7 +77,7 @@
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "171";
+ public static final String BUILD = "172";
/**
* This is the generic version string you should use
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SecurityVerifier.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SecurityVerifier.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SecurityVerifier.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SecurityVerifier.java Mon Oct 26 03:57:51 2009
@@ -711,7 +711,6 @@
* resolves to an existing file, and the policy file contained therein
* represents a valid policy.
*/
- @SuppressWarnings("unchecked")
protected final void verifyPolicy()
{
// Look up the policy file and set the status text.
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/WebContainerAuthorizer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/WebContainerAuthorizer.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/WebContainerAuthorizer.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/WebContainerAuthorizer.java Mon Oct 26 03:57:51 2009
@@ -39,10 +39,6 @@
import org.jdom.Namespace;
import org.jdom.input.SAXBuilder;
import org.jdom.xpath.XPath;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
/**
* Authorizes users by delegating role membership checks to the servlet
@@ -381,7 +377,6 @@
URL url;
SAXBuilder builder = new SAXBuilder();
builder.setValidation( false );
- builder.setEntityResolver( new LocalEntityResolver() );
Document doc = null;
if ( m_engine.getServletContext() == null )
{
@@ -404,68 +399,4 @@
return doc;
}
- /**
- * <p>XML entity resolver that redirects resolution requests by JDOM, JAXP and
- * other XML parsers to locally-cached copies of the resources. Local
- * resources are stored in the <code>WEB-INF/dtd</code> directory.</p>
- * <p>For example, Sun Microsystem's DTD for the webapp 2.3 specification is normally
- * kept at <code>http://java.sun.com/dtd/web-app_2_3.dtd</code>. The
- * local copy is stored at <code>WEB-INF/dtd/web-app_2_3.dtd</code>.</p>
- */
- public class LocalEntityResolver implements EntityResolver
- {
- /**
- * Returns an XML input source for a requested external resource by
- * reading the resource instead from local storage. The local resource path
- * is <code>WEB-INF/dtd</code>, plus the file name of the requested
- * resource, minus the non-filename path information.
- * @param publicId the public ID, such as
- * <code>-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN</code>
- * @param systemId the system ID, such as
- * <code>http://java.sun.com/dtd/web-app_2_3.dtd</code>
- * @return the InputSource containing the resolved resource
- * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
- * java.lang.String)
- * @throws SAXException if the resource cannot be resolved locally
- * @throws IOException if the resource cannot be opened
- */
- public InputSource resolveEntity( String publicId, String systemId ) throws SAXException, IOException
- {
- String file = systemId.substring( systemId.lastIndexOf( '/' ) + 1 );
- URL url;
- if ( m_engine.getServletContext() == null )
- {
- ClassLoader cl = WebContainerAuthorizer.class.getClassLoader();
- url = cl.getResource( "WEB-INF/dtd/" + file );
- }
- else
- {
- url = m_engine.getServletContext().getResource( "/WEB-INF/dtd/" + file );
- }
-
- if( url != null )
- {
- InputSource is = new InputSource( url.openStream() );
- log.debug( "Resolved systemID=" + systemId + " using local file " + url );
- return is;
- }
-
- //
- // Let's fall back to default behaviour of the container, and let's
- // also let the user know what is going on. This caught me by surprise
- // while running JSPWiki on an unconnected laptop...
- //
- // The DTD needs to be resolved and read because it contains things like
- // entity definitions...
- //
- log.info("Please note: There are no local DTD references in /WEB-INF/dtd/"+file+"; falling back to default behaviour."+
- " This may mean that the XML parser will attempt to connect to the internet to find the DTD."+
- " If you are running JSPWiki locally in an unconnected network, you might want to put the DTD files in place to avoid nasty UnknownHostExceptions.");
-
-
- // Fall back to default behaviour
- return null;
- }
- }
-
}
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java Mon Oct 26 03:57:51 2009
@@ -476,51 +476,58 @@
public void shutdown()
{
release();
+ if ( m_repository == null )
+ {
+ return;
+ }
//
- // If this is a Jackrabbit Repository, we'll call it's shutdown() method
+ // If this is either Jackrabbit or Priha, we'll call it's shutdown() method
// to make sure it's really shut down.
//
- // FIXME: I am not too sure whether this really works.
- try
+ String[] jcrRepoClassNames = { "org.apache.jackrabbit.core.JackrabbitRepository",
+ "org.priha.core.RepositoryImpl" };
+ for ( String jcrRepoClassName : jcrRepoClassNames )
{
- Class<Repository> jcrRepoClass = (Class<Repository>)Class.forName( "org.apache.jackrabbit.core.JackrabbitRepository" );
- if( m_repository.getClass().isAssignableFrom(jcrRepoClass) )
+ // FIXME: I am not too sure whether this really works.
+ try
{
- log.info( "Shutting down Jackrabbit repository..." );
- Method m = jcrRepoClass.getMethod( "shutdown" );
-
- m.invoke( m_repository );
+ Class<Repository> jcrRepoClass = (Class<Repository>)Class.forName( jcrRepoClassName );
+ if( m_repository.getClass().isAssignableFrom(jcrRepoClass) )
+ {
+ log.info( "Shutting down JCR repository..." );
+ Method m = jcrRepoClass.getMethod( "shutdown" );
+ m.invoke( m_repository );
+ }
+ }
+ catch( ClassNotFoundException e )
+ {
+ // Fine.
+ }
+ catch( NoSuchMethodException e )
+ {
+ log.error( "No shutdown() method for repository class " + m_repository.getClass().getName() );
+ }
+ catch( SecurityException e )
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch( IllegalArgumentException e )
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch( IllegalAccessException e )
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch( InvocationTargetException e )
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
- }
- catch( ClassNotFoundException e )
- {
- // Fine.
- }
- catch( SecurityException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch( NoSuchMethodException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch( IllegalArgumentException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch( IllegalAccessException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch( InvocationTargetException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
}
m_repository = null;
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/Image.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/Image.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/Image.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/Image.java Mon Oct 26 03:57:51 2009
@@ -25,7 +25,6 @@
import org.apache.wiki.WikiContext;
import org.apache.wiki.WikiEngine;
-import org.apache.wiki.api.ModuleData;
import org.apache.wiki.api.PluginException;
import org.apache.wiki.api.WikiPage;
import org.apache.wiki.attachment.AttachmentManager;
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiRequestWrapper.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiRequestWrapper.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiRequestWrapper.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/WikiRequestWrapper.java Mon Oct 26 03:57:51 2009
@@ -89,7 +89,7 @@
@SuppressWarnings("unchecked")
public Enumeration<Locale> getLocales()
{
- Enumeration<Locale> requestLocales = (Enumeration<Locale>)super.getLocales();
+ Enumeration<Locale> requestLocales = super.getLocales();
if( m_locale == null )
{
return requestLocales;
@@ -97,9 +97,9 @@
Vector<Locale> locales = new Vector<Locale>();
locales.add( m_locale );
- for( Enumeration e = requestLocales; e.hasMoreElements(); )
+ for( Enumeration<Locale> e = requestLocales; e.hasMoreElements(); )
{
- locales.add( (Locale)e.nextElement() );
+ locales.add( e.nextElement() );
}
return locales.elements();
}
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/HandlerInfo.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/HandlerInfo.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/HandlerInfo.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/ui/stripes/HandlerInfo.java Mon Oct 26 03:57:51 2009
@@ -37,6 +37,7 @@
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.HandlesEvent;
+import net.sourceforge.stripes.util.bean.EvaluationException;
import net.sourceforge.stripes.util.bean.PropertyExpression;
import net.sourceforge.stripes.util.bean.PropertyExpressionEvaluation;
@@ -394,7 +395,12 @@
if( m_permissionTargetExpression != null )
{
PropertyExpressionEvaluation evaluation = new PropertyExpressionEvaluation( m_permissionTargetExpression, object );
- Object value = evaluation.getValue();
+ Object value = null;
+ try
+ {
+ value = evaluation.getValue();
+ }
+ catch ( EvaluationException e ) { }
if ( value != null )
{
target = value.toString();
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java Mon Oct 26 03:57:51 2009
@@ -65,6 +65,8 @@
* <p>Simple test engine that always assumes pages are found. The version of TestEngine that is part of JSPWiki 3.0
* differs slightly from earlier versions. In particular, it integrates the Stripes framework's mock objects to simulate
* servlet testing.</p>
+ * <p>JUnit test classes <em>must</em> call {@link #shutdown()} at the end of tests so that the
+ * Priha JCR backend used for testing is properly shut down.</p>
* <p>Because of its use of Stripes mock objects, TestEngine needs to be able to find the various ActionBean
* implementations provided in JSPWiki. Therefore, it is <em>extremely</em> sensitive to changes in the build
* path. In particular, the mock servlet filter used by TestEngine hard-wires in the relative location
@@ -72,7 +74,7 @@
* Ant build scripts use for placing generated Java class files. The Eclipse project configuration must configure
* itself the same way. To run unit tests in Eclipse, the <code>build</code> directory absolutely <em>must</em>
* place generated class files in this directory, rather than the Eclipse default of <code>classes</code>. If
- * unit tests do not run in Eclipse for some reason, this is the likeliest culprit.
+ * unit tests do not run in Eclipse for some reason, this is the likeliest culprit.</p>
*/
public class TestEngine extends WikiEngine
{
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java Mon Oct 26 03:57:51 2009
@@ -180,6 +180,7 @@
WikiEngine engine = new TestEngine( props );
AuthenticationManager authMgr = engine.getAuthenticationManager();
assertEquals( CookieAssertionLoginModule.class, authMgr.m_loginModuleClass );
+ engine.shutdown();
}
public void testCustomJAASLoginModuleOptions() throws Exception
@@ -205,6 +206,7 @@
assertEquals( "value1", options.get( "key1" ) );
assertEquals( "value2", options.get( "key2" ) );
assertEquals( "value3", options.get( "key3" ) );
+ engine.shutdown();
}
public void testIsUserPrincipal()
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PageViewPluginTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PageViewPluginTest.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PageViewPluginTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PageViewPluginTest.java Mon Oct 26 03:57:51 2009
@@ -70,6 +70,7 @@
m_engine.deletePage( "PageViewPluginTest01" );
m_engine.deletePage( "PageViewPluginTest02" );
m_engine.deletePage( "PageViews" );
+ m_engine.shutdown();
}
catch( ProviderException e )
{
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/FileBasedActionResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/FileBasedActionResolverTest.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/FileBasedActionResolverTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/FileBasedActionResolverTest.java Mon Oct 26 03:57:51 2009
@@ -28,7 +28,6 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
import net.sourceforge.stripes.controller.DispatcherServlet;
-import net.sourceforge.stripes.controller.DynamicMappingFilter;
import net.sourceforge.stripes.controller.StripesFilter;
import net.sourceforge.stripes.mock.MockRoundtrip;
import net.sourceforge.stripes.mock.MockServletContext;
@@ -41,6 +40,7 @@
public class FileBasedActionResolverTest extends TestCase
{
private MockServletContext m_servletContext = null;
+ private WikiEngine m_engine = null;
public void setUp()
{
@@ -60,8 +60,8 @@
m_servletContext = servletContext;
// Set the admin password and base URL so that the Installer interceptor doesnt't trip
- WikiEngine engine = WikiEngine.getInstance( servletContext, null );
- Properties props = engine.getWikiProperties();
+ m_engine = WikiEngine.getInstance( servletContext, null );
+ Properties props = m_engine.getWikiProperties();
props.setProperty( InstallActionBean.PROP_ADMIN_PASSWORD_HASH, "foobar" );
props.setProperty( WikiEngine.PROP_BASEURL, "http://127.0.0.1" );
}
@@ -69,6 +69,7 @@
protected void tearDown() throws Exception
{
super.tearDown();
+ m_engine.shutdown();
}
public void testViewActionBean() throws Exception
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java Mon Oct 26 03:57:51 2009
@@ -57,7 +57,7 @@
}
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
m_engine.shutdown();
@@ -189,24 +189,16 @@
public void testNotEvaluatedPermissionAnnotation() throws Exception
{
- MockRoundtrip trip;
- EditActionBean bean;
- Method method;
- HandlerInfo handlerInfo;
- Permission perm;
-
// Set up a new EditActionBean without a page parameter
- trip = m_engine.guestTrip( "/Edit.action" );
- trip.execute( "edit" );
- bean = trip.getActionBean( EditActionBean.class );
+ EditActionBean bean = new EditActionBean();
// The view handler should NOT return an "edit" PagePermission (because
// EL can't evaluate)
- method = EditActionBean.class.getMethod( "edit", new Class[0] );
+ Method method = EditActionBean.class.getMethod( "edit", new Class[0] );
Map<Method,HandlerInfo> handlerInfos = HandlerInfo.getHandlerInfoCollection( EditActionBean.class );
- handlerInfo = handlerInfos.get( method );
+ HandlerInfo handlerInfo = handlerInfos.get( method );
assertNotNull( handlerInfo );
- perm = handlerInfo.getPermission( bean );
+ Permission perm = handlerInfo.getPermission( bean );
assertNull( perm );
}
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/ShortUrlRedirectFilterTest.java Mon Oct 26 03:57:51 2009
@@ -31,6 +31,7 @@
import net.sourceforge.stripes.mock.MockRoundtrip;
import net.sourceforge.stripes.mock.MockServletContext;
+import org.apache.wiki.WikiEngine;
import org.apache.wiki.action.ViewActionBean;
@@ -61,6 +62,8 @@
protected void tearDown() throws Exception
{
super.tearDown();
+ WikiEngine engine = WikiEngine.getInstance( m_servletContext, null );
+ engine.shutdown();
}
public void testRedirectEdit() throws Exception
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/workflow/OutcomeTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/workflow/OutcomeTest.java?rev=829697&r1=829696&r2=829697&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/workflow/OutcomeTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/workflow/OutcomeTest.java Mon Oct 26 03:57:51 2009
@@ -78,6 +78,8 @@
o = Outcome.DECISION_REASSIGN;
assertEquals("Reassign", i18n.get(core, english, o.getMessageKey()));
+
+ engine.shutdown();
}
public void testIsCompletion()