Author: sebb
Date: Sun Aug 21 13:51:04 2011
New Revision: 1159981
URL: http://svn.apache.org/viewvc?rev=1159981&view=rev
Log:
Add specific check for incorrect classpath, rather than relying on NPE
Modified:
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java
Modified:
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java?rev=1159981&r1=1159980&r2=1159981&view=diff
==============================================================================
---
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java
(original)
+++
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java
Sun Aug 21 13:51:04 2011
@@ -24,6 +24,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
+import java.net.URL;
import java.util.ArrayList;
import junit.framework.AssertionFailedError;
@@ -63,7 +64,9 @@ public class LongPathTest extends Abstra
public static TestSuite suite() throws IOException{
TestSuite suite = new TestSuite("LongPathTests");
- File arcdir =new File(classLoader.getResource("longpath").getFile());
+ URL resource = classLoader.getResource("longpath");
+ assertNotNull("Cannot find 'longpath' resource",resource);
+ File arcdir =new File(resource.getFile());
assertTrue(arcdir.exists());
File listing= new File(arcdir,"files.txt");
assertTrue("File listing is readable",listing.canRead());