Examples of addPeerAddress()


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

   * @throws NoPeerConnectionException
   */
  @Test
  public void allOtherClientsAreDead() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).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, true);
View Full Code Here

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

  @Test
  public void allOtherClientsAreDead() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).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, true);

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

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

  public void allOtherClientsAreDead() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(0).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, true);

    assertEquals(1, result.getPeerAddresses().size());
    assertEquals(network.get(0).getConnection().getPeer().getPeerAddress(), result.getPeerAddresses().iterator().next());
View Full Code Here

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

   * @throws NoPeerConnectionException
   */
  @Test
  public void notCompleteLocations() throws NoSessionException, NoPeerConnectionException {
    Locations fakedLocations = new Locations(userId);
    fakedLocations.addPeerAddress(network.get(1).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()

    proxy.getConnection().getPeer().getPeerBean().storage(new H2HStorageMemory());

    // create the needed objects
    String userId = proxy.getNodeId();
    Locations newLocations = new Locations(userId);
    newLocations.addPeerAddress(putter.getConnection().getPeer().getPeerAddress());
    KeyPair protectionKeys = EncryptionUtil.generateRSAKeyPair();

    // initialize the process and the one and only step to test
    PutLocationContext context = new PutLocationContext(newLocations, protectionKeys);
    PutUserLocationsStep step = new PutUserLocationsStep(context, context, putter.getDataManager());
View Full Code Here

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

    proxy.getConnection().getPeer().getPeerBean().storage(new DenyingPutTestStorage());

    // create the needed objects
    String userId = proxy.getNodeId();
    Locations newLocations = new Locations(userId);
    newLocations.addPeerAddress(putter.getConnection().getPeer().getPeerAddress());
    KeyPair protectionKeys = EncryptionUtil.generateRSAKeyPair();

    // initialize the process and the one and only step to test
    PutLocationContext context = new PutLocationContext(newLocations, protectionKeys);
    PutUserLocationsStep step = new PutUserLocationsStep(context, context, putter.getDataManager());
View Full Code Here

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

    updatedLocations.setVersionKey(context.consumeLocations().getVersionKey());

    // add addresses that responded and self
    for (PeerAddress address : responses.keySet()) {
      if (responses.get(address)) {
        updatedLocations.addPeerAddress(address);
      }
    }
    updatedLocations.addPeerAddress(networkManager.getConnection().getPeer().getPeerAddress());
    context.provideLocations(updatedLocations);
View Full Code Here

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

    for (PeerAddress address : responses.keySet()) {
      if (responses.get(address)) {
        updatedLocations.addPeerAddress(address);
      }
    }
    updatedLocations.addPeerAddress(networkManager.getConnection().getPeer().getPeerAddress());
    context.provideLocations(updatedLocations);

    // evaluate if initial
    List<PeerAddress> clientAddresses = new ArrayList<PeerAddress>(updatedLocations.getPeerAddresses());
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.