use of org.apache.thrift.transport.TFastFramedTransport in project coprhd-controller by CoprHD.
the class GeoDbSvcStartupTest method checkSchema.
@Test
public void checkSchema() throws Exception {
// Check if snitch setup is OK
NodeProbe cmd = new NodeProbe(HOST, JMX_PORT);
String dc = cmd.getDataCenter();
Assert.assertTrue("Unexpected DC name " + dc, "vdc1".equalsIgnoreCase(dc));
// Check schema setup is OK
TSocket socket = new TSocket(HOST, RPC_PORT);
TTransport transport = new TFastFramedTransport(socket);
transport.open();
try {
Cassandra.Client client = new Cassandra.Client(new TBinaryProtocol(transport, true, true));
KsDef def = client.describe_keyspace(DbClientContext.GEO_KEYSPACE_NAME);
String strategyClass = def.strategy_class;
log.info("Current strategy class in geodb schema: " + strategyClass);
Assert.assertTrue("Unexpected strategy class " + strategyClass, strategyClass.contains("NetworkTopologyStrategy"));
Map<String, String> strategyOptions = def.getStrategy_options();
Assert.assertTrue(strategyOptions.size() > 0);
} finally {
transport.close();
}
}
Aggregations