Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureGet.awaitUninterruptibly()


    // wait till message gets handled
    H2HWaiter w = new H2HWaiter(10);
    do {
      w.tickASecond();
      futureGet = nodeA.getDataManager().getUnblocked(parameters);
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // verify that data arrived
    String result = ((H2HTestData) futureGet.getData().object()).getTestString();
    assertEquals(data, result);
View Full Code Here


    // get the locations which should be stored at the proxy --> they should be null
    FutureGet futureGet = proxy.getDataManager().getUnblocked(
        new Parameters().setLocationKey(credentials.getProfileLocationKey()).setContentKey(
            H2HConstants.USER_LOCATIONS));
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }

  @AfterClass
  public static void endTest() {
View Full Code Here

    String contentKey = NetworkTestUtil.randomString();
    Parameters parameters = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey);

    // check if selected location is empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());

    // assign a denying message handler at target node
    nodeB.getConnection().getPeer().setObjectDataReply(new DenyingMessageReplyHandler());
View Full Code Here

    // wait for the process to finish
    UseCaseTestUtil.waitTillFailed(listener, 10);

    // check if selected location is still empty
    futureGet = nodeA.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }

  /**
   * Sends an asynchronous request message through a process step. This test checks if the process step
View Full Code Here

    final Parameters parametersA = new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey);
    final Parameters parametersB = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey);
   
    // check if selected locations are empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parametersB);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parametersA);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
View Full Code Here

    // check if selected locations are empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parametersB);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parametersA);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());

    // create a message with target node B
    final TestMessageWithReply message = new TestMessageWithReply(nodeB.getNodeId(), contentKey);
View Full Code Here

    // wait till response message gets handled
    H2HWaiter waiter = new H2HWaiter(10);
    do {
      waiter.tickASecond();
      futureGet = nodeA.getDataManager().getUnblocked(parametersA);
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeA.getDataManager().getUnblocked(parametersB);
View Full Code Here

    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeA.getDataManager().getUnblocked(parametersB);
    futureGet.awaitUninterruptibly();
    String originalSecret = ((H2HTestData) futureGet.getData().object()).getTestString();

    assertEquals(originalSecret, receivedSecret);
  }
View Full Code Here

    for (String contentKey : testContentKeys) {
      FutureGet futureGet = null;
      try {
        futureGet = sender.getDataManager().getUnblocked(
            new Parameters().setLocationKey(sender.getNodeId()).setContentKey(contentKey));
        futureGet.awaitUninterruptibly();
      } catch (NoPeerConnectionException e1) {
        Assert.fail();
      }

      if (futureGet.getData() == null) {
View Full Code Here

    Assert.assertEquals(userCredentials.getUserId(), client.getUserId());

    // verify the locations map
    FutureGet futureGet = client.getDataManager().getUnblocked(
        new Parameters().setLocationKey(userCredentials.getUserId()).setContentKey(H2HConstants.USER_LOCATIONS));
    futureGet.awaitUninterruptibly();

    Locations locations = (Locations) futureGet.getData().object();
    Assert.assertEquals(1, locations.getPeerAddresses().size());
  }
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.