Examples of apply()


Examples of org.jclouds.openstack.nova.v2_0.compute.functions.CreateSecurityGroupIfNeeded.apply()

      NovaApi apiCanCreateSecurityGroup = requestsSendResponses(builder.build());

      CreateSecurityGroupIfNeeded fn = new CreateSecurityGroupIfNeeded(apiCanCreateSecurityGroup);

      // we can find it
      assertEquals(fn.apply(
               new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
               .toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
               "az-1.region-a.geo-1").toString());

   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.predicates.FindSecurityGroupWithNameAndReturnTrue.apply()

      AtomicReference<ZoneAndName> securityGroupInZoneRef = Atomics.newReference(ZoneAndName
               .fromZoneAndName("az-1.region-a.geo-1", "name1"));

      // we can find it
      assertTrue(predicate.apply(securityGroupInZoneRef));

      // the reference is now up to date, and includes the actual group found.
      assertEquals(securityGroupInZoneRef.get().toString(), new SecurityGroupInZone(Iterables
               .getOnlyElement(new ParseSecurityGroupListTest().expected()), "az-1.region-a.geo-1").toString());
View Full Code Here

Examples of org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply()

                        .build());
      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of("container",
            new ListContainerOptions[] { new ListContainerOptions() }));
      ParseObjectInfoListFromJsonResponse parser = i.getInstance(ParseObjectInfoListFromJsonResponse.class);
      parser.setContext(request);
      assertEquals(parser.apply(is).toString(), expects.toString());
   }
}
View Full Code Here

Examples of org.jclouds.predicates.SocketOpen.apply()

   }

   protected void buildSocketTester() {
      SocketOpen socketOpen = createMock(SocketOpen.class);

      expect(socketOpen.apply(HostAndPort.fromParts("144.175.1.1", 22))).andReturn(true).times(5);

      replay(socketOpen);

      socketTester = retry(socketOpen, 1, 1, MILLISECONDS);
     
View Full Code Here

Examples of org.jclouds.s3.blobstore.functions.BlobToObject.apply()

                     .addHeader("Date", CONSTANT_DATE)
                     .addHeader("ETag", "437b930db84b8079c2dd804a71936b5f")
                     .addHeader("Server", "AmazonS3").build()
      );

      client.putObject("test", blobToObject.apply(blob),
         storageClass(StorageClass.REDUCED_REDUNDANCY));
   }

   @Test
   public void testDeleteMultipleObjects() {
View Full Code Here

Examples of org.jclouds.sqs.xml.RegexMessageIdAndMD5Handler.apply()

      InputStream is = getClass().getResourceAsStream("/send_message.xml");

      MessageIdAndMD5 expected = expected();

      RegexMessageIdAndMD5Handler handler = new RegexMessageIdAndMD5Handler(new ReturnStringIf2xx());
      MessageIdAndMD5 result = handler.apply(HttpResponse.builder().statusCode(200).payload(is).build());

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

   }
View Full Code Here

Examples of org.jclouds.sqs.xml.RegexQueueHandler.apply()

      InputStream is = getClass().getResourceAsStream("/create_queue.xml");

      URI expected = expected();

      RegexQueueHandler handler = new RegexQueueHandler(new ReturnStringIf2xx());
      URI result = handler.apply(HttpResponse.builder().statusCode(200).payload(is).build());

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

   }
View Full Code Here

Examples of org.jclouds.virtualbox.predicates.RetryIfSocketNotYetOpen.apply()

      RetryIfSocketNotYetOpen client = createMock(RetryIfSocketNotYetOpen.class);
      HardcodedHostToHostNodeMetadata hardcodedHostToHostNodeMetadata = createMock(HardcodedHostToHostNodeMetadata.class);
      NodeMetadata host = new NodeMetadataBuilder().id("host").status(Status.RUNNING).build();
      URI provider = URI.create("http://localhost:18083/");
      expect(client.seconds(3)).andReturn(client);
      expect(client.apply(HostAndPort.fromParts(provider.getHost(), provider.getPort()))).andReturn(true).anyTimes();
      manager.connect(provider.toASCIIString(), "", "");
      expectLastCall().anyTimes();
      replay(manager, runScriptOnNodeFactory, runScriptOnNode, client);
      new StartVBoxIfNotAlreadyRunning((Function) Functions.constant(manager), runScriptOnNodeFactory, client,
               Suppliers.ofInstance(host), Suppliers.ofInstance(provider), hardcodedHostToHostNodeMetadata).start();
View Full Code Here

Examples of org.jenetics.util.Function.apply()

      public Model marshal(final EnumGene gene) {
        final Function marshaller = jaxb.Marshaller(gene.getAllele());
        final Model m = new Model();
        m.length = gene.getValidAlleles().length();
        m.allele.index = gene.getAlleleIndex();
        m.allele.value = marshaller.apply(gene.getAllele());
        m.alleles = gene.getValidAlleles()
          .map(marshaller)
          .asList();

        return m;
View Full Code Here

Examples of org.jinq.jooq.transform.SelectTransform.apply()

      LambdaInfo select = LambdaInfo.analyze(context.metamodel, lambda);
      if (select == null) throw new IllegalArgumentException("Could not create convert Lambda into a query");
      SelectTransform transform = new SelectTransform(context.metamodel, select);
      List<Table<?>> froms = new ArrayList<>();
      froms.addAll(fromTables);
      ColumnExpressions<U> columns = transform.apply(froms);

      // Run the query now
      List<Field<?>> selectColumns = new ArrayList<>();
      for (QueryPart col: columns.columns)
         selectColumns.add((Field<?>)col);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.