Package com.openshift.client.fakes

Examples of com.openshift.client.fakes.WaitingHttpServerFake


    final int serverDelay = 4 * 1000;
    System.clearProperty(IHttpClient.SYSPROP_OPENSHIFT_READ_TIMEOUT);
    final String timeoutBackup = System.getProperty(IHttpClient.SYSPROP_DEFAULT_READ_TIMEOUT);
    System.clearProperty(IHttpClient.SYSPROP_DEFAULT_READ_TIMEOUT);
    ExecutorService executor = Executors.newSingleThreadExecutor();
    final WaitingHttpServerFake serverFake = startWaitingHttpServerFake(serverDelay);
    final long startTime = System.currentTimeMillis();
    // operations
    Future<Long> future = executor.submit(new Callable<Long>() {

      @Override
      public Long call() throws Exception {
        try {
          httpClient.get(serverFake.getUrl(), IHttpClient.NO_TIMEOUT);
          return -1l;
        } catch (SocketTimeoutException e) {
          return -1l;
        }
      }
View Full Code Here


    serverFake.start();
    return serverFake;
  }
 
  private WaitingHttpServerFake startWaitingHttpServerFake(int delay) throws Exception {
    WaitingHttpServerFake serverFake = new WaitingHttpServerFake(delay);
    serverFake.start();
    return serverFake;
  }
View Full Code Here

TOP

Related Classes of com.openshift.client.fakes.WaitingHttpServerFake

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.