use of io.atomix.core.AtomixRegistry in project atomix by atomix.
the class SimpleRegistryTest method testStaticRegistryBuilder.
@Test
public void testStaticRegistryBuilder() throws Exception {
AtomixRegistry registry = SimpleRegistry.builder().addProfileType(ConsensusProfile.TYPE).addDiscoveryProviderType(BootstrapDiscoveryProvider.TYPE).addPrimitiveType(AtomicCounterType.instance()).addProtocolType(MultiRaftProtocol.TYPE).addPartitionGroupType(RaftPartitionGroup.TYPE).build();
assertEquals(ConsensusProfile.TYPE, registry.getType(Profile.Type.class, "consensus"));
assertEquals(BootstrapDiscoveryProvider.TYPE, registry.getType(NodeDiscoveryProvider.Type.class, "bootstrap"));
assertEquals(AtomicCounterType.instance(), registry.getType(PrimitiveType.class, "atomic-counter"));
assertEquals(MultiRaftProtocol.TYPE, registry.getType(PrimitiveProtocol.Type.class, "multi-raft"));
assertEquals(RaftPartitionGroup.TYPE, registry.getType(PartitionGroup.Type.class, "raft"));
}
use of io.atomix.core.AtomixRegistry in project atomix by atomix.
the class DefaultRegistryTest method testRegistry.
@Test
public void testRegistry() throws Exception {
AtomixRegistry registry = AtomixRegistry.registry();
assertFalse(registry.getTypes(PrimitiveType.class).isEmpty());
assertFalse(registry.getTypes(PrimitiveType.class).isEmpty());
assertEquals("atomic-map", registry.getType(PrimitiveType.class, "atomic-map").name());
assertFalse(registry.getTypes(PartitionGroup.Type.class).isEmpty());
assertEquals("raft", registry.getType(PartitionGroup.Type.class, "raft").name());
assertFalse(registry.getTypes(PrimitiveProtocol.Type.class).isEmpty());
assertEquals("multi-raft", registry.getType(PrimitiveProtocol.Type.class, "multi-raft").name());
assertEquals(3, registry.getTypes(Profile.Type.class).size());
assertEquals("client", registry.getType(Profile.Type.class, "client").name());
}
Aggregations