use of org.neo4j.management.InstanceInfo in project graphdb by neo4j-attic.
the class TestHaBean method canConnectToInstance.
@Test
public void canConnectToInstance() throws Exception {
Neo4jManager neo4j = new Neo4jManager(db.getManagementBean(Kernel.class));
HighAvailability ha = neo4j.getHighAvailabilityBean();
InstanceInfo[] instances = ha.getInstancesInCluster();
assertNotNull(instances);
assertEquals(1, instances.length);
InstanceInfo instance = instances[0];
assertNotNull(instance);
Pair<Neo4jManager, HighAvailability> proc = instance.connect();
assertNotNull("could not connect", proc);
neo4j = proc.first();
ha = proc.other();
assertNotNull(neo4j);
assertNotNull(ha);
instances = ha.getInstancesInCluster();
assertNotNull(instances);
assertEquals(1, instances.length);
assertEquals(instance.getAddress(), instances[0].getAddress());
assertEquals(instance.getInstanceId(), instances[0].getInstanceId());
}
use of org.neo4j.management.InstanceInfo in project graphdb by neo4j-attic.
the class TestHaBean method canGetInstanceConnectionInformation.
@Test
public void canGetInstanceConnectionInformation() throws Exception {
Neo4jManager neo4j = new Neo4jManager(db.getManagementBean(Kernel.class));
InstanceInfo[] instances = neo4j.getHighAvailabilityBean().getInstancesInCluster();
assertNotNull(instances);
assertEquals(1, instances.length);
InstanceInfo instance = instances[0];
assertNotNull(instance);
String address = instance.getAddress();
assertNotNull("No JMX address for instance", address);
String id = instance.getInstanceId();
assertNotNull("No instance id", id);
}
Aggregations