commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r922115 - in /commons/proper/sanselan/trunk: ./ src/test/java/org/apache/sanselan/ src/test/java/org/apache/sanselan/formats/png/
Date Fri, 12 Mar 2010 02:08:26 GMT
Author: niallp
Date: Fri Mar 12 02:08:26 2010
New Revision: 922115

URL: http://svn.apache.org/viewvc?rev=922115&view=rev
Log:
SANSELAN-36 Fix Sanselan tests failing on Windows
(add TEST dependency to commons-io and use FilenameUtils.separatorsToSystem() to convert paths)

Modified:
    commons/proper/sanselan/trunk/pom.xml
    commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanGuessFormatTest.java
    commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanTestConstants.java
    commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngMultipleRoundtripTest.java

Modified: commons/proper/sanselan/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/pom.xml?rev=922115&r1=922114&r2=922115&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/pom.xml (original)
+++ commons/proper/sanselan/trunk/pom.xml Fri Mar 12 02:08:26 2010
@@ -101,6 +101,12 @@
       <version>3.8.2</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>1.4</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
   
   <reporting>

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanGuessFormatTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanGuessFormatTest.java?rev=922115&r1=922114&r2=922115&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanGuessFormatTest.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanGuessFormatTest.java
Fri Mar 12 02:08:26 2010
@@ -19,6 +19,7 @@ package org.apache.sanselan;
 
 import java.io.File;
 import java.io.IOException;
+import org.apache.commons.io.FilenameUtils;
 
 public class SanselanGuessFormatTest extends SanselanTest {
 
@@ -63,8 +64,7 @@ public class SanselanGuessFormatTest ext
 
 	public void testGuess(ImageFormat expectedFormat, String imagePath)
 			throws IOException, ImageReadException, ImageWriteException {
-		imagePath = imagePath.replaceAll("\\\\", System
-				.getProperty("file.separator"));
+		imagePath = FilenameUtils.separatorsToSystem(imagePath);
 		File imageFile = new File(TEST_IMAGE_FOLDER, imagePath);
 
 		assertTrue(imageFile.exists());

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanTestConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanTestConstants.java?rev=922115&r1=922114&r2=922115&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanTestConstants.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/SanselanTestConstants.java
Fri Mar 12 02:08:26 2010
@@ -18,12 +18,12 @@
 package org.apache.sanselan;
 
 import java.io.File;
+import org.apache.commons.io.FilenameUtils;
 
 public interface SanselanTestConstants {
 
 	static final File PHIL_HARVEY_TEST_IMAGE_FOLDER = new File(
-			"src\\test\\data\\images\\exif\\philHarvey\\".replaceAll("\\\\", System
-					.getProperty("file.separator")));
+			FilenameUtils.separatorsToSystem("src\\test\\data\\images\\exif\\philHarvey\\"));
 
 	static final File SOURCE_FOLDER = new File("src");
 	static final File TEST_SOURCE_FOLDER = new File(SOURCE_FOLDER, "test");

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngMultipleRoundtripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngMultipleRoundtripTest.java?rev=922115&r1=922114&r2=922115&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngMultipleRoundtripTest.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngMultipleRoundtripTest.java
Fri Mar 12 02:08:26 2010
@@ -28,6 +28,7 @@ import org.apache.sanselan.ImageReadExce
 import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
 import org.apache.sanselan.util.Debug;
+import org.apache.commons.io.FilenameUtils;
 
 public class PngMultipleRoundtripTest extends PngBaseTest
 {
@@ -35,7 +36,7 @@ public class PngMultipleRoundtripTest ex
 	public void test() throws IOException, ImageReadException,
 			ImageWriteException
 	{
-		String imagesFolderPath = "src\\test\\data\\images\\png\\3".replaceAll("\\\\", System.getProperty("file.separator"));
+		String imagesFolderPath = FilenameUtils.separatorsToSystem("src\\test\\data\\images\\png\\3");
 		File imagesFolder = new File(imagesFolderPath);
 		assertTrue(imagesFolder.exists() && imagesFolder.isDirectory());
 		



Mime
View raw message