Ejemplo n.º 1
0
  // Test CloudServiceProperties with a deployment
  @Test(dependsOnMethods = "testCreate")
  public void testGetProperties() {
    CloudServiceProperties cloudServiceProperties =
        api.getCloudServiceApi().getProperties(cloudService.name());
    assertNotNull(cloudServiceProperties);
    assertEquals(cloudServiceProperties.serviceName(), CLOUD_SERVICE);

    Deployment deployment = cloudServiceProperties.deployments().get(0);
    checkDeployment(deployment);
  }
Ejemplo n.º 2
0
  @Test(dependsOnMethods = "testGet")
  public void testDelete() {
    final List<Role> roles =
        api.getDeploymentApiForService(cloudService.name()).get(DEPLOYMENT).roleList();

    assertTrue(
        new ConflictManagementPredicate(api) {

          @Override
          protected String operation() {
            return api().delete(deployment.name());
          }
        }.apply(deployment.name()));

    assertTrue(deploymentGone.apply(deployment), deployment.toString());
    Logger.getAnonymousLogger().log(Level.INFO, "deployment deleted: {0}", deployment);

    assertTrue(
        new ConflictManagementPredicate(api) {

          @Override
          protected String operation() {
            return api.getCloudServiceApi().delete(cloudService.name());
          }
        }.apply(cloudService.name()));

    for (Role r : roles) {
      final Role.OSVirtualHardDisk disk = r.osVirtualHardDisk();
      if (disk != null) {
        assertTrue(
            new ConflictManagementPredicate(api) {

              @Override
              protected String operation() {
                return api.getDiskApi().delete(disk.diskName());
              }
            }.apply(disk.diskName()));
      }
    }
  }
Ejemplo n.º 3
0
 private DeploymentApi api() {
   return api.getDeploymentApiForService(cloudService.name());
 }