Package org.jclouds.ec2.util

Examples of org.jclouds.ec2.util.SubnetFilterBuilder


   }

   @Test(expectedExceptions = RuntimeException.class)
   public void testWhenEventualConsistencyExpiresIllegalStateException() throws ExecutionException {

      SecurityGroupClient client = createMock(SecurityGroupClient.class);
      Predicate<RegionAndName> tester = Predicates.alwaysFalse();

      client.createSecurityGroupInRegion("region", "group", "group");

      replay(client);

      CreateSecurityGroupIfNeeded function = new CreateSecurityGroupIfNeeded(client, tester);
      function.load(new RegionNameAndIngressRules("region", "group", new int[] { 22 }, true));
View Full Code Here


         Set<SecurityGroup> oneResult = client.describeSecurityGroupsInRegion(null, group1Name);
         assertNotNull(oneResult);
         assertEquals(oneResult.size(), 1);
         final SecurityGroup group = oneResult.iterator().next();
         assertEquals(group.getName(), group1Name);
         IpPermissions group2CanHttpGroup1 = IpPermissions.permit(IpProtocol.TCP).port(80)
               .originatingFromSecurityGroupId(group1Id);
         AWSSecurityGroupClient.class.cast(client).authorizeSecurityGroupIngressInRegion(null, group2Id,
               group2CanHttpGroup1);
         assertEventually(new GroupHasPermission(client, group2Name, new Predicate<IpPermission>() {
            @Override
View Full Code Here

        ImmutableSet<Subnet> subnets = api().list().toSet();
        getAnonymousLogger().info("subnets: " + subnets.size());
       
        for (Subnet subnet : subnets) {
            checkSubnet(subnet);
            assertEquals(api().filter(new SubnetFilterBuilder().subnetId(subnet.getSubnetId()).build()).get(0), subnet);
      }
    }
View Full Code Here

    @Test
    public void testFilterWhenNotFound() {
        assertTrue(retry(new Predicate<Iterable<Subnet>>() {
                    public boolean apply(Iterable<Subnet> input) {
                        return api().filter(new SubnetFilterBuilder().subnetId("subnet-pants").build())
                            .toSet().equals(input);
                    }
                }, 600, 200, 200, MILLISECONDS).apply(ImmutableSet.<Subnet> of()));
    }
View Full Code Here

        ImmutableSet<Subnet> subnets = api().list().toSet();
        getAnonymousLogger().info("subnets: " + subnets.size());
       
        for (Subnet subnet : subnets) {
            checkSubnet(subnet);
            assertEquals(api().filter(new SubnetFilterBuilder().subnetId(subnet.getSubnetId()).build()).get(0), subnet);
      }
    }
View Full Code Here

    @Test
    public void testFilterWhenNotFound() {
        assertTrue(retry(new Predicate<Iterable<Subnet>>() {
                    public boolean apply(Iterable<Subnet> input) {
                        return api().filter(new SubnetFilterBuilder().subnetId("subnet-pants").build())
                            .toSet().equals(input);
                    }
                }, 600, 200, 200, MILLISECONDS).apply(ImmutableSet.<Subnet> of()));
    }
View Full Code Here

        ImmutableSet<Subnet> subnets = api().list().toSet();
        getAnonymousLogger().info("subnets: " + subnets.size());
       
        for (Subnet subnet : subnets) {
            checkSubnet(subnet);
            assertEquals(api().filter(new SubnetFilterBuilder().subnetId(subnet.getSubnetId()).build()).get(0), subnet);
      }
    }
View Full Code Here

    @Test
    public void testFilterWhenNotFound() {
        assertTrue(retry(new Predicate<Iterable<Subnet>>() {
                    public boolean apply(Iterable<Subnet> input) {
                        return api().filter(new SubnetFilterBuilder().subnetId("subnet-pants").build())
                            .toSet().equals(input);
                    }
                }, 600, 200, 200, MILLISECONDS).apply(ImmutableSet.<Subnet> of()));
    }
View Full Code Here

         client.getTagApiForRegion(region).get().applyToResources(common, ids);
         for (NodeMetadata in : input)
            builder.add(addTagsForInstance(common, in));
      }
      if (logger.isDebugEnabled()) {
         Multimap<String, String> filter = new TagFilterBuilder().resourceIds(instancesById.keySet()).build();
         FluentIterable<Tag> tags = client.getTagApiForRegion(region).get().filter(filter);
         logger.debug("<< applied tags in region %s: %s", region, resourceToTagsAsMap(tags));
      }
      return builder.build();
   }
View Full Code Here

               .append("<DescribeRegionsResponse xmlns=\"http://ec2.amazonaws.com/doc/2010-06-15/\"><requestId>0a5a6b4d-c0d7-4531-9ba9-bbc0b94d2007</requestId><regionInfo><item><regionName>is-1</regionName><regionEndpoint>api.greenqloud.com</regionEndpoint></item></regionInfo></DescribeRegionsResponse>\n")
               .toString();

      Map<String, URI> expected = expected();

      DescribeRegionsResponseHandler handler = injector.getInstance(DescribeRegionsResponseHandler.class);
      Map<String, URI> result = factory.create(handler).parse(text);

      assertEquals(result.toString(), expected.toString());

   }
View Full Code Here

TOP

Related Classes of org.jclouds.ec2.util.SubnetFilterBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.