mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1337112 - in /mahout/trunk/core/src: main/java/org/apache/mahout/math/stats/entropy/ test/java/org/apache/mahout/math/stats/entropy/
Date Fri, 11 May 2012 11:13:24 GMT
Author: ssc
Date: Fri May 11 11:13:24 2012
New Revision: 1337112

URL: http://svn.apache.org/viewvc?rev=1337112&view=rev
Log:
MAHOUT-1013 The tests for org.apache.mahout.math.stats.entropy should not write to the project
home but to a temp directory

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/math/stats/entropy/InformationGain.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/ConditionalEntropyTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/EntropyTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainRatioTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainTest.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/math/stats/entropy/InformationGain.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/stats/entropy/InformationGain.java?rev=1337112&r1=1337111&r2=1337112&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/stats/entropy/InformationGain.java
(original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/stats/entropy/InformationGain.java
Fri May 11 11:13:24 2012
@@ -84,13 +84,15 @@ public final class InformationGain exten
   }
 
   private void calculateEntropy() throws Exception {
-    String[] args = { "-i", getInputPath().toString(), "-o", entropyPath.toString(), "-s",
"value" };
+    String[] args = { "-i", getInputPath().toString(), "-o", entropyPath.toString(), "-s",
"value",
+        "--tempDir", getTempPath().toString() };
     ToolRunner.run(new Entropy(), args);
     entropy = readDoubleFromPath(entropyPath);
   }
 
   private void calculateConditionalEntropy() throws Exception {
-    String[] args = { "-i", getInputPath().toString(), "-o", conditionalEntropyPath.toString()
};
+    String[] args = { "-i", getInputPath().toString(), "-o", conditionalEntropyPath.toString(),
+        "--tempDir", getTempPath().toString() };
     ToolRunner.run(new ConditionalEntropy(), args);
     conditionalEntropy = readDoubleFromPath(conditionalEntropyPath);
   }

Modified: mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/ConditionalEntropyTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/ConditionalEntropyTest.java?rev=1337112&r1=1337111&r2=1337112&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/ConditionalEntropyTest.java
(original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/ConditionalEntropyTest.java
Fri May 11 11:13:24 2012
@@ -58,7 +58,8 @@ public final class ConditionalEntropyTes
 
     // run the job
     Tool job = new ConditionalEntropy();
-    String[] args = { "-i", input.toString(), "-o", output.toString() };
+    String[] args = { "-i", input.toString(), "-o", output.toString(),
+        "--tempDir", getTestTempDirPath("tmp").toString() };
     ToolRunner.run(job, args);
 
     // check the output

Modified: mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/EntropyTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/EntropyTest.java?rev=1337112&r1=1337111&r2=1337112&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/EntropyTest.java
(original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/EntropyTest.java
Fri May 11 11:13:24 2012
@@ -72,7 +72,8 @@ public final class EntropyTest extends M
     }
 
     // run the job
-    String[] args = { "-i", input.toString(), "-o", output.toString(), "-s", source };
+    String[] args = { "-i", input.toString(), "-o", output.toString(), "-s", source,
+        "--tempDir", getTestTempDirPath("tmp").toString() };
     Entropy job = new Entropy();
     ToolRunner.run(job, args);
 

Modified: mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainRatioTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainRatioTest.java?rev=1337112&r1=1337111&r2=1337112&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainRatioTest.java
(original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainRatioTest.java
Fri May 11 11:13:24 2012
@@ -50,7 +50,7 @@ public final class InformationGainRatioT
 
     // run the job
     InformationGainRatio job = new InformationGainRatio();
-    String[] args = { "-i", input.toString() };
+    String[] args = { "-i", input.toString(), "--tempDir", getTestTempDirPath("tmp").toString()
};
     ToolRunner.run(job, args);
 
     // check the output

Modified: mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainTest.java?rev=1337112&r1=1337111&r2=1337112&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainTest.java
(original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/math/stats/entropy/InformationGainTest.java
Fri May 11 11:13:24 2012
@@ -50,7 +50,7 @@ public final class InformationGainTest e
 
     // run the job
     InformationGain job = new InformationGain();
-    String[] args = { "-i", input.toString() };
+    String[] args = { "-i", input.toString(), "--tempDir", getTestTempDirPath("tmp").toString()
};
     ToolRunner.run(job, args);
 
     // check the output



Mime
View raw message