Package org.jclouds.predicates

Examples of org.jclouds.predicates.SocketOpen


      super.setupContext();
      imageId = view.getComputeService().templateBuilder().build().getImage().getId();
        
      client = view.utils().injector().getInstance(ElasticStackApi.class);
      driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS);
      SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, maxDriveImageTime, 1, SECONDS);
   }
View Full Code Here


   public void setupContext() {
      super.setupContext();
      Injector injector = view.utils().injector();
      client = injector.getInstance(CloudServersClient.class);
      sshFactory = injector.getInstance(SshClient.Factory.class);
      SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, 120, 1, SECONDS);
      injector.injectMembers(socketOpen); // add logger
   }
View Full Code Here

         BlobMetadata metadata = view.getBlobStore().blobMetadata(containerName, "hello");

         assertNotNull(metadata.getPublicUri(), metadata.toString());

         SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
         Predicate<HostAndPort> socketTester = retry(socketOpen, 1200, 10, SECONDS);
         assertTrue(socketTester.apply(HostAndPort.fromParts(metadata.getPublicUri().getHost(), 80)), metadata.getPublicUri().toString());

         assertEquals(Strings2.toStringAndClose(view.utils().http().get(metadata.getPublicUri())), TEST_STRING);
View Full Code Here

   public void testSocketOpenThrowsUnsupported() {
      Context context = ContextBuilder.newBuilder(forApiOnEndpoint(IntegrationTestClient.class, "dummyurl"))
            .modules(ImmutableSet.of(new GoogleAppEngineConfigurationModule()))
            .build();

      SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
      socketOpen.apply(HostAndPort.fromParts("localhost", 22));
   }
View Full Code Here

      Injector injector = view.utils().injector();
      client = injector.getInstance(EC2Api.class);
      sshFactory = injector.getInstance(SshClient.Factory.class);
      runningTester = retry(new InstanceStateRunning(client), 180, 5, SECONDS);
      hasIpTester = retry(new InstanceHasIpAddress(client), 180, 5, SECONDS);
      SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, 180, 1, SECONDS);
   }
View Full Code Here

   }

   @Test
   public void testReturnsReachable() throws Exception {
      SocketOpen secondSocketOpen = new SocketOpen() {
         @Override
         public boolean apply(HostAndPort input) {
            return HostAndPort.fromParts(PRIVATE_IP, 22).equals(input);
         }
      };
View Full Code Here

      keyPair = ComputeTestUtils.setupKeyPair();
   }


   protected void buildSocketTester() {
      SocketOpen socketOpen = view.utils().injector().getInstance(SocketOpen.class);
      socketTester = retry(socketOpen, 60, 1, SECONDS);
      // wait a maximum of 60 seconds for port 8080 to open.
      openSocketFinder = context.utils().injector().getInstance(OpenSocketFinder.class);
   }
View Full Code Here

   @Override
   public void testCorrectAuthException() throws Exception {
   }

   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

TOP

Related Classes of org.jclouds.predicates.SocketOpen

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.