mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r984290 - in /mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd: DataLineTest.java FileInfosDatasetTest.java hadoop/CDMahoutEvaluatorTest.java
Date Wed, 11 Aug 2010 02:33:29 GMT
Author: drew
Date: Wed Aug 11 02:33:29 2010
New Revision: 984290

URL: http://svn.apache.org/viewvc?rev=984290&view=rev
Log:
Potential fix for failing nightly builds.

Modified:
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/DataLineTest.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/FileInfosDatasetTest.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/DataLineTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/DataLineTest.java?rev=984290&r1=984289&r2=984290&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/DataLineTest.java
(original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/DataLineTest.java
Wed Aug 11 02:33:29 2010
@@ -22,6 +22,8 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.mahout.common.MahoutTestCase;
 
+import com.google.common.io.Resources;
+
 public class DataLineTest extends MahoutTestCase {
 
   private static final String[] datalines = {
@@ -31,7 +33,7 @@ public class DataLineTest extends Mahout
 
   public void testSet() throws Exception {
     FileSystem fs = FileSystem.get(new Configuration());
-    Path inpath = fs.makeQualified(new Path(this.getClass().getResource("/wdbc/").getPath()));
+    Path inpath = fs.makeQualified(new Path(Resources.getResource("wdbc").toString()));
     
     DataSet dataset = FileInfoParser.parseFile(fs, inpath);
     DataSet.initialize(dataset);

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/FileInfosDatasetTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/FileInfosDatasetTest.java?rev=984290&r1=984289&r2=984290&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/FileInfosDatasetTest.java
(original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/FileInfosDatasetTest.java
Wed Aug 11 02:33:29 2010
@@ -24,6 +24,8 @@ import org.apache.hadoop.fs.Path;
 import org.apache.mahout.common.FileLineIterable;
 import org.apache.mahout.common.MahoutTestCase;
 
+import com.google.common.io.Resources;
+
 import java.io.IOException;
 import java.io.File;
 
@@ -31,13 +33,13 @@ public class FileInfosDatasetTest extend
 
   public void testRanges() throws IOException {
     FileSystem fs = FileSystem.get(new Configuration());
-    Path inpath = fs.makeQualified(new Path(this.getClass().getResource("/wdbc/").getPath()));
+    Path inpath = fs.makeQualified(new Path(Resources.getResource("wdbc").toString()));
     
     DataSet dataset = FileInfoParser.parseFile(fs, inpath);
     DataSet.initialize(dataset);
 
     DataLine dl = new DataLine();
-    for (String line : new FileLineIterable(new File(this.getClass().getResource("/wdbc/wdbc.data").getPath())))
{
+    for (String line : new FileLineIterable(new File(Resources.getResource("wdbc/wdbc.data").getPath())))
{
       dl.set(line);
       for (int index = 0; index < dataset.getNbAttributes(); index++) {
         if (dataset.isNumerical(index)) {

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java?rev=984290&r1=984289&r2=984290&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
(original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
Wed Aug 11 02:33:29 2010
@@ -17,19 +17,21 @@
 
 package org.apache.mahout.ga.watchmaker.cd.hadoop;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.mahout.common.MahoutTestCase;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.ga.watchmaker.cd.CDFitness;
 import org.apache.mahout.ga.watchmaker.cd.Rule;
 import org.apache.mahout.ga.watchmaker.cd.utils.RandomRule;
 import org.apache.mahout.ga.watchmaker.cd.utils.RandomRuleResults;
-import org.apache.mahout.common.RandomUtils;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
+import com.google.common.io.Resources;
 
 public class CDMahoutEvaluatorTest extends MahoutTestCase {
 
@@ -47,7 +49,7 @@ public class CDMahoutEvaluatorTest exten
     // dataset
     // This is sensitive to the working directory where the test is run:
     FileSystem fs = FileSystem.get(new Configuration());
-    Path input = fs.makeQualified(new Path(this.getClass().getResource("/wdbc/").getPath()));
+    Path input = fs.makeQualified(new Path(Resources.getResource("wdbc").toString()));
     CDMahoutEvaluator.initializeDataSet(input);
 
     // evaluate the rules



Mime
View raw message