Examples of Locations


Examples of org.hive2hive.core.model.Locations

   * @throws NoSessionException
   * @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());

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

    assertEquals(2, result.getPeerAddresses().size());
    PeerAddress newClientsEntry = null;
    for (PeerAddress address : result.getPeerAddresses()) {
      if (address.equals(network.get(0).getConnection().getPeer().getPeerAddress())) {
        newClientsEntry = address;
        break;
      }
    }
View Full Code Here

Examples of org.hive2hive.core.model.Locations

   * @throws NoSessionException
   * @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

Examples of org.jboss.netty.example.localtime.LocalTimeProtocol.Locations

    @Override
    public void messageReceived(
            ChannelHandlerContext ctx, MessageEvent e) {

        Locations locations = (Locations) e.getMessage();
        long currentTime = System.currentTimeMillis();

        LocalTimes.Builder builder = LocalTimes.newBuilder();
        for (Location l: locations.getLocationList()) {
            TimeZone tz = TimeZone.getTimeZone(
                    toString(l.getContinent()) + '/' + l.getCity());
            Calendar calendar = getInstance(tz);
            calendar.setTimeInMillis(currentTime);
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.