Package net.tomp2p.futures

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


    get1.awaitUninterruptibly();
    String result1 = (String) ((H2HTestData) get1.getData().object()).getTestString();
    assertEquals(data1, result1);

    FutureGet get2 = network.get(random.nextInt(networkSize)).getDataManager().getUnblocked(parameters2);
    get2.awaitUninterruptibly();
    String result2 = (String) ((H2HTestData) get2.getData().object()).getTestString();
    assertEquals(data2, result2);

    FutureGet get3 = network.get(random.nextInt(networkSize)).getDataManager().getUnblocked(parameters3);
    get3.awaitUninterruptibly();
View Full Code Here


    get2.awaitUninterruptibly();
    String result2 = (String) ((H2HTestData) get2.getData().object()).getTestString();
    assertEquals(data2, result2);

    FutureGet get3 = network.get(random.nextInt(networkSize)).getDataManager().getUnblocked(parameters3);
    get3.awaitUninterruptibly();
    String result3 = (String) ((H2HTestData) get3.getData().object()).getTestString();
    assertEquals(data3, result3);
  }

  @Test
View Full Code Here

    UseCaseTestUtil.executeProcess(putStep);

    Parameters parameters = new Parameters().setLocationKey(userId).setDomainKey(H2HConstants.USER_PROFILE_TASK_DOMAIN)
        .setContentKey(userProfileTask.getContentKey());
    FutureGet futureGet = node.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();

    assertNotNull(futureGet.getData());
  }

  // TODO: how to test this?
View Full Code Here

    UseCaseTestUtil.waitTillFailed(listener, 10);

    Parameters parameters = new Parameters().setLocationKey(userId).setDomainKey(H2HConstants.USER_PROFILE_TASK_DOMAIN)
        .setContentKey(userProfileTask.getContentKey());
    FutureGet futureGet = node.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }

  @Test
  public void testPutGet() throws IOException, NoPeerConnectionException {
View Full Code Here

    // put a content
    nodeA.getDataManager().putUnblocked(parameters).awaitUninterruptibly();

    // test that it is there
    FutureGet futureGet = nodeB.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNotNull(futureGet.getData());

    // delete it
    nodeA.getDataManager().removeUnblocked(parameters).awaitUninterruptibly();
View Full Code Here

    UseCaseTestUtil.executeProcess(process);

    Parameters parameters = new Parameters().setLocationKey(userId).setDomainKey(H2HConstants.USER_PROFILE_TASK_DOMAIN)
        .setContentKey(userProfileTask.getContentKey());
    FutureGet futureGet = node.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();

    assertNull(futureGet.getData());
  }

  // TODO how to test this?
View Full Code Here

    // delete it
    nodeA.getDataManager().removeUnblocked(parameters).awaitUninterruptibly();

    // check that it is gone
    futureGet = nodeB.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }

  @Test
  public void testRemovalMultipleContentKey() throws ClassNotFoundException, IOException,
View Full Code Here

    FuturePut put3 = nodeA.getDataManager().putUnblocked(parameters3);
    put3.awaitUninterruptibly();

    // check that they are all stored
    FutureGet futureGet = nodeB.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(testString1, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertEquals(testString2, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
View Full Code Here

    // check that they are all stored
    FutureGet futureGet = nodeB.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(testString1, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertEquals(testString2, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
    futureGet.awaitUninterruptibly();
    assertEquals(testString3, ((H2HTestData) futureGet.getData().object()).getTestString());
View Full Code Here

    assertEquals(testString1, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertEquals(testString2, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
    futureGet.awaitUninterruptibly();
    assertEquals(testString3, ((H2HTestData) futureGet.getData().object()).getTestString());

    // remove 2nd one and check that 1st and 3rd are still there
    nodeA.getDataManager().removeUnblocked(parameters2).awaitUninterruptibly();
    futureGet = nodeB.getDataManager().getUnblocked(parameters1);
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.