Newer
Older
package test;
import search.trawl.*;
import java.util.ArrayList;
import search.trawl.BasicSearchResult;
import graph.Cluster;
import graph.RecordCluster;
/**
* Test cases for Cluster.java
* @author TrawlStars, Inc.
*
*/
public class TestCluster {
public static BasicSearchResult bsr;
public static ArrayList<RecordCluster> clus;
@BeforeClass
public static void setUp() throws Exception {
BioTree.init();
FileProcessor.setPath("smalldata.csv");
FileProcessor.initProcessing();
}
// Check if a cluster is returned for each object
@Test
public void testCluster1() {
clus = Cluster.cluster(1.0, bsr);
assert(clus.size() == bsr.n());
}
// Check if a cluster contains the correct amount of points
@Test
public void testCluster2() {
clus = Cluster.cluster(.01, bsr);
System.out.println(clus.get(0).N());
assert(clus.get(0).N() == 1);
}
// Check if a cluster contains the correct amount of points
@Test
public void testCluster3() {
assert(clus.get(0).N() == 3);
}
// Check if a cluster contains the correct amount of points
@Test
public void testCluster4() {