コード例 #1
0
 public void verifyService() throws RegistryException {
   ServiceManager serviceManager = new ServiceManager(governance);
   GovernanceUtils.loadGovernanceArtifacts(
       (UserRegistry) governance,
       GovernanceUtils.findGovernanceArtifactConfigurations(governance));
   Service[] services = serviceManager.getAllServices();
   boolean resourceFound = false;
   for (Service service : services) {
     if (service.getQName().getLocalPart().equals("SimpleStockQuoteService1M")) {
       resourceFound = true;
     }
   }
   Assert.assertTrue(resourceFound);
 }
コード例 #2
0
  /** @throws Exception */
  @Test(
      groups = "wso2.greg",
      description = "Promote from Commencement to Creation",
      dependsOnMethods = "testAddLcToService")
  public void testPromoteToCreation() throws Exception {

    addRole("managerrole", userInfo.getUserNameWithoutDomain());
    lifeCycle = lifeCycleAdminServiceClient.getLifecycleBean(absPath);
    boolean isPermitted = false;
    for (String action : lifeCycle.getAvailableActions()[0].getActions()) {
      if (action.equalsIgnoreCase(ACTION_PROMOTE)) {
        isPermitted = true;
      }
    }
    assertTrue(isPermitted, "Not allowed to promote with permission");

    lifeCycleAdminServiceClient.invokeAspect(absPath, LC_NAME, ACTION_PROMOTE, null);

    Service[] services = serviceManager.getAllServices();

    for (Service service : services) {
      String path = service.getPath();
      if (path.contains("IntergalacticService13")) {
        serviceString = path;
      }
    }
    lifeCycle = lifeCycleAdminServiceClient.getLifecycleBean(absPath);

    for (Property prop : lifeCycle.getLifecycleProperties()) {
      if (("registry.lifecycle." + LC_NAME + ".state").equalsIgnoreCase(prop.getKey())) {
        assertNotNull(prop.getValues(), "State Value Not Found");
        assertTrue(
            prop.getValues()[0].equalsIgnoreCase(LC_STATE1),
            "Not promoted to Creation with permission");
      }
    }
  }