Package org.hive2hive.core.network

Examples of org.hive2hive.core.network.NetworkManager


    assertNull(futureGet.getData());
  }

  @Test
  public void testPutMinorityFailed() throws ClassNotFoundException, IOException, NoPeerConnectionException {
    NetworkManager nodeA = network.get(0);
    NetworkManager nodeB = network.get(1);

    nodeB.getConnection().getPeer().getPeerBean().storage(new TestPutFailureStorage());

    H2HTestData data = new H2HTestData(NetworkTestUtil.randomString());
    Parameters parameters = new Parameters().setLocationKey(nodeA.getNodeId())
        .setContentKey(NetworkTestUtil.randomString()).setData(data);

    boolean success = nodeB.getDataManager().put(parameters);
    Assert.assertTrue(success);
    FutureGet futureGet = nodeB.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();

    assertEquals(data.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());
  }
View Full Code Here

TOP

Related Classes of org.hive2hive.core.network.NetworkManager

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.