@Test
public void test() throws Exception {
HamaConfiguration conf = controller.getConfiguration();
BSPJobClient jobClient = new BSPJobClient(conf);
ClusterStatus cluster = jobClient.getClusterStatus(true);
assertNotNull(cluster);
assertTrue(cluster.getGroomServers() > 0);
BSPJob bsp = new BSPJob(conf, PiEstimator.class);
// Set the job name
bsp.setJobName("Pi Estimation Example");
bsp.setBspClass(MyEstimator.class);
bsp.setNumBspTask(cluster.getGroomServers());
for (String peerName : cluster.getActiveGroomNames().values()) {
conf.set(masterTask, peerName);
break;
}
if (bsp.waitForCompletion(true)) {
assertEquals(jobClient.getAllJobs().length, 1);
}
}