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));
}
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());
}
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());
}
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:- 2 Scheduler1 Task1";
assertTrue(handler.isAssignedToPartition());
assertEquals(2, handler.getPartitionId());
assertEquals(null, handler.getAddress());
assertEquals("Scheduler1", handler.getSchedulerName());
assertEquals("Task1", handler.getTaskName());
assertEquals(expectedURN, handler.toUrn());
}
Aggregations