Package org.hive2hive.core.processes.framework.interfaces

Examples of org.hive2hive.core.processes.framework.interfaces.IProcessComponent.start()


    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);
  }

  @Test
View Full Code Here


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

    UseCaseTestUtil.waitTillFailed(listener, 20);

    // the existing file has already same content, should not have been downloaded
    Assert.assertEquals(lastModifiedBefore, existing.lastModified());
View Full Code Here

    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);
  }

  @Test(expected = Exception.class)
View Full Code Here

    IProcessComponent registerProcess = ProcessFactory.instance().createRegisterProcess(credentials,
        client);
    ProcessComponentListener listener = new ProcessComponentListener();
    registerProcess.attachListener(listener);
    registerProcess.start();

    H2HWaiter waiter = new H2HWaiter(20);
    do {
      waiter.tickASecond();
    } while (!listener.hasFailed());
View Full Code Here

    CountingNotificationMessageFactory msgFactory = new CountingNotificationMessageFactory(notifier);
    IProcessComponent process = ProcessFactory.instance().createNotificationProcess(msgFactory,
        new HashSet<String>(0), notifier);
    TestProcessComponentListener listener = new TestProcessComponentListener();
    process.attachListener(listener);
    process.start();

    // wait until all messages are sent
    UseCaseTestUtil.waitTillSucceded(listener, 10);
  }
View Full Code Here

    Set<String> users = new HashSet<String>(1);
    users.add(userACredentials.getUserId());
    CountingNotificationMessageFactory msgFactory = new CountingNotificationMessageFactory(notifier);
    IProcessComponent process = ProcessFactory.instance().createNotificationProcess(msgFactory,
        new HashSet<String>(0), notifier);
    process.start();

    H2HWaiter waiter = new H2HWaiter(20);
    do {
      waiter.tickASecond();
    } while (!msgFactory.allMsgsArrived());
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.