Package org.hive2hive.core.processes.util

Examples of org.hive2hive.core.processes.util.TestProcessComponentListener


    SessionParameters sessionParameters = new SessionParameters();
    sessionParameters.setProfileManager(new UserProfileManager(client.getDataManager(), wrongCredentials));

    IProcessComponent loginProcess = ProcessFactory.instance().createLoginProcess(wrongCredentials, sessionParameters,
        client);
    TestProcessComponentListener listener = new TestProcessComponentListener();
    loginProcess.attachListener(listener);
    loginProcess.start();

    UseCaseTestUtil.waitTillFailed(listener, 20);
View Full Code Here


        } catch (SendFailedException e) {
          throw new ProcessExecutionException("Expected behavior.", e);
        }
      }
    };
    TestProcessComponentListener listener = new TestProcessComponentListener();
    step.attachListener(listener);
    step.start();
    // wait for the process to finish
    UseCaseTestUtil.waitTillFailed(listener, 10);
View Full Code Here

    String locationKey = holder.getNodeId();
    String contentKey = NetworkTestUtil.randomString();

    TestGetProcessStepRollBack getStepRollBack = new TestGetProcessStepRollBack(locationKey, contentKey,
        getter.getDataManager());
    TestProcessComponentListener listener = new TestProcessComponentListener();
    getStepRollBack.attachListener(listener);
    getStepRollBack.start();

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

  public void testDownloadWrongKeys() throws IOException, NoSessionException, GetFailedException,
      InvalidProcessStateException {
    KeyPair wrongKeys = EncryptionUtil.generateRSAKeyPair(H2HConstants.KEYLENGTH_META_FILE);

    IProcessComponent process = ProcessFactory.instance().createDownloadFileProcess(wrongKeys.getPublic(), downloader);
    TestProcessComponentListener listener = new TestProcessComponentListener();
    process.attachListener(listener);
    process.start();

    UseCaseTestUtil.waitTillFailed(listener, 20);
  }
View Full Code Here

    FileUtils.write(existing, testContent);
    long lastModifiedBefore = existing.lastModified();

    IProcessComponent process = ProcessFactory.instance().createDownloadFileProcess(fileNode.getFilePublicKey(),
        downloader);
    TestProcessComponentListener listener = new TestProcessComponentListener();
    process.attachListener(listener);
    process.start();

    UseCaseTestUtil.waitTillFailed(listener, 20);
View Full Code Here

                .setData(testData)).awaitUninterruptibly();

    // initialize the process and the one and only step to test
    TestRemoveProcessStep removeStep = new TestRemoveProcessStep(locationKey, contentKey, network.get(0)
        .getDataManager());
    TestProcessComponentListener listener = new TestProcessComponentListener();
    removeStep.attachListener(listener);
    removeStep.start();
    UseCaseTestUtil.waitTillFailed(listener, 10);
  }
View Full Code Here

    String data = NetworkTestUtil.randomString();

    // initialize the process and the one and only step to test
    TestPutProcessStep putStep = new TestPutProcessStep(locationKey, contentKey, new H2HTestData(data),
        putter.getDataManager());
    TestProcessComponentListener listener = new TestProcessComponentListener();
    putStep.attachListener(listener);
    putStep.start();

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

    // skip the login and continue with the newfile process
    NetworkManager client = network.get(2);

    File file = FileTestUtil.createFileRandomContent(1, uploaderRoot, CHUNK_SIZE);
    IProcessComponent process = ProcessFactory.instance().createNewFileProcess(file, client);
    TestProcessComponentListener listener = new TestProcessComponentListener();
    process.attachListener(listener);
    process.start();

    UseCaseTestUtil.waitTillFailed(listener, 40);
  }
View Full Code Here

    KeyPair protectionKeys = EncryptionUtil.generateRSAKeyPair();

    // initialize the process and the one and only step to test
    PutLocationContext context = new PutLocationContext(newLocations, protectionKeys);
    PutUserLocationsStep step = new PutUserLocationsStep(context, context, putter.getDataManager());
    TestProcessComponentListener listener = new TestProcessComponentListener();
    step.attachListener(listener);
    step.start();

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

    KeyPair key = EncryptionUtil.generateRSAKeyPair(H2HConstants.KEYLENGTH_USER_KEYS);
    NetworkManager node = network.get(random.nextInt(networkSize));

    TestPutUserProfileTaskStep putStep = new TestPutUserProfileTaskStep(userId, userProfileTask, key.getPublic(), node);

    TestProcessComponentListener listener = new TestProcessComponentListener();
    AsyncComponent component = new AsyncComponent(putStep);
    component.attachListener(listener);

    // start and cancel immediately
    component.start();
View Full Code Here

TOP

Related Classes of org.hive2hive.core.processes.util.TestProcessComponentListener

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.