Examples of addPeerAddress()


Examples of org.hive2hive.core.model.Locations.addPeerAddress()

    NetworkManager proxy = network.get(1); // where the user profile is stored

    // create the needed objects
    String userId = proxy.getNodeId();
    Locations newLocations = new Locations(userId);
    newLocations.addPeerAddress(getter.getConnection().getPeer().getPeerAddress());

    // put the locations to the DHT
    proxy.getDataManager()
        .putUnblocked(
            new Parameters().setLocationKey(userId).setContentKey(H2HConstants.USER_LOCATIONS)
View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

   * @throws NoPeerConnectionException
   */
  @Test
  public void allClientsAreAlive() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());
    // responding nodes
    fakedLocations.addPeerAddress(network.get(1).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(2).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(3).getConnection().getPeer().getPeerAddress());

View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

  @Test
  public void allClientsAreAlive() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());
    // responding nodes
    fakedLocations.addPeerAddress(network.get(1).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(2).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(3).getConnection().getPeer().getPeerAddress());

    Locations result = runProcessStep(fakedLocations,
        isInitialClient(fakedLocations, network.get(0).getConnection().getPeer().getPeerAddress()));
View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

  public void allClientsAreAlive() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());
    // responding nodes
    fakedLocations.addPeerAddress(network.get(1).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(2).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(3).getConnection().getPeer().getPeerAddress());

    Locations result = runProcessStep(fakedLocations,
        isInitialClient(fakedLocations, network.get(0).getConnection().getPeer().getPeerAddress()));
View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());
    // responding nodes
    fakedLocations.addPeerAddress(network.get(1).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(2).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(3).getConnection().getPeer().getPeerAddress());

    Locations result = runProcessStep(fakedLocations,
        isInitialClient(fakedLocations, network.get(0).getConnection().getPeer().getPeerAddress()));

    assertEquals(4, result.getPeerAddresses().size());
View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

   * @throws NoPeerConnectionException
   */
  @Test
  public void notAllClientsAreAlive() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(1).getConnection().getPeer().getPeerAddress());
    // not responding nodes
    fakedLocations.addPeerAddress(network.get(4).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(5).getConnection().getPeer().getPeerAddress());

View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

   */
  @Test
  public void notAllClientsAreAlive() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(1).getConnection().getPeer().getPeerAddress());
    // not responding nodes
    fakedLocations.addPeerAddress(network.get(4).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(5).getConnection().getPeer().getPeerAddress());

    Locations result = runProcessStep(fakedLocations,
View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

  public void notAllClientsAreAlive() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(1).getConnection().getPeer().getPeerAddress());
    // not responding nodes
    fakedLocations.addPeerAddress(network.get(4).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(5).getConnection().getPeer().getPeerAddress());

    Locations result = runProcessStep(fakedLocations,
        isInitialClient(fakedLocations, network.get(0).getConnection().getPeer().getPeerAddress()));
View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(1).getConnection().getPeer().getPeerAddress());
    // not responding nodes
    fakedLocations.addPeerAddress(network.get(4).getConnection().getPeer().getPeerAddress());
    fakedLocations.addPeerAddress(network.get(5).getConnection().getPeer().getPeerAddress());

    Locations result = runProcessStep(fakedLocations,
        isInitialClient(fakedLocations, network.get(0).getConnection().getPeer().getPeerAddress()));

    assertEquals(2, result.getPeerAddresses().size());
View Full Code Here

Examples of org.hive2hive.core.model.Locations.addPeerAddress()

   * @throws NoPeerConnectionException
   */
  @Test
  public void noOtherClientsOrDeadClients() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).getConnection().getPeer().getPeerAddress());

    Locations result = runProcessStep(fakedLocations, true);

    assertEquals(1, result.getPeerAddresses().size());
    assertEquals(network.get(0).getConnection().getPeer().getPeerAddress(), result.getPeerAddresses().iterator().next());
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.