Code example for QName

Methods: sleep

0
    @Test( description = "Add lifecycle to a Service and update Service") 
    public void serviceAddLifecycleAndUpdateResource() 
            throws Exception { 
 
        ServiceManager serviceManager = new ServiceManager(governance);
        Service  serviceNew =serviceManager.newService(new QName("sns", "ServiceLifeCycleState"));
        serviceManager.addService(serviceNew);
        servicePathDev = "/_system/governance" + serviceManager.getService(serviceNew.getId()).getPath();
 
        lifeCycleAdminService.addAspect(servicePathDev, ASPECT_NAME);
        Thread.sleep(500);
        LifecycleBean lifeCycle = lifeCycleAdminService.getLifecycleBean(servicePathDev);
        Resource service = registry.get(servicePathDev);
        Assert.assertNotNull(service, "Service Not found on registry path " + servicePathDev);
        Assert.assertEquals(service.getPath(), servicePathDev, "Service path changed after adding life cycle. " + servicePathDev);
 
        Assert.assertEquals(Utils.getLifeCycleState(lifeCycle), "Development", "LifeCycle State Mismatched");
 
        Service service1 = serviceManager.getService(serviceNew.getId());
        service1.addAttribute("overview_scopes","http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/DefaultScope");
        serviceManager.updateService(service1);
 
        servicePathDev = "/_system/governance" + service1.getPath();
        Thread.sleep(500);
 
        lifeCycle = lifeCycleAdminService.getLifecycleBean(servicePathDev);
        service = registry.get(servicePathDev);
        Assert.assertNotNull(service, "Service Not found on registry path " + servicePathDev);
        Assert.assertEquals(service.getPath(), servicePathDev, "Service path changed after adding life cycle. " + servicePathDev);