Package net.tomp2p.p2p

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


    assertFalse(futureGet4b.isSuccess());
    // should have been removed
    assertNull(futureGet4b.getData());

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

  @Test
  public void testRemoveWithFromToContentProtectedEntry() throws NoSuchAlgorithmException, IOException,
      InvalidKeyException, SignatureException, ClassNotFoundException {
View Full Code Here


    Assert.assertTrue(futureGet4.isFailed());
    // should have been removed
    assertNull(futureGet4.getData());

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

  @Test
  public void testRemoveWithFromToSeveralVersionWithContentProtection() throws NoSuchAlgorithmException,
      IOException, InvalidKeyException, SignatureException, ClassNotFoundException {
View Full Code Here

    Assert.assertTrue(futureGet4b.isFailed());
    // should have been removed
    assertNull(futureGet4b.getData());

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

  @Test
  public void testChangeProtectionKeyWithoutDataSignature() throws IOException, ClassNotFoundException,
      NoSuchAlgorithmException, InvalidKeyException, SignatureException {
View Full Code Here

        .awaitUninterruptibly();
    assertEquals("data4", (String) futureGet.getData().object());
    assertEquals(keyPair2.getPublic(), futureGet.getData().publicKey());

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

  @Test
  public void testChangeProtectionKeyWithVersionKeyWithoutDataSignature() throws NoSuchAlgorithmException,
      IOException, ClassNotFoundException, InvalidKeyException, SignatureException {
View Full Code Here

        .awaitUninterruptibly();
    assertEquals("data4", (String) futureGet.getData().object());
    assertEquals(keyPair2.getPublic(), futureGet.getData().publicKey());

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

  @Test
  public void testChangeDataSignatureWithReusedHashWithoutContentProtection()
      throws NoSuchAlgorithmException, IOException, ClassNotFoundException, InvalidKeyException,
View Full Code Here

    Data retData = p1.get(lKey).setDomainKey(dKey).setContentKey(cKey).setVersionKey(vKey).start()
        .awaitUninterruptibly().getData();
    Assert.assertTrue(retData.verify(keyPair2.getPublic(), factory));

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

  @Test
  public void testChangeDataSignatureWithReusedHashWithContentProtection() throws NoSuchAlgorithmException,
      IOException, ClassNotFoundException, InvalidKeyException, SignatureException,
View Full Code Here

        } finally {
            if (sender != null) {
                sender.shutdown().await();
            }
            if (recv1 != null) {
                recv1.shutdown().await();
            }
        }
    }

    @Test
View Full Code Here

        } finally {
            if (sender != null) {
                sender.shutdown().await();
            }
            if (recv1 != null) {
                recv1.shutdown().await();
            }
        }
    }

   
View Full Code Here

        } finally {
            if (sender != null) {
                sender.shutdown().await();
            }
            if (recv1 != null) {
                recv1.shutdown().await();
            }
        }
    }

    @Test
View Full Code Here

                  return null;
                }
            }
            else {
                log.warn("Discover with direct connection failed. Reason = " + futureDiscover.failedReason());
                peer.shutdown().awaitUninterruptibly();
                return null;
            }
        } catch (IOException e) {
            log.warn("Discover with direct connection failed. Exception = " + e.getMessage());
            if (peer != null)
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.