Search in sources :

Example 1 with UuidUtil.newUnsecureUUID

use of com.hazelcast.internal.util.UuidUtil.newUnsecureUUID in project hazelcast by hazelcast.

the class MemberImplTest method testConstructor_withAttributes.

@Test
public void testConstructor_withAttributes() throws Exception {
    Map<String, String> attributes = new HashMap<>();
    attributes.put("key1", "value");
    attributes.put("key2", "12345");
    UUID uuid = UuidUtil.newUnsecureUUID();
    MemberImpl member = new MemberImpl.Builder(address).version(MemberVersion.of("3.8.0")).localMember(true).uuid(uuid).attributes(attributes).instance(hazelcastInstance).build();
    assertBasicMemberImplFields(member);
    assertTrue(member.localMember());
    assertEquals(uuid, member.getUuid());
    assertEquals("value", member.getAttribute("key1"));
    assertEquals("12345", member.getAttribute("key2"));
    assertFalse(member.isLiteMember());
}
Also used : HashMap(java.util.HashMap) UuidUtil.newUnsecureUUID(com.hazelcast.internal.util.UuidUtil.newUnsecureUUID) UUID(java.util.UUID) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 2 with UuidUtil.newUnsecureUUID

use of com.hazelcast.internal.util.UuidUtil.newUnsecureUUID in project hazelcast by hazelcast.

the class MemberImplTest method testConstructor_withHazelcastInstance.

@Test
public void testConstructor_withHazelcastInstance() throws Exception {
    UUID uuid = UuidUtil.newUnsecureUUID();
    MemberImpl member = new MemberImpl.Builder(address).version(MemberVersion.of("3.8.0")).localMember(true).uuid(uuid).instance(hazelcastInstance).build();
    assertBasicMemberImplFields(member);
    assertTrue(member.localMember());
    assertEquals(uuid, member.getUuid());
}
Also used : UuidUtil.newUnsecureUUID(com.hazelcast.internal.util.UuidUtil.newUnsecureUUID) UUID(java.util.UUID) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

UuidUtil.newUnsecureUUID (com.hazelcast.internal.util.UuidUtil.newUnsecureUUID)2 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2 UUID (java.util.UUID)2 Test (org.junit.Test)2 HashMap (java.util.HashMap)1