import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Sets;
import java.net.URI;
private ConfigurationImpl configuration;
@Before
- public void setup(){
+ public void setup() {
configuration = new ConfigurationImpl("module-shards.conf", "modules.conf");
}
@Test
- public void testConstructor(){
+ public void testConstructor() {
Assert.assertNotNull(configuration);
}
@Test
- public void testGetMemberShardNames(){
+ public void testGetMemberShardNames() {
Collection<String> memberShardNames = configuration.getMemberShardNames(MEMBER_1);
assertEquals("getMemberShardNames", ImmutableSortedSet.of("people-1", "cars-1", "test-1", "default"),
ImmutableSortedSet.copyOf(memberShardNames));
}
@Test
- public void testGetMembersFromShardName(){
+ public void testGetMembersFromShardName() {
Collection<MemberName> members = configuration.getMembersFromShardName("default");
assertEquals("getMembersFromShardName", ImmutableSortedSet.of(MEMBER_1, MEMBER_2, MEMBER_3),
ImmutableSortedSet.copyOf(members));
}
@Test
- public void testGetAllShardNames(){
+ public void testGetAllShardNames() {
Set<String> allShardNames = configuration.getAllShardNames();
assertEquals("getAllShardNames", ImmutableSortedSet.of("people-1", "cars-1", "test-1", "default"),
ImmutableSortedSet.copyOf(allShardNames));