Ejemplo n.º 1
0
  @Test(timeout = 30000)
  public void testGetRemoteURI() throws Exception {
    provider = new FailoverProvider(uris, Collections.<String, String>emptyMap());

    assertNull(provider.getRemoteURI());
    provider.connect();
    assertTrue(
        "Should have a remote URI after connect",
        Wait.waitFor(
            new Wait.Condition() {

              @Override
              public boolean isSatisified() throws Exception {
                return provider.getRemoteURI() != null;
              }
            },
            TimeUnit.SECONDS.toMillis(20),
            10));
  }
Ejemplo n.º 2
0
  @Test(timeout = 30000)
  public void testToString() throws Exception {
    provider = new FailoverProvider(uris, Collections.<String, String>emptyMap());

    assertNotNull(provider.toString());
    provider.connect();
    assertTrue(
        "Should have a mock scheme after connect",
        Wait.waitFor(
            new Wait.Condition() {

              @Override
              public boolean isSatisified() throws Exception {
                LOG.info("FailoverProvider: toString = {}", provider.toString());
                return provider.toString().contains("mock://");
              }
            },
            TimeUnit.SECONDS.toMillis(20),
            10));
  }