/** Tests updating a member. */ public void testMemberUpdate() { ServerMember member = new ServerMember(Member.Type.ACTIVE, new Address("localhost", 5000), null); member.update(Member.Type.INACTIVE); assertEquals(member.type(), Member.Type.INACTIVE); member.update(ServerMember.Status.UNAVAILABLE); assertEquals(member.status(), ServerMember.Status.UNAVAILABLE); assertNull(member.clientAddress()); member.update(new Address("localhost", 6000)); assertEquals(member.clientAddress(), new Address("localhost", 6000)); }
/** Tests member getters. */ public void testMemberGetters() { ServerMember member = new ServerMember( Member.Type.ACTIVE, new Address("localhost", 5000), new Address("localhost", 6000)); assertEquals(member.type(), Member.Type.ACTIVE); assertEquals(member.status(), ServerMember.Status.AVAILABLE); assertEquals(member.serverAddress(), new Address("localhost", 5000)); assertEquals(member.clientAddress(), new Address("localhost", 6000)); }