Package net.tomp2p.p2p

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


    Assert.assertEquals(keyPair1.getPublic(), retData.publicKey());
    // verify that data signature wasn't changed
    Assert.assertTrue(retData.verify(keyPair1.getPublic(), factory));

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

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


    Assert.assertEquals(keyPair2.getPublic(), retData.publicKey());
    // verify not changed signature
    Assert.assertTrue(retData.verify(keyPair2.getPublic(), factory));

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

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

    Assert.assertEquals(keyPair2.getPublic(), retData.publicKey());
    // verify not changed signature
    Assert.assertTrue(retData.verify(keyPair2.getPublic(), factory));

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

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

    // verify no put of version Y
    assertNull(p2.get(lKey).setContentKey(cKey).setVersionKey(vKeyY).setDomainKey(dKey).start()
        .awaitUninterruptibly().getData());

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

  @Test
  @Ignore
  public void testContentProtectionChangeAppliesToAllVersionKeys() throws NoSuchAlgorithmException,
View Full Code Here

    // verify no put of version Y
    assertNull(p2.get(lKey).setContentKey(cKey).setVersionKey(vKeyY).setDomainKey(dKey).start()
        .awaitUninterruptibly().getData());

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

  @AfterClass
  public static void cleanAfterClass() {
    afterClass();
View Full Code Here

    Data retData = p2.get(lKey).setDomainKey(dKey).setContentKey(cKey).setVersionKey(vKey).start()
        .awaitUninterruptibly().getData();
    Assert.assertNull(retData);

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

  @AfterClass
  public static void cleanAfterClass() {
    afterClass();
View Full Code Here

    Assert.assertNotNull(tmp);

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

  @AfterClass
  public static void cleanAfterClass() {
    afterClass();
View Full Code Here

    assertEquals(keyPair.getPublic(), retData.publicKey());
    // should have been modified
    assertEquals(newTestData, (String) retData.object());

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

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

    assertEquals(testData, (String) retData.object());
    assertTrue(retData.verify(keyPair.getPublic(), factory));
    assertEquals(keyPair.getPublic(), retData.publicKey());

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

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

    retData = futureGet2b.getData();
    assertEquals(testData1, (String) retData.object());
    assertEquals(keyPair1.getPublic(), retData.publicKey());

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

  @Test
  public void testRemoveWithWrongOrWrongContentProtectionKeys() throws NoSuchAlgorithmException,
      IOException, InvalidKeyException, SignatureException, ClassNotFoundException {
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.