Package org.hive2hive.core.network.data.parameters

Examples of org.hive2hive.core.network.data.parameters.Parameters


    Assert.assertNull(metaDocument);

    for (FileVersion version : metaDocumentBeforeDeletion.getVersions()) {
      for (MetaChunk metaChunks : version.getMetaChunks()) {
        FutureGet get = client.getDataManager().getUnblocked(
            new Parameters().setLocationKey(metaChunks.getChunkId()).setContentKey(
                H2HConstants.FILE_CHUNK));
        get.awaitUninterruptibly();
        get.getFutureRequests().awaitUninterruptibly();

        // chunk should not exist
View Full Code Here


  public void run() {
    String secret = NetworkTestUtil.randomString();

    try {
      networkManager.getDataManager().putUnblocked(
          new Parameters().setLocationKey(networkManager.getNodeId())
          .setContentKey(contentKey).setData(new H2HTestData(secret)))
          .awaitUninterruptibly();
    } catch (NoPeerConnectionException e) {
      Assert.fail();
    }
View Full Code Here

    String contentKey = NetworkTestUtil.randomString();

    // put in the memory of 2nd peer
    holder.getDataManager()
        .putUnblocked(
            new Parameters().setLocationKey(holder.getNodeId()).setContentKey(contentKey)
                .setData(data)).awaitUninterruptibly();

    TestGetProcessStep getStep = new TestGetProcessStep(locationKey, contentKey, getter.getDataManager());
    UseCaseTestUtil.executeProcess(getStep);
View Full Code Here

  public void run() {
    try {
      networkManager
          .getDataManager()
          .putUnblocked(
              new Parameters().setLocationKey(networkManager.getNodeId())
                  .setContentKey(contentKey).setData(wrapper)).awaitUninterruptibly();
    } catch (NoPeerConnectionException e) {
      Assert.fail();
    }
  }
View Full Code Here

    // put some data to remove
    network.get(0)
        .getDataManager()
        .putUnblocked(
            new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
                .setData(testData)).awaitUninterruptibly();

    // initialize the process and the one and only step to test
    TestRemoveProcessStep putStep = new TestRemoveProcessStep(locationKey, contentKey, network.get(0)
        .getDataManager());
    UseCaseTestUtil.executeProcess(putStep);

    FutureGet futureGet = network.get(0).getDataManager()
        .getUnblocked(new Parameters().setLocationKey(locationKey).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }
View Full Code Here

    network.get(1).getConnection().getPeer().getPeerBean().storage(new FakeGetTestStorage(key));
    // put some data to remove
    network.get(0)
        .getDataManager()
        .putUnblocked(
            new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
                .setData(testData)).awaitUninterruptibly();

    // initialize the process and the one and only step to test
    TestRemoveProcessStep removeStep = new TestRemoveProcessStep(locationKey, contentKey, network.get(0)
        .getDataManager());
View Full Code Here

    TestPutProcessStep putStep = new TestPutProcessStep(locationKey, contentKey, new H2HTestData(data),
        putter.getDataManager());
    UseCaseTestUtil.executeProcess(putStep);

    FutureGet futureGet = proxy.getDataManager().getUnblocked(
        new Parameters().setLocationKey(locationKey).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    assertEquals(data, ((H2HTestData) futureGet.getData().object()).getTestString());
  }
View Full Code Here

    // wait for the process to finish
    UseCaseTestUtil.waitTillFailed(listener, 10);

    FutureGet futureGet = proxy.getDataManager().getUnblocked(
        new Parameters().setLocationKey(locationKey).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }
View Full Code Here

    assertNotNull(getUserProfile);
    assertEquals(credentials.getUserId(), getUserProfile.getUserId());

    // verify put locations
    FutureGet getLocations = otherClient.getDataManager().getUnblocked(
        new Parameters().setLocationKey(credentials.getUserId()).setContentKey(
            H2HConstants.USER_LOCATIONS));
    getLocations.awaitUninterruptibly();
    getLocations.getFutureRequests().awaitUninterruptibly();
    Locations locations = (Locations) getLocations.getData().object();

    assertNotNull(locations);
    assertEquals(credentials.getUserId(), locations.getUserId());
    assertTrue(locations.getPeerAddresses().isEmpty());

    // verify put user public key
    FutureGet getKey = otherClient.getDataManager().getUnblocked(
        new Parameters().setLocationKey(credentials.getUserId()).setContentKey(
            H2HConstants.USER_PUBLIC_KEY));
    getKey.awaitUninterruptibly();
    getKey.getFutureRequests().awaitUninterruptibly();
    UserPublicKey publicKey = (UserPublicKey) getKey.getData().object();
View Full Code Here

    UserCredentials credentials = NetworkTestUtil.generateRandomCredentials();

    // already put a locations map
    FuturePut putLocations = client.getDataManager().putUnblocked(
        new Parameters().setLocationKey(credentials.getUserId())
            .setContentKey(H2HConstants.USER_LOCATIONS)
            .setData(new Locations(credentials.getUserId())));
    putLocations.awaitUninterruptibly();
    putLocations.getFutureRequests().awaitUninterruptibly();
View Full Code Here

TOP

Related Classes of org.hive2hive.core.network.data.parameters.Parameters

Copyright © 2018 www.massapicom. 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.