3 | org.junit.Test |
---|
@@ -23,6 +23,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.LongWritable; +import org.apache.mahout.common.MahoutTestCase; import org.apache.mahout.math.DenseVector; import org.apache.mahout.math.Vector; import org.apache.mahout.math.VectorWritable; @@ -33,7 +34,7 @@ import java.io.StringWriter; import java.util.List; import java.util.ArrayList; -public class VectorWriterTest extends TestCase { +public class VectorWriterTest extends MahoutTestCase { public void testSFVW() throws Exception { File tmpDir = new File(System.getProperty("java.io.tmpdir"));
@@ -34,6 +34,7 @@ import org.apache.hadoop.mrunit.mapreduce.ReduceDriver; import org.apache.mahout.clustering.ClusteringUtils; import org.apache.mahout.clustering.streaming.cluster.DataUtils; import org.apache.mahout.clustering.streaming.cluster.StreamingKMeans; +import org.apache.mahout.common.MahoutTestCase; import org.apache.mahout.common.Pair; import org.apache.mahout.common.RandomUtils; import org.apache.mahout.common.commandline.DefaultOptionCreator; @@ -56,7 +57,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @RunWith(Parameterized.class) -public class StreamingKMeansTestMR { +public class StreamingKMeansTestMR extends MahoutTestCase { private static final int NUM_DATA_POINTS = 1 << 15; private static final int NUM_DIMENSIONS = 8; private static final int NUM_PROJECTIONS = 3; @@ -232,7 +233,7 @@ public class StreamingKMeansTestMR { @Test public void testHypercubeMapReduceRunSequentially() throws Exception { - Configuration configuration = new Configuration(); + Configuration configuration = getConfiguration(); configure(configuration); configuration.set(DefaultOptionCreator.METHOD_OPTION, DefaultOptionCreator.SEQUENTIAL_METHOD);
@@ -26,6 +26,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.Writable; +import org.apache.mahout.common.MahoutTestCase; import org.apache.mahout.common.RandomUtils; import org.apache.mahout.math.DenseMatrix; import org.apache.mahout.math.DenseVector; @@ -115,7 +116,8 @@ public final class SSVDTestsHelper { // do not use. for internal consumption only. public static void main(String[] args) throws Exception { // create 1Gb input for distributed tests. - Configuration conf = new Configuration(); + MahoutTestCase ca = new MahoutTestCase(); + Configuration conf = ca.getConfiguration(); FileSystem dfs = FileSystem.getLocal(conf); Path outputDir=new Path("/tmp/DRM"); dfs.mkdirs(outputDir);