Package org.hive2hive.core

Examples of org.hive2hive.core.H2HWaiter


      }
    };
    UseCaseTestUtil.executeProcess(step);

    // wait till response message gets handled
    H2HWaiter waiter = new H2HWaiter(10);
    do {
      waiter.tickASecond();
      futureGet = nodeA.getDataManager().getUnblocked(parametersA);
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
View Full Code Here


   *
   * @param synchronizingFile
   *            the file to synchronize
   */
  private static void waitTillSynchronized(File synchronizingFile) {
    H2HWaiter waiter = new H2HWaiter(40);
    do {
      waiter.tickASecond();
    } while (!synchronizingFile.exists());
  }
View Full Code Here

   *
   * @param synchronizingFile
   *            the file to synchronize
   */
  private static void waitTillSynchronized(File synchronizingFile) {
    H2HWaiter waiter = new H2HWaiter(40);
    do {
      waiter.tickASecond();
    } while (!synchronizingFile.exists());
  }
View Full Code Here

    waitTillSynchronized(sharedFolderAtB, true);
    Assert.assertTrue(sharedFolderAtB.isDirectory());
  }

  private static void waitTillSynchronized(File synchronizingFile, boolean appearing) {
    H2HWaiter waiter = new H2HWaiter(40);
    if (appearing) {
      do {
        waiter.tickASecond();
      } while (!synchronizingFile.exists());
    } else {
      do {
        waiter.tickASecond();
      } while (synchronizingFile.exists());
    }
  }
View Full Code Here

    // verify the file (should have been downloaded automatically during the notification)
    Path relative = uploaderRoot.toPath().relativize(originalFile.toPath());
    File file = new File(downloaderRoot, relative.toString());

    // give some seconds for the file to download
    H2HWaiter waiter = new H2HWaiter(10);
    do {
      waiter.tickASecond();
    } while (!file.exists());

    Assert.assertTrue(file.exists());
    if (originalFile.isFile()) {
      Assert.assertEquals(FileUtils.readFileToString(originalFile), FileUtils.readFileToString(file));
View Full Code Here

        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);
    process.start();

    H2HWaiter waiter = new H2HWaiter(20);
    do {
      waiter.tickASecond();
    } while (!msgFactory.allMsgsArrived());

    Assert.assertEquals(ProcessState.SUCCEEDED, process.getState());
  }
View Full Code Here

    CountingNotificationMessageFactory msgFactory = new CountingNotificationMessageFactory(notifier);
    IProcessComponent process = ProcessFactory.instance().createNotificationProcess(msgFactory, users,
        notifier);
    process.start();

    H2HWaiter waiter = new H2HWaiter(20);
    do {
      waiter.tickASecond();
    } while (!msgFactory.allMsgsArrived());

    Assert.assertEquals(ProcessState.SUCCEEDED, process.getState());
  }
View Full Code Here

    CountingNotificationMessageFactory msgFactory = new CountingNotificationMessageFactory(notifier);
    IProcessComponent process = ProcessFactory.instance().createNotificationProcess(msgFactory, users,
        notifier);
    process.start();

    H2HWaiter waiter = new H2HWaiter(20);
    do {
      waiter.tickASecond();
    } while (!msgFactory.allMsgsArrived());

    Assert.assertEquals(4, msgFactory.getSentMessageCount());
    Assert.assertEquals(ProcessState.SUCCEEDED, process.getState());
  }
View Full Code Here

    process.start();

    // wait until all messages are sent
    UseCaseTestUtil.waitTillSucceded(listener, 20);

    H2HWaiter waiter = new H2HWaiter(10);
    do {
      waiter.tickASecond();
      // wait until all messages are here except 1
    } while (msgFactory.getArrivedMessageCount() != 3);
  }
View Full Code Here

TOP

Related Classes of org.hive2hive.core.H2HWaiter

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.