Search in sources :

Example 16 with ScheduledTaskHandler

use of com.hazelcast.scheduledexecutor.ScheduledTaskHandler in project hazelcast by hazelcast.

the class ScheduledExecutorWaitNotifyKeyTest method equals_sameURN.

@Test
public void equals_sameURN() throws Exception {
    ScheduledTaskHandler handler = ScheduledTaskHandlerImpl.of(1, "MyScheduler", "MyTask");
    String myTaskURN = handler.toUrn();
    ScheduledExecutorWaitNotifyKey keyA = new ScheduledExecutorWaitNotifyKey("myScheduler", myTaskURN);
    ScheduledExecutorWaitNotifyKey keyB = new ScheduledExecutorWaitNotifyKey("myScheduler", myTaskURN);
    assertTrue(keyA.equals(keyB));
}
Also used : ScheduledTaskHandler(com.hazelcast.scheduledexecutor.ScheduledTaskHandler) Test(org.junit.Test)

Example 17 with ScheduledTaskHandler

use of com.hazelcast.scheduledexecutor.ScheduledTaskHandler in project hazelcast by hazelcast.

the class ScheduledExecutorWaitNotifyKeyTest method hashcode_sameURN.

@Test
public void hashcode_sameURN() throws Exception {
    ScheduledTaskHandler handler = ScheduledTaskHandlerImpl.of(1, "MyScheduler", "MyTask");
    String myTaskURN = handler.toUrn();
    ScheduledExecutorWaitNotifyKey keyA = new ScheduledExecutorWaitNotifyKey("myScheduler", myTaskURN);
    ScheduledExecutorWaitNotifyKey keyB = new ScheduledExecutorWaitNotifyKey("myScheduler", myTaskURN);
    assertEquals(keyA.hashCode(), keyB.hashCode());
}
Also used : ScheduledTaskHandler(com.hazelcast.scheduledexecutor.ScheduledTaskHandler) Test(org.junit.Test)

Example 18 with ScheduledTaskHandler

use of com.hazelcast.scheduledexecutor.ScheduledTaskHandler in project hazelcast by hazelcast.

the class ScheduledExecutorWaitNotifyKeyTest method hashcode_sameRef.

@Test
public void hashcode_sameRef() throws Exception {
    ScheduledTaskHandler handler = ScheduledTaskHandlerImpl.of(1, "MyScheduler", "MyTask");
    String myTaskURN = handler.toUrn();
    ScheduledExecutorWaitNotifyKey keyA = new ScheduledExecutorWaitNotifyKey("myScheduler", myTaskURN);
    assertEquals(keyA.hashCode(), keyA.hashCode());
}
Also used : ScheduledTaskHandler(com.hazelcast.scheduledexecutor.ScheduledTaskHandler) Test(org.junit.Test)

Example 19 with ScheduledTaskHandler

use of com.hazelcast.scheduledexecutor.ScheduledTaskHandler in project hazelcast by hazelcast.

the class ScheduledTaskHandlerImplTest method of_partitionConstructor.

@Test
public void of_partitionConstructor() throws Exception {
    ScheduledTaskHandler handler = ScheduledTaskHandlerImpl.of(2, "Scheduler1", "Task1");
    String expectedURN = "urn:hzScheduledTaskHandler:-2Scheduler1Task1";
    assertTrue(handler.isAssignedToPartition());
    assertEquals(2, handler.getPartitionId());
    assertEquals(null, handler.getAddress());
    assertEquals("Scheduler1", handler.getSchedulerName());
    assertEquals("Task1", handler.getTaskName());
    assertEquals(expectedURN, handler.toUrn());
}
Also used : ScheduledTaskHandler(com.hazelcast.scheduledexecutor.ScheduledTaskHandler) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

ScheduledTaskHandler (com.hazelcast.scheduledexecutor.ScheduledTaskHandler)19 Test (org.junit.Test)13 ParallelTest (com.hazelcast.test.annotation.ParallelTest)5 QuickTest (com.hazelcast.test.annotation.QuickTest)5 ArrayList (java.util.ArrayList)4 Member (com.hazelcast.core.Member)3 List (java.util.List)3 Map (java.util.Map)3 ClusterService (com.hazelcast.internal.cluster.ClusterService)2 Address (com.hazelcast.nio.Address)2 IScheduledFuture (com.hazelcast.scheduledexecutor.IScheduledFuture)2 DistributedScheduledExecutorService (com.hazelcast.scheduledexecutor.impl.DistributedScheduledExecutorService)2 IPartitionService (com.hazelcast.spi.partition.IPartitionService)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 LinkedList (java.util.LinkedList)2 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 ClientInvocation (com.hazelcast.client.spi.impl.ClientInvocation)1 ClientInvocationFuture (com.hazelcast.client.spi.impl.ClientInvocationFuture)1 AbstractDistributedObject (com.hazelcast.spi.AbstractDistributedObject)1