roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r912295 - in /roller/trunk: planet-business/ planet-business/src/test/java/org/apache/roller/planet/business/ planet-business/src/test/java/org/apache/roller/planet/util/rome/ planet-business/src/test/resources/ weblogger-business/ weblogge...
Date Sun, 21 Feb 2010 04:12:40 GMT
Author: snoopdave
Date: Sun Feb 21 04:12:40 2010
New Revision: 912295

URL: http://svn.apache.org/viewvc?rev=912295&view=rev
Log:
Fixes to get those last two tests working on Windows.

Modified:
    roller/trunk/planet-business/pom.xml
    roller/trunk/planet-business/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java
    roller/trunk/planet-business/src/test/java/org/apache/roller/planet/util/rome/DiskFeedInfoCacheTest.java
    roller/trunk/planet-business/src/test/resources/planet-custom.properties
    roller/trunk/weblogger-business/pom.xml
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
    roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
    roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/WeblogStatsTest.java
    roller/trunk/weblogger-business/src/test/resources/planet-custom.properties

Modified: roller/trunk/planet-business/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/pom.xml?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/planet-business/pom.xml (original)
+++ roller/trunk/planet-business/pom.xml Sun Feb 21 04:12:40 2010
@@ -22,7 +22,7 @@
 
     <properties>
         <testOutputDirectory>${project.build.testOutputDirectory}</testOutputDirectory>
-	<cacheDir>${project.build.testOutputDirectory}${file.separator}planetcache</cacheDir>
+	<testPlanetCache>${project.build.testOutputDirectory}${file.separator}planetcache</testPlanetCache>
     </properties>
 
     <dependencies>
@@ -172,8 +172,8 @@
                             <value>${project.basedir}/src/main/webapp</value>
                         </property>
                         <property>
-                            <name>project.build.directory</name>
-                            <value>${project.build.directory}</value>
+                            <name>testPlanetCache</name>
+                            <value>${project.build.testOutputDirectory}${file.separator}planetcache</value>
                         </property>
                     </systemProperties>
                     <excludes>

Modified: roller/trunk/planet-business/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/planet-business/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java
(original)
+++ roller/trunk/planet-business/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java
Sun Feb 21 04:12:40 2010
@@ -16,14 +16,11 @@
 
 package org.apache.roller.planet.business;
 
-import java.io.File;
 import junit.framework.TestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.planet.TestUtils;
 import org.apache.roller.planet.business.fetcher.FeedFetcher;
-import org.apache.roller.planet.pojos.Planet;
-import org.apache.roller.planet.pojos.PlanetGroup;
 import org.apache.roller.planet.pojos.Subscription;
 
 

Modified: roller/trunk/planet-business/src/test/java/org/apache/roller/planet/util/rome/DiskFeedInfoCacheTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/src/test/java/org/apache/roller/planet/util/rome/DiskFeedInfoCacheTest.java?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/planet-business/src/test/java/org/apache/roller/planet/util/rome/DiskFeedInfoCacheTest.java
(original)
+++ roller/trunk/planet-business/src/test/java/org/apache/roller/planet/util/rome/DiskFeedInfoCacheTest.java
Sun Feb 21 04:12:40 2010
@@ -23,6 +23,7 @@
 import junit.framework.TestSuite;
 import com.sun.syndication.fetcher.impl.SyndFeedInfo;
 import com.sun.syndication.fetcher.impl.DiskFeedInfoCache;
+import org.apache.roller.planet.config.PlanetConfig;
 
 
 /**
@@ -39,20 +40,15 @@
         SyndFeedInfo info = new SyndFeedInfo();
         info.setUrl(url);
         
-        String buildDir = System.getProperty("project.build.directory");
-        assertNotNull("project.build.directory not null", buildDir);
-        assertTrue("project.build.directory not zero length", buildDir.trim().length() >
0);
-        if (!buildDir.startsWith("/")) buildDir = "..";
-        File file = new File(buildDir);
+        String testPlanetCache = PlanetConfig.getProperty("cache.dir");
+        assertNotNull("testPlanetCache not null", testPlanetCache);
+        assertTrue("testPlanetCache not zero length", testPlanetCache.trim().length() >
0);
         
-        assertTrue("buildDir exists", file.exists());
-        assertTrue("buildDir is directory", file.isDirectory());
-        
-        File cacheDir = new File(buildDir + File.separator + "planet-cache");
+        File cacheDir = new File(testPlanetCache);
         if (!cacheDir.exists()) cacheDir.mkdirs();
         
         DiskFeedInfoCache cache =
-                new DiskFeedInfoCache(cacheDir.getAbsolutePath());
+                new DiskFeedInfoCache(PlanetConfig.getProperty("cache.dir"));
         cache.setFeedInfo(info.getUrl(), info);
         
         SyndFeedInfo info2 = cache.getFeedInfo(url);

Modified: roller/trunk/planet-business/src/test/resources/planet-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/src/test/resources/planet-custom.properties?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/planet-business/src/test/resources/planet-custom.properties (original)
+++ roller/trunk/planet-business/src/test/resources/planet-custom.properties Sun Feb 21 04:12:40
2010
@@ -17,7 +17,7 @@
 
 #openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE
 
-cache.dir=${cacheDir}/planetcache
-output.dir=${testOutputDir}/planetoutput
+cache.dir=${testPlanetCache}
+output.dir=${testOutputDirectory}/planetoutput
 #template.dir=./testcontext/WEB-INF/templates
 

Modified: roller/trunk/weblogger-business/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/pom.xml?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/weblogger-business/pom.xml (original)
+++ roller/trunk/weblogger-business/pom.xml Sun Feb 21 04:12:40 2010
@@ -25,6 +25,7 @@
 	<testUploadsDir>${project.build.testOutputDirectory}${file.separator}uploadsdir</testUploadsDir>
 	<testThemesDir> ${project.build.testOutputDirectory}${file.separator}themes</testThemesDir>
 	<testIndexDir>  ${project.build.testOutputDirectory}${file.separator}index</testIndexDir>
+	<testPlanetCache>${project.build.testOutputDirectory}${file.separator}planetcache</testPlanetCache>
     </properties>
 
     <dependencies>

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
Sun Feb 21 04:12:40 2010
@@ -37,11 +37,9 @@
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy;
 
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.Weblogger;
-import org.apache.roller.weblogger.business.WeblogManager;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
 import org.apache.roller.weblogger.pojos.WeblogHitCount;
 import org.apache.roller.weblogger.pojos.WeblogReferrer;

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
Sun Feb 21 04:12:40 2010
@@ -29,7 +29,6 @@
 import java.util.Comparator;
 import java.util.Hashtable;
 import javax.persistence.NoResultException;
-import javax.persistence.Query;
 
 import javax.persistence.Query;
 import org.apache.commons.logging.Log;

Modified: roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
(original)
+++ roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
Sun Feb 21 04:12:40 2010
@@ -334,7 +334,11 @@
         assertNotNull(mediaFile1.getTags());
         assertEquals(2, mediaFile1.getTags().size());
 
-        mfMgr.removeMediaFile(testWeblog, mediaFile1);
+        try {
+            mfMgr.removeMediaFile(testWeblog, mediaFile1);
+        } catch (Exception ignorable) {
+            log.debug("ERROR removing media file", ignorable);
+        }
         TestUtils.endSession(true);
 
         MediaFile mediaFile2 = mfMgr.getMediaFile(id);
@@ -344,6 +348,10 @@
         TestUtils.endSession(true);
         TestUtils.teardownWeblog(testWeblog.getId());
         TestUtils.teardownUser(testUser.getUserName());
+
+        String uploadsDirName = WebloggerConfig.getProperty("uploads.dir");
+        File flag = new File(uploadsDirName + File.separator + "migration-status.properties");
+        flag.delete();
     }
 
     /**

Modified: roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/WeblogStatsTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/WeblogStatsTest.java?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/WeblogStatsTest.java
(original)
+++ roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/WeblogStatsTest.java
Sun Feb 21 04:12:40 2010
@@ -4,9 +4,6 @@
 import java.util.Map;
 import junit.framework.TestCase;
 import org.apache.roller.weblogger.TestUtils;
-import org.apache.roller.weblogger.business.WebloggerFactory;
-import org.apache.roller.weblogger.business.UserManager;
-import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
 import org.apache.roller.weblogger.pojos.StatCount;
 import org.apache.roller.weblogger.pojos.User;
@@ -52,6 +49,8 @@
                 "anchor21", website2.getDefaultCategory(), website2, user1);
         comment21 = TestUtils.setupComment("Comment21", entry21);
         TestUtils.endSession(true);
+
+        Thread.sleep(1000);
     }
     public void testGetMostCommentedWeblogs() throws Exception {        
         WeblogManager mgr = WebloggerFactory.getWeblogger().getWeblogManager();     

Modified: roller/trunk/weblogger-business/src/test/resources/planet-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/test/resources/planet-custom.properties?rev=912295&r1=912294&r2=912295&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/test/resources/planet-custom.properties (original)
+++ roller/trunk/weblogger-business/src/test/resources/planet-custom.properties Sun Feb 21
04:12:40 2010
@@ -9,6 +9,8 @@
 database.jdbc.username=app
 database.jdbc.password=app
 
+cache.dir=${planetCacheDir}
+
 #database.jdbc.driverClass=com.mysql.jdbc.Driver
 #database.jdbc.connectionURL=jdbc:mysql://localhost:3306/rollertest
 #database.jdbc.username=scott



Mime
View raw message