Search in sources :

Example 1 with UUIDService

use of org.apache.oozie.service.UUIDService in project oozie by apache.

the class TestWorkflowKillXCommand method testChildId.

public void testChildId() throws Exception {
    services.destroy();
    setSystemProperty(UUIDService.CONF_GENERATOR, "counter");
    services = new Services();
    services.init();
    UUIDService uuid = services.get(UUIDService.class);
    String id = uuid.generateId(ApplicationType.WORKFLOW);
    String childId = uuid.generateChildId(id, "a");
    assertEquals(id, uuid.getId(childId));
    assertEquals("a", uuid.getChildName(childId));
    services.destroy();
    setSystemProperty(UUIDService.CONF_GENERATOR, "random");
    services = new Services();
    services.init();
    uuid = services.get(UUIDService.class);
    id = uuid.generateId(ApplicationType.WORKFLOW);
    childId = uuid.generateChildId(id, "a");
    assertEquals(id, uuid.getId(childId));
    assertEquals("a", uuid.getChildName(childId));
}
Also used : Services(org.apache.oozie.service.Services) UUIDService(org.apache.oozie.service.UUIDService)

Aggregations

Services (org.apache.oozie.service.Services)1 UUIDService (org.apache.oozie.service.UUIDService)1