use of org.neo4j.management.ClusterMemberInfo in project neo4j by neo4j.
the class HaBeanIT method shouldAccessHaBeans.
@Test
public void shouldAccessHaBeans() throws Throwable {
ManagedCluster cluster = clusterRule.startCluster();
// High Availability bean
HighAvailability ha = ha(cluster.getMaster());
assertNotNull("could not get ha bean", ha);
assertMasterInformation(ha);
assertMasterAndSlaveInformation(ha.getInstancesInCluster());
for (ClusterMemberInfo info : ha.getInstancesInCluster()) {
assertTrue(info.isAlive());
assertTrue(info.isAvailable());
}
// Branched data bean
BranchedStore bs = beans(cluster.getMaster()).getBranchedStoreBean();
assertNotNull("could not get branched store bean", bs);
}
use of org.neo4j.management.ClusterMemberInfo in project neo4j by neo4j.
the class HaBeanIT method assertMasterAndSlaveInformation.
private void assertMasterAndSlaveInformation(ClusterMemberInfo[] instancesInCluster) throws Exception {
ClusterMemberInfo master = member(instancesInCluster, 1);
assertEquals(1137, getUriForScheme("ha", Iterables.map(URI::create, Arrays.asList(master.getUris()))).getPort());
assertEquals(HighAvailabilityModeSwitcher.MASTER, master.getHaRole());
ClusterMemberInfo slave = member(instancesInCluster, 2);
assertEquals(1138, getUriForScheme("ha", Iterables.map(URI::create, Arrays.asList(slave.getUris()))).getPort());
assertEquals(HighAvailabilityModeSwitcher.SLAVE, slave.getHaRole());
assertTrue("Slave not available", slave.isAvailable());
}
Aggregations