@BeforeClass(groups = {"integration", "live"}) @Override public void setup() { super.setup(); cloudService = getOrCreateCloudService(CLOUD_SERVICE, LOCATION); deploymentCreated = retry( new Predicate<Deployment>() { @Override public boolean apply(final Deployment input) { return api().get(input.name()).status() == Deployment.Status.RUNNING; } }, 600, 5, 5, SECONDS); deploymentGone = retry( new Predicate<Deployment>() { @Override public boolean apply(final Deployment input) { return api().get(input.name()) == null; } }, 600, 5, 5, SECONDS); }
@AfterSuite @Override protected void tearDown() { super.tearDown(); final List<VirtualNetworkSite> virtualNetworkSites = Lists.newArrayList( Iterables.filter( api.getVirtualNetworkApi().list(), Predicates.not( new AzureTestUtils.SameVirtualNetworkSiteNamePredicate(VIRTUAL_NETWORK_NAME)))); assertTrue( new ConflictManagementPredicate(api) { @Override protected String operation() { return api.getVirtualNetworkApi() .set( NetworkConfiguration.create( NetworkConfiguration.VirtualNetworkConfiguration.create( null, virtualNetworkSites))); } }.apply(VIRTUAL_NETWORK_NAME)); }
@BeforeSuite @Override public void setup() { super.setup(); final List<VirtualNetworkSite> virtualNetworkSites = Lists.newArrayList( Iterables.filter( AzureTestUtils.getVirtualNetworkSite(api), new AzureTestUtils.SameVirtualNetworkSiteNamePredicate(VIRTUAL_NETWORK_NAME))); final NetworkConfiguration.AddressSpace addressSpace = NetworkConfiguration.AddressSpace.create(DEFAULT_ADDRESS_SPACE); final ImmutableList<NetworkConfiguration.Subnet> subnets = ImmutableList.of( NetworkConfiguration.Subnet.create( DEFAULT_SUBNET_NAME, DEFAULT_SUBNET_ADDRESS_SPACE, null)); final NetworkConfiguration networkConfiguration = api().getNetworkConfiguration(); assertThat(networkConfiguration.virtualNetworkConfiguration().dns()) .isEqualTo(networkConfiguration.virtualNetworkConfiguration().dns()); assertThat(virtualNetworkSites.size()).isEqualTo(1); assertThat(virtualNetworkSites.get(0).name()).isEqualTo(VIRTUAL_NETWORK_NAME); assertThat(virtualNetworkSites.get(0).location()).isEqualTo(LOCATION); assertThat(virtualNetworkSites.get(0).addressSpace()).isEqualTo(addressSpace); assertThat(virtualNetworkSites.get(0).subnets()).isEqualTo(subnets); }
@Override @AfterClass(groups = "live", alwaysRun = true) protected void tearDown() { super.tearDown(); }