Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

Fixed junit test for plugin parse-ext.

John Xing356f063ab765
diff --git a/src/plugin/build.xml b/src/plugin/build.xml
index 5c2d849c7..62e380d0a 100755
--- a/src/plugin/build.xml
+++ b/src/plugin/build.xml
@@ -40,7 +40,7 @@
<ant dir="parse-msword" target="test"/>
<!-- <ant dir="parse-mp3" target="test"/> -->
<!-- <ant dir="parse-rtf" target="test"/> -->
-<!-- <ant dir="parse-ext" target="test"/> -->
+ <ant dir="parse-ext" target="test"/>
<ant dir="creativecommons" target="test"/>
<ant dir="languageidentifier" target="test"/>
<ant dir="ontology" target="test"/>
diff --git a/src/plugin/parse-ext/src/test/org/apache/nutch/parse/ext/TestExtParser.java b/src/plugin/parse-ext/src/test/org/apache/nutch/parse/ext/TestExtParser.java
index e02cb1389..c3463835a 100644
--- a/src/plugin/parse-ext/src/test/org/apache/nutch/parse/ext/TestExtParser.java
+++ b/src/plugin/parse-ext/src/test/org/apache/nutch/parse/ext/TestExtParser.java
@@ -66,10 +66,10 @@ public class TestExtParser extends TestCase {
File tempDir = new File(path);
if (!tempDir.exists())
tempDir.mkdir();
- tempFile = File.createTempFile("nutch.test.plugin.ExtParser.","",tempDir);
+ tempFile = File.createTempFile("nutch.test.plugin.ExtParser.",".txt",tempDir);
} else {
// otherwise in java.io.tmpdir
- tempFile = File.createTempFile("nutch.test.plugin.ExtParser.","");
+ tempFile = File.createTempFile("nutch.test.plugin.ExtParser.",".txt");
}
urlString = tempFile.toURL().toString();
@@ -96,8 +96,11 @@ public class TestExtParser extends TestCase {
String contentType;
// now test only on linux platform
- if (!System.getProperty("os.name").equalsIgnoreCase("linux"))
+ if (!System.getProperty("os.name").equalsIgnoreCase("linux")) {
+ System.err.println("Current OS is "+System.getProperty("os.name")+".");
+ System.err.println("No test is run on OS other than linux.");
return;
+ }
// loop alternately, total 10*2 times of invoking external command
for (int i=0; i<10; i++) {