Examples of attachListener()


Examples of com.opengamma.engine.view.impl.ViewProcessImpl.attachListener()

    _viewProcess = viewProcess;
    _viewProcessor = viewProcessor;
    _objectName = createObjectName(viewProcessor.getName(), viewProcess.getUniqueId());
    if (_viewProcess instanceof ViewProcessImpl) {
      ViewProcessImpl viewProcessImpl = (ViewProcessImpl) viewProcess;
      viewProcessImpl.attachListener(new InternalViewResultListener() {
        @Override
        public UserPrincipal getUser() {
          return null;
        }
View Full Code Here

Examples of org.hive2hive.core.processes.framework.abstracts.ProcessComponent.attachListener()

    final int versionToRestore = 2;

    TestVersionSelector selector = new TestVersionSelector(versionToRestore);
    ProcessComponent process = ProcessFactory.instance().createRecoverFileProcess(file, selector, client);
    TestProcessComponentListener listener = new TestProcessComponentListener();
    process.attachListener(listener);
    process.start();
    UseCaseTestUtil.waitTillSucceded(listener, 120);

    // to verify, find the restored file
    File restoredFile = null;
View Full Code Here

Examples of org.hive2hive.core.processes.framework.concretes.SequentialProcess.attachListener()

    TestProcessComponentListener listener = new TestProcessComponentListener();

    // test success
    SequentialProcess successProcess = new SequentialProcess();
    successProcess.attachListener(listener);
    successProcess.start();

    assertTrue(listener.hasSucceeded());
    assertFalse(listener.hasFailed());
    assertTrue(listener.hasFinished());
View Full Code Here

Examples of org.hive2hive.core.processes.framework.concretes.SequentialProcess.attachListener()

    // test success (1-layer, steps only)
    SequentialProcess successProcess2 = new SequentialProcess();
    successProcess2.add(new SucceedingProcessStep());
    successProcess2.add(new SucceedingProcessStep());
    successProcess2.attachListener(listener);
    successProcess2.start();

    assertTrue(listener.hasSucceeded());
    assertFalse(listener.hasFailed());
    assertTrue(listener.hasFinished());
View Full Code Here

Examples of org.hive2hive.core.processes.framework.concretes.SequentialProcess.attachListener()

    // test success (1-layer, step and sub-process without children)
    SequentialProcess successProcess3 = new SequentialProcess();
    successProcess3.add(new SucceedingProcessStep());
    successProcess3.add(new SequentialProcess());
    successProcess3.attachListener(listener);
    successProcess3.start();

    assertTrue(listener.hasSucceeded());
    assertFalse(listener.hasFailed());
    assertTrue(listener.hasFinished());
View Full Code Here

Examples of org.hive2hive.core.processes.framework.concretes.SequentialProcess.attachListener()

    TestProcessComponentListener listener = new TestProcessComponentListener();

    // test fail
    SequentialProcess failProcess = new FailingSequentialProcess();
    failProcess.attachListener(listener);
    failProcess.start();

    assertFalse(listener.hasSucceeded());
    assertTrue(listener.hasFailed());
    assertTrue(listener.hasFinished());
View Full Code Here

Examples of org.hive2hive.core.processes.framework.concretes.SequentialProcess.attachListener()

    // test fail (1-layer, steps only)
    SequentialProcess failProcess2 = new SequentialProcess();
    failProcess2.add(new SucceedingProcessStep());
    failProcess2.add(new FailingProcessStep());
    failProcess2.attachListener(listener);
    failProcess2.start();

    assertFalse(listener.hasSucceeded());
    assertTrue(listener.hasFailed());
    assertTrue(listener.hasFinished());
View Full Code Here

Examples of org.hive2hive.core.processes.framework.concretes.SequentialProcess.attachListener()

    // test fail (1-layer, step and sub-process (failing) without children)
    SequentialProcess failProcess3 = new SequentialProcess();
    failProcess3.add(new SucceedingProcessStep());
    failProcess3.add(new FailingSequentialProcess());
    failProcess3.attachListener(listener);
    failProcess3.start();

    assertFalse(listener.hasSucceeded());
    assertTrue(listener.hasFailed());
    assertTrue(listener.hasFinished());
View Full Code Here

Examples of org.hive2hive.core.processes.framework.decorators.AsyncComponent.attachListener()

    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();
    putStep.cancel(new RollbackReason("Testing whether rollback works."));
    UseCaseTestUtil.waitTillFailed(listener, 10);
View Full Code Here

Examples of org.hive2hive.core.processes.framework.decorators.AsyncComponent.attachListener()

    TestProcessComponentListener listener = new TestProcessComponentListener();

    // test success
    AsyncComponent successProcess = new AsyncComponent(new SequentialProcess());
    successProcess.attachListener(listener);
    successProcess.start();

    UseCaseTestUtil.waitTillSucceded(listener, MAX_ASYNC_WAIT);

    assertTrue(listener.hasSucceeded());
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.