mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gsing...@apache.org
Subject svn commit: r959641 - /mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java
Date Thu, 01 Jul 2010 12:52:37 GMT
Author: gsingers
Date: Thu Jul  1 12:52:37 2010
New Revision: 959641

URL: http://svn.apache.org/viewvc?rev=959641&view=rev
Log:
MAHOUT-374: Get the tests to pass

Modified:
    mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java

Modified: mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java?rev=959641&r1=959640&r2=959641&view=diff
==============================================================================
--- mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java (original)
+++ mahout/trunk/utils/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java Thu
Jul  1 12:52:37 2010
@@ -132,7 +132,14 @@ public class TestClusterDumper extends M
     i = 0;
     for (Vector vector : iterable) {
       Assert.assertNotNull(vector);
-      NamedVector namedVector = new NamedVector(vector, "P(" + i + ')');
+      NamedVector namedVector;
+      if (vector instanceof NamedVector){
+        //rename it for testing purposes
+        namedVector = new NamedVector(((NamedVector)vector).getDelegate(), "P(" + i + ')');
+
+      } else {
+        namedVector = new NamedVector(vector, "P(" + i + ')');
+      }
       System.out.println(ClusterBase.formatVector(namedVector, termDictionary));
       sampleData.add(new VectorWritable(namedVector));
       i++;



Mime
View raw message