jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r1510182 - in /jspwiki/trunk: ./ jspwiki-war/src/main/java/org/apache/wiki/ jspwiki-war/src/main/java/org/apache/wiki/search/ jspwiki-war/src/test/java/org/apache/wiki/ jspwiki-war/src/test/java/org/apache/wiki/search/
Date Sun, 04 Aug 2013 13:30:36 GMT
Author: metskem
Date: Sun Aug  4 13:30:36 2013
New Revision: 1510182

URL: http://svn.apache.org/r1510182
Log:
2013-08-04  Harry Metske (metskem@apache.org)

       * 2.10.0-svn-32

       * first guess in fixing JSPWIKI-799 TestEngine.emptyWorkdir() cleans another directory
the the one used by the test ?

Modified:
    jspwiki/trunk/ChangeLog
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java

Modified: jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/jspwiki/trunk/ChangeLog?rev=1510182&r1=1510181&r2=1510182&view=diff
==============================================================================
--- jspwiki/trunk/ChangeLog (original)
+++ jspwiki/trunk/ChangeLog Sun Aug  4 13:30:36 2013
@@ -1,3 +1,9 @@
+2013-08-04  Harry Metske (metskem@apache.org)
+
+       * 2.10.0-svn-32
+
+       * first guess in fixing JSPWIKI-799 TestEngine.emptyWorkdir() cleans another directory
the the one used by the test ?
+
 2013-08-03  Harry Metske (metskem@apache.org)
 
        * 2.10.0-svn-31

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java?rev=1510182&r1=1510181&r2=1510182&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java Sun Aug  4 13:30:36
2013
@@ -75,7 +75,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "31";
+    public static final String     BUILD         = "32";
     
     /**
      *  This is the generic version string you should use

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java?rev=1510182&r1=1510181&r2=1510182&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java Sun
Aug  4 13:30:36 2013
@@ -71,7 +71,7 @@ public class SearchManager
      *  
      *  @param engine The WikiEngine that owns this SearchManager.
      *  @param properties The list of Properties.
-     *  @throws WikiException If it cannot be instantiated.
+     *  @throws FilterException If it cannot be instantiated.
      */
     public SearchManager( WikiEngine engine, Properties properties )
         throws FilterException

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java?rev=1510182&r1=1510181&r2=1510182&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java Sun Aug  4 13:30:36
2013
@@ -145,27 +145,30 @@ public class TestEngine extends WikiEngi
         request.addLocale( new Locale( "" ) );
         return request;
     }
-    
-    public static void emptyWorkDir()
-    {
-        Properties properties = new Properties();
 
-        try
-        {
-            properties.load( findTestProperties() );
+    public static void emptyWorkDir() {
+        emptyWorkDir( null );
+    }
+
+    public static void emptyWorkDir(Properties properties) {
+
+        try {
+            if (properties == null) {
+                properties = new Properties();
+                properties.load( findTestProperties() );
+            }
 
             String workdir = properties.getProperty( WikiEngine.PROP_WORKDIR );
-            if( workdir != null )
-            {
+            if ( workdir != null ) {
                 File f = new File( workdir );
 
-                if( f.exists() && f.isDirectory() && new File( f, "refmgr.ser"
).exists() )
-                {
+                if (f.exists() && f.isDirectory() && new File( f, "refmgr.ser"
).exists()) {
                     deleteAll( f );
                 }
             }
+        } catch (IOException e) {
+            System.out.println( e );
         }
-        catch( IOException e ) {} // Fine
     }
 
     public static final InputStream findTestProperties()

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java?rev=1510182&r1=1510181&r2=1510182&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
Sun Aug  4 13:30:36 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.wiki.search;
 
+import java.io.File;
 import java.util.Collection;
 import java.util.Properties;
 
@@ -26,6 +27,7 @@ import net.sourceforge.stripes.mock.Mock
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
+import org.apache.wiki.Release;
 import org.apache.wiki.SearchResult;
 import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
@@ -45,9 +47,9 @@ public class SearchManagerTest extends T
         
         props.setProperty( SearchManager.PROP_SEARCHPROVIDER, "LuceneSearchProvider" );
         props.setProperty( "jspwiki.lucene.initialdelay", "1" );
-        props.setProperty( "jspwiki.workDir", System.getProperty( "java.io.tmpdir" ) );
+        props.setProperty( "jspwiki.workDir", System.getProperty( "java.io.tmpdir" ) + File.separator
+ Release.APPNAME );
         
-        TestEngine.emptyWorkDir();
+        TestEngine.emptyWorkDir(props);
         
         m_engine = new TestEngine( props );
         m_mgr = m_engine.getSearchManager();



Mime
View raw message