Пример #1
0
  //    @Test(groups = {"wso2.greg"}, description = "create lifecycle", dependsOnMethods =
  // "testAddservice")
  public void testCreateLc()
      throws GovernanceException, IOException, LifeCycleManagementServiceExceptionException {

    String resourcePath =
        getTestArtifactLocation()
            + "artifacts"
            + File.separator
            + "GREG"
            + File.separator
            + "lifecycle"
            + File.separator
            + "MultiplePromoteDemoteLCViewVersionsTrue.xml";
    String lifeCycleContent = FileManager.readFile(resourcePath);
    lifeCycleManagementClient.addLifeCycle(lifeCycleContent);

    String[] lifeClycles = lifeCycleManagementClient.getLifecycleList();
    boolean lccreated = false;
    for (String lc : lifeClycles) {
      if (lc.equals("DiffEnvironmentLC")) {
        lccreated = true;
      }
    }

    Assert.assertTrue(lccreated);
  }
  @Test(
      groups = "wso2.greg",
      description = "Create new life cycle",
      dependsOnMethods = "testCreateService")
  public void testCreateNewLifeCycle()
      throws LifeCycleManagementServiceExceptionException, IOException, InterruptedException {

    String resourcePath =
        getTestArtifactLocation()
            + "artifacts"
            + File.separator
            + "GREG"
            + File.separator
            + "lifecycle"
            + File.separator
            + "MultiplePromoteDemoteLC.xml";
    String lifeCycleContent = FileManager.readFile(resourcePath);
    lifeCycleManagementClient.addLifeCycle(lifeCycleContent);
    String[] lifeCycles = lifeCycleManagementClient.getLifecycleList();
    boolean lcStatus = false;
    for (String lc : lifeCycles) {
      if (lc.equalsIgnoreCase(LC_NAME)) {
        lcStatus = true;
      }
    }
    assertTrue(lcStatus, "LifeCycle not found");
  }