Package net.tomp2p.p2p

Examples of net.tomp2p.p2p.Peer.shutdown()


    assertEquals(content.get(numberOfContent - 1).getTestString(), ((H2HTestData) future.getData()
        .object()).getTestString());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void getFromToTest2() throws IOException, ClassNotFoundException, InterruptedException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(4838)
View Full Code Here


    for (int i = 0; i < timeStamps.size(); i++) {
      assertEquals(timeStamps.get(i), downloadedTimestamps.get(i));
    }

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void removeFromToTest1() throws IOException, ClassNotFoundException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
View Full Code Here

    futureGet.awaitUninterruptibly();

    assertNull(futureGet.getData());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void removeFromToTest2() throws IOException, ClassNotFoundException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
View Full Code Here

    futureDigest.awaitUninterruptibly();

    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void removeTest() throws IOException, ClassNotFoundException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
View Full Code Here

    futureDigest.awaitUninterruptibly();

    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void removeFromToTest3() throws IOException, ClassNotFoundException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
View Full Code Here

        .to(new Number640(lKey, dKey, cKey, Number160.MAX_VALUE)).start();
    futureDigest.awaitUninterruptibly();
    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void removeFromToTest4() throws IOException, ClassNotFoundException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
View Full Code Here

    // should be empty
    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void digestFromToTest() throws IOException, ClassNotFoundException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
View Full Code Here

              new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
                  .createHash(contentKey), data.getVersionKey())));
    }

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void digestTest() throws IOException, ClassNotFoundException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
View Full Code Here

              Number160.createHash(contentKey), data.getVersionKey()), future.getDigest()
              .keyDigest().firstKey());
    }

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @Test
  public void putTest() throws IOException, ClassNotFoundException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
View Full Code Here

    futureGet.awaitUninterruptibly();

    assertNotNull(futureGet.getData());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().awaitUninterruptibly();
  }

  @AfterClass
  public static void cleanAfterClass() {
    afterClass();
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.