Package net.tomp2p.futures

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


    FuturePut futurePut = node.getDataManager().putUnblocked(parameters1);
    futurePut.awaitUninterruptibly();

    // verify initial put
    FutureGet futureGet = node.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());

    // overwrite with correct protection key
    H2HTestData data2 = new H2HTestData("bla2");
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
View Full Code Here


    futurePut = node.getDataManager().putUnblocked(parameters2);
    futurePut.awaitUninterruptibly();

    // verify overwrite
    futureGet = node.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertEquals(data2.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());

    // try to overwrite without protection key
    H2HTestData data3 = new H2HTestData("bla3");
    Parameters parameters3 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
View Full Code Here

    // should have been removed
    assertNull(futureGet4a.getData());

    // verify remove of version 2
    FutureGet futureGet4b = p2.get(lKey).setContentKey(cKey).setVersionKey(vKey2).start();
    futureGet4b.awaitUninterruptibly();
    // we did not find the data
    Assert.assertTrue(futureGet4b.isFailed());
    // should have been removed
    assertNull(futureGet4b.getData());
View Full Code Here

    futurePut = node.getDataManager().putUnblocked(parameters3);
    futurePut.awaitUninterruptibly();

    // should have been not changed
    futureGet = node.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(data2.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());
  }

  @Test
  public void testOverwritting3() throws Exception {
View Full Code Here

    FuturePut futurePut = node.getDataManager().putUnblocked(parameters1);
    futurePut.awaitUninterruptibly();

    // verify initial put
    FutureGet futureGet = node.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());

    // try to overwrite with wrong protection key
    H2HTestData data2 = new H2HTestData("bla2");
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
View Full Code Here

    futurePut = node.getDataManager().putUnblocked(parameters2);
    futurePut.awaitUninterruptibly();

    // should have been not changed;
    futureGet = node.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());
  }

  @Test
  public void testRemove1() throws Exception {
View Full Code Here

    FuturePut futurePut = node.getDataManager().putUnblocked(parameters1);
    futurePut.awaitUninterruptibly();

    // verify initial put
    FutureGet futureGet = node.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());

    // try to remove without protection keys
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
        .setContentKey(contentKey);
View Full Code Here

    FutureRemove futureRemove = node.getDataManager().removeUnblocked(parameters2);
    futureRemove.awaitUninterruptibly();

    // should have been not changed
    futureGet = node.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());

    // try to remove with wrong protection keys
    Parameters parameters3 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
        .setContentKey(contentKey).setProtectionKeys(protectionKey2);
View Full Code Here

    futureRemove = node.getDataManager().removeUnblocked(parameters3);
    futureRemove.awaitUninterruptibly();

    // should have been not changed
    futureGet = node.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());

    // remove with correct protection keys
    futureRemove = node.getDataManager().removeUnblocked(parameters1);
    futureRemove.awaitUninterruptibly();
View Full Code Here

    futureRemove = node.getDataManager().removeUnblocked(parameters1);
    futureRemove.awaitUninterruptibly();

    // should have been removed
    futureGet = node.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }

  @Test
  public void testRemove2() throws Exception {
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.