public void testSemaphore() throws Exception {
String partitionKey = "hazelcast";
HazelcastInstance hz = getHazelcastInstance(partitionKey);
ISemaphore semaphore = hz.getSemaphore("semaphore@" + partitionKey);
semaphore.release();
assertEquals("semaphore@" + partitionKey, semaphore.getName());
assertEquals(partitionKey, semaphore.getPartitionKey());
SemaphoreService service = getNodeEngine(hz).getService(SemaphoreService.SERVICE_NAME);
assertTrue(service.containsSemaphore(semaphore.getName()));