use of org.bboxdb.network.client.BBoxDBClient in project bboxdb by jnidzwetzki.
the class TestNetworkCommunication method testJoin.
/**
* Test the tuple join
* @throws ExecutionException
* @throws InterruptedException
* @throws BBoxDBException
*/
@Test(timeout = 60000)
public void testJoin() throws InterruptedException, ExecutionException, BBoxDBException {
System.out.println("=== Running network testJoin");
final BBoxDBConnection bboxdbConnection = connectToServer();
final BBoxDBClient bboxDBClient = bboxdbConnection.getBboxDBClient();
NetworkQueryHelper.executeJoinQuery(bboxDBClient, DISTRIBUTION_GROUP);
System.out.println("=== End network testJoin");
disconnect(bboxDBClient);
}
use of org.bboxdb.network.client.BBoxDBClient in project bboxdb by jnidzwetzki.
the class TestNetworkCommunication method testSendKeepAlivePackage.
/**
* Send a keep alive package to the server
* @throws InterruptedException
* @throws ExecutionException
*/
@Test(timeout = 60000)
public void testSendKeepAlivePackage() throws InterruptedException, ExecutionException {
System.out.println("=== Running sendKeepAlivePackage");
final BBoxDBConnection bboxdbConnection = connectToServer();
final BBoxDBClient bboxDBClient = bboxdbConnection.getBboxDBClient();
final EmptyResultFuture result = bboxDBClient.sendKeepAlivePackage();
result.waitForAll();
Assert.assertTrue(result.isDone());
Assert.assertFalse(result.isFailed());
Assert.assertTrue(bboxdbConnection.getConnectionState().isInRunningState());
disconnect(bboxDBClient);
Assert.assertFalse(bboxDBClient.isConnected());
System.out.println("=== End sendKeepAlivePackage");
disconnect(bboxDBClient);
}
use of org.bboxdb.network.client.BBoxDBClient in project bboxdb by jnidzwetzki.
the class TestNetworkCommunication method testDoubleDisconnect.
/**
* Test the double disconnect call
*/
@Test(timeout = 60000)
public void testDoubleDisconnect() {
final BBoxDBConnection bboxdbConnection = connectToServer();
final BBoxDBClient bboxDBClient = bboxdbConnection.getBboxDBClient();
disconnect(bboxDBClient);
disconnect(bboxDBClient);
}
use of org.bboxdb.network.client.BBoxDBClient in project bboxdb by jnidzwetzki.
the class TestNetworkCommunication method testSendDeletePackage.
/**
* Send a delete package to the server
* @throws InterruptedException
* @throws ExecutionException
* @throws ZookeeperException
* @throws BBoxDBException
*/
@Test(timeout = 60000)
public void testSendDeletePackage() throws InterruptedException, ExecutionException, ZookeeperException, BBoxDBException {
System.out.println("=== Running sendDeletePackage");
final BBoxDBConnection bboxdbConnection = connectToServer();
final BBoxDBClient bboxDBClient = bboxdbConnection.getBboxDBClient();
final String tableName = DISTRIBUTION_GROUP + "_relation3";
final TupleStoreName tupleStoreName = new TupleStoreName(tableName);
final ZookeeperClient zookeeperClient = ZookeeperClientFactory.getZookeeperClient();
final TupleStoreAdapter tupleStoreAdapter = zookeeperClient.getTupleStoreAdapter();
Assert.assertFalse(tupleStoreAdapter.isTableKnown(tupleStoreName));
// Create table
final TupleStoreConfiguration configuration = TupleStoreConfigurationBuilder.create().build();
final EmptyResultFuture createFuture = bboxDBClient.createTable(tableName, configuration);
createFuture.waitForAll();
Assert.assertTrue(createFuture.isDone());
Assert.assertFalse(createFuture.isFailed());
Assert.assertTrue(tupleStoreAdapter.isTableKnown(tupleStoreName));
// Delete table
final EmptyResultFuture deleteResult1 = bboxDBClient.deleteTable(tableName);
deleteResult1.waitForAll();
Assert.assertTrue(deleteResult1.isDone());
Assert.assertFalse(deleteResult1.isFailed());
Assert.assertTrue(bboxdbConnection.getConnectionState().isInRunningState());
Assert.assertFalse(tupleStoreAdapter.isTableKnown(tupleStoreName));
// Second call
final EmptyResultFuture deleteResult2 = bboxDBClient.deleteTable(tableName);
deleteResult2.waitForAll();
Assert.assertTrue(deleteResult2.isDone());
Assert.assertFalse(deleteResult2.isFailed());
Assert.assertTrue(bboxdbConnection.getConnectionState().isInRunningState());
Assert.assertFalse(tupleStoreAdapter.isTableKnown(tupleStoreName));
// Disconnect
disconnect(bboxDBClient);
Assert.assertFalse(bboxDBClient.isConnected());
System.out.println("=== End sendDeletePackage");
}
use of org.bboxdb.network.client.BBoxDBClient in project bboxdb by jnidzwetzki.
the class TestNetworkCommunication method testInsertedTimeQuery.
/**
* Execute the version inserted query
* @throws BBoxDBException
* @throws InterruptedException
*/
@Test(timeout = 60000)
public void testInsertedTimeQuery() throws InterruptedException, BBoxDBException {
final BBoxDBConnection bboxdbConnection = connectToServer();
final BBoxDBClient bboxDBClient = bboxdbConnection.getBboxDBClient();
NetworkQueryHelper.testInsertedTimeQuery(bboxDBClient, DISTRIBUTION_GROUP);
disconnect(bboxDBClient);
}
Aggregations