Examples of TestViewResultListener


Examples of com.opengamma.engine.test.TestViewResultListener

    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();

    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);

    final TestViewResultListener resultListener = new TestViewResultListener();
    client.setResultListener(resultListener);

    final Instant time0 = Instant.now();
    final ViewCycleExecutionOptions defaultCycleOptions = ViewCycleExecutionOptions.builder().setMarketDataSpecification(MarketData.live()).create();
    final ViewExecutionOptions executionOptions = new ExecutionOptions(ArbitraryViewCycleExecutionSequence.of(time0, time0.plusMillis(10), time0.plusMillis(20), time0.plusMillis(30)), ExecutionFlags
        .none().get(), defaultCycleOptions);

    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), executionOptions);

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    final ViewProcessWorker worker = env.getCurrentWorker(viewProcess);

    final CompiledViewDefinitionWithGraphsImpl compilationModel1 = (CompiledViewDefinitionWithGraphsImpl) resultListener.getViewDefinitionCompiled(Timeout.standardTimeoutMillis())
        .getCompiledViewDefinition();

    assertEquals(time0, resultListener.getCycleCompleted(10 * Timeout.standardTimeoutMillis()).getFullResult().getViewCycleExecutionOptions().getValuationTime());

    worker.requestCycle();
    assertEquals(time0.plusMillis(10), resultListener.getCycleCompleted(10 * Timeout.standardTimeoutMillis()).getFullResult().getViewCycleExecutionOptions().getValuationTime());
    resultListener.assertNoCalls(Timeout.standardTimeoutMillis());

    // TODO: This test doesn't belong here; it is specific to the SingleThreadViewComputationJob.

    // Trick the compilation job into thinking it needs to rebuilt after time0 + 20
    final CompiledViewDefinitionWithGraphsImpl compiledViewDefinition = new CompiledViewDefinitionWithGraphsImpl(VersionCorrection.LATEST, "", compilationModel1.getViewDefinition(),
        CompiledViewDefinitionWithGraphsImpl.getDependencyGraphs(compilationModel1), Collections.<ComputationTargetReference, UniqueId>emptyMap(), compilationModel1.getPortfolio(),
        compilationModel1.getFunctionInitId()) {
      @Override
      public Instant getValidTo() {
        return time0.plusMillis(20);
      }
    };
    ((SingleThreadViewProcessWorker) worker).cacheCompiledViewDefinition(compiledViewDefinition);

    // Running at time0 + 20 doesn't require a rebuild - should still use our dummy
    worker.requestCycle();
    assertEquals(time0.plusMillis(20), resultListener.getCycleCompleted(10 * Timeout.standardTimeoutMillis()).getFullResult().getViewCycleExecutionOptions().getValuationTime());
    resultListener.assertNoCalls();

    // time0 + 30 requires a rebuild
    worker.requestCycle();
    final CompiledViewDefinition compilationModel2 = resultListener.getViewDefinitionCompiled(Timeout.standardTimeoutMillis()).getCompiledViewDefinition();
    assertNotSame(compilationModel1, compilationModel2);
    assertNotSame(compiledViewDefinition, compilationModel2);
    assertEquals(time0.plusMillis(30), resultListener.getCycleCompleted(Timeout.standardTimeoutMillis()).getFullResult().getViewCycleExecutionOptions().getValuationTime());
    resultListener.assertProcessCompleted(Timeout.standardTimeoutMillis());

    resultListener.assertNoCalls(Timeout.standardTimeoutMillis());

    assertTrue(executionOptions.getExecutionSequence().isEmpty());

    // Job should have terminated automatically with no further evaluation times
    assertEquals(ViewProcessState.FINISHED, viewProcess.getState());
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

    vp.start();

    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
    client.setFragmentResultMode(ViewResultMode.FULL_ONLY);

    final TestViewResultListener resultListener = new TestViewResultListener();
    client.setResultListener(resultListener);

    final Instant time0 = Instant.now();
    final ViewCycleExecutionOptions defaultCycleOptions = ViewCycleExecutionOptions.builder().setMarketDataSpecification(MarketData.live()).create();
    final ViewExecutionOptions executionOptions = new ExecutionOptions(ArbitraryViewCycleExecutionSequence.of(time0), ExecutionFlags.none().get(), defaultCycleOptions);

    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), executionOptions);

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    final ViewProcessWorker worker = env.getCurrentWorker(viewProcess);

    resultListener.expectNextCall(ViewDefinitionCompiledCall.class, 10 * Timeout.standardTimeoutMillis());
    resultListener.expectNextCall(CycleStartedCall.class, 10 * Timeout.standardTimeoutMillis());

    // We expect 2 calls - 1 for initial fragment, 1 for final fragment on completion
    resultListener.expectNextCall(CycleFragmentCompletedCall.class, 10 * Timeout.standardTimeoutMillis());
    resultListener.expectNextCall(CycleFragmentCompletedCall.class, 10 * Timeout.standardTimeoutMillis());

    assertEquals(time0, resultListener.getCycleCompleted(10 * Timeout.standardTimeoutMillis()).getFullResult().getViewCycleExecutionOptions().getValuationTime());

    resultListener.assertProcessCompleted(Timeout.standardTimeoutMillis());
    resultListener.assertNoCalls(Timeout.standardTimeoutMillis());

    assertTrue(executionOptions.getExecutionSequence().isEmpty());

    // Job should have terminated automatically with no further evaluation times
    assertEquals(ViewProcessState.FINISHED, viewProcess.getState());
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();

    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);

    final TestViewResultListener resultListener = new TestViewResultListener();
    client.setResultListener(resultListener);

    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().get()));

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    assertEquals(ViewProcessState.RUNNING, viewProcess.getState());

    resultListener.expectNextCall(ViewDefinitionCompiledCall.class, Timeout.standardTimeoutMillis());
    resultListener.expectNextCall(CycleCompletedCall.class, Timeout.standardTimeoutMillis());
    resultListener.assertNoCalls(Timeout.standardTimeoutMillis());

    client.detachFromViewProcess();
    assertEquals(ViewProcessState.RUNNING, viewProcess.getState());

    resultListener.assertNoCalls(Timeout.standardTimeoutMillis());

    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().get()));
    final ViewProcessImpl viewProcess2 = env.getViewProcess(vp, client.getUniqueId());
    assertEquals(viewProcess, viewProcess2);

    resultListener.expectNextCall(ViewDefinitionCompiledCall.class, Timeout.standardTimeoutMillis());
    resultListener.expectNextCall(CycleCompletedCall.class, Timeout.standardTimeoutMillis());

    client.detachFromViewProcess();

    // Still want to be able to shut down manually, e.g. through JMX
    assertEquals(1, vp.getViewProcesses().size());
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

  private static final Logger s_logger = LoggerFactory.getLogger(RateLimitingMergingViewProcessListenerTest.class);

  @Test
  public void testPassThrough() {
    final TestViewResultListener testListener = new TestViewResultListener();
    final RateLimitingMergingViewProcessListener mergingListener = new RateLimitingMergingViewProcessListener(testListener, mock(EngineResourceManagerImpl.class), new Timer("Custom timer"));

    // OK, it doesn't really test the 'synchronous' bit, but it at least checks that no merging has happened.
    addCompile(mergingListener);
    addResults(mergingListener, 1000);
    testListener.assertViewDefinitionCompiled();
    testListener.assertMultipleCycleCompleted(1000);
    testListener.assertNoCalls();

    mergingListener.setPaused(true);
    addResults(mergingListener, 1000);
    testListener.assertNoCalls();
    mergingListener.setPaused(false);
    testListener.assertCycleCompleted();
    testListener.assertNoCalls();

    mergingListener.setPaused(false);
    addResults(mergingListener, 1000);
    testListener.assertMultipleCycleCompleted(1000);

    mergingListener.processTerminated(false);
    testListener.assertProcessTerminated();
    testListener.assertNoCalls();

    mergingListener.processTerminated(false);
  }
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

    mergingListener.processTerminated(false);
  }

  @Test
  public void testMergingWhenRateLimiting() throws InterruptedException {
    final TestViewResultListener testListener = new TestViewResultListener();
    final RateLimitingMergingViewProcessListener mergingListener = new RateLimitingMergingViewProcessListener(testListener, mock(EngineResourceManagerImpl.class), new Timer("Custom timer"));
    mergingListener.setMinimumUpdatePeriodMillis(500);

    addResults(mergingListener, 1000);
    Thread.sleep(500);
    testListener.assertCycleCompleted();
    testListener.assertNoCalls();

    mergingListener.terminate();
  }
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

    mergingListener.terminate();
  }

  @Test
  public void testModifiableUpdatePeriod() throws InterruptedException {
    final TestViewResultListener testListener = new TestViewResultListener();
    final RateLimitingMergingViewProcessListener mergingListener = new RateLimitingMergingViewProcessListener(testListener, mock(EngineResourceManagerImpl.class), new Timer("Custom timer"));

    assertCorrectUpdateRate(mergingListener, testListener, 100);
    assertCorrectUpdateRate(mergingListener, testListener, 400);
    assertCorrectUpdateRate(mergingListener, testListener, 50);
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

    mergingListener.terminate();
  }

  @Test
  public void testCallOrderingAndCollapsing() throws InterruptedException {
    final TestViewResultListener testListener = new TestViewResultListener();
    final RateLimitingMergingViewProcessListener mergingListener = new RateLimitingMergingViewProcessListener(testListener, mock(EngineResourceManagerImpl.class), new Timer("Custom timer"));

    mergingListener.setPaused(true);
    testListener.assertNoCalls();

    // Begin sequence while paused

    addCompile(mergingListener);
    addResults(mergingListener, 10);

    final CompiledViewDefinitionWithGraphsImpl preCompilation = mock(CompiledViewDefinitionWithGraphsImpl.class);
    mergingListener.viewDefinitionCompiled(preCompilation, true);

    addResults(mergingListener, 10);
    mergingListener.cycleCompleted(mock(ViewComputationResultModel.class), getDeltaResult(1));
    final ViewComputationResultModel latestResult = mock(ViewComputationResultModel.class);
    mergingListener.cycleCompleted(latestResult, getDeltaResult(2));

    final CompiledViewDefinitionWithGraphsImpl postCompilation = mock(CompiledViewDefinitionWithGraphsImpl.class);
    mergingListener.viewDefinitionCompiled(postCompilation, true);

    mergingListener.processCompleted();
    mergingListener.processTerminated(false);

    // End of sequence while paused

    mergingListener.setPaused(false);

    testListener.assertViewDefinitionCompiled(Timeout.standardTimeoutMillis());
    testListener.assertViewDefinitionCompiled(Timeout.standardTimeoutMillis(), preCompilation);
    final ViewDeltaResultModel mergedDelta = testListener.getCycleCompleted(Timeout.standardTimeoutMillis()).getDeltaResult();

    assertEquals(2, mergedDelta.getAllResults().size());
    final Set<Pair<String, Integer>> results = new HashSet<Pair<String, Integer>>();
    for (final ViewResultEntry deltaItem : mergedDelta.getAllResults()) {
      results.add(Pair.of(deltaItem.getComputedValue().getSpecification().getValueName(), (Integer) deltaItem.getComputedValue().getValue()));
    }
    assertTrue(results.contains(Pair.of("value1", 1)));
    assertTrue(results.contains(Pair.of("value2", 2)));

    testListener.assertViewDefinitionCompiled(Timeout.standardTimeoutMillis(), postCompilation);
    testListener.assertProcessCompleted();
    testListener.assertProcessTerminated();
    testListener.assertNoCalls();
  }
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
    client.setResultMode(ViewResultMode.DELTA_ONLY);
    client.setFragmentResultMode(ViewResultMode.FULL_ONLY);

    final TestViewResultListener resultListener = new TestViewResultListener();
    client.setResultListener(resultListener);

    // Client not attached - should not have been listening to anything that might have been going on
    assertEquals(0, resultListener.getQueueSize());

    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), 1);
    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive2(), 2);

    assertEquals(0, resultListener.getQueueSize());

    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().get()));
    resultListener.assertViewDefinitionCompiled(TIMEOUT);
    resultListener.assertCycleStarted(TIMEOUT);
    resultListener.assertCycleFragmentCompleted(TIMEOUT);
    final ViewDeltaResultModel result1 = resultListener.getCycleCompleted(TIMEOUT).getDeltaResult();
    assertNotNull(result1);

    Map<ValueRequirement, Object> expected = new HashMap<ValueRequirement, Object>();
    expected.put(ViewProcessorTestEnvironment.getPrimitive1(), 1);
    expected.put(ViewProcessorTestEnvironment.getPrimitive2(), 2);
    assertComputationResult(expected, env.getCalculationResult(result1));

    client.pause();

    // Just update one live data value, and only this one value should end up in the delta
    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), 3);

    assertEquals(0, resultListener.getQueueSize());
    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    env.getCurrentWorker(viewProcess).requestCycle();

    // Should have been merging results received in the meantime
    resultListener.assertNoCalls(TIMEOUT);
    client.resume();
    resultListener.assertCycleStarted(TIMEOUT);
    resultListener.assertCycleFragmentCompleted(TIMEOUT);
    final ViewDeltaResultModel result2 = resultListener.getCycleCompleted(TIMEOUT).getDeltaResult();

    expected = new HashMap<ValueRequirement, Object>();
    expected.put(ViewProcessorTestEnvironment.getPrimitive1(), 3);
    assertComputationResult(expected, env.getCalculationResult(result2));
  }
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();

    final ViewClient client1 = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
    client1.setFragmentResultMode(ViewResultMode.FULL_ONLY);
    final TestViewResultListener client1ResultListener = new TestViewResultListener();
    client1.setResultListener(client1ResultListener);

    assertEquals(0, client1ResultListener.getQueueSize());

    client1.attachToViewProcess(env.getViewDefinition().getUniqueId(), ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().get()));

    // Wait for first computation cycle
    client1ResultListener.assertViewDefinitionCompiled(TIMEOUT);
    client1ResultListener.expectNextCall(CycleStartedCall.class, TIMEOUT);
    client1ResultListener.assertCycleFragmentCompleted(TIMEOUT);
    client1ResultListener.assertCycleCompleted(TIMEOUT);

    final ViewClient client2 = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
    client2.setFragmentResultMode(ViewResultMode.FULL_ONLY);
    final TestViewResultListener client2ResultListener = new TestViewResultListener();
    client2.setResultListener(client2ResultListener);

    assertEquals(0, client2ResultListener.getQueueSize());
    client2.attachToViewProcess(env.getViewDefinition().getUniqueId(), ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().get()));

    // Initial result should be pushed through
    client2ResultListener.assertViewDefinitionCompiled(TIMEOUT);
    client2ResultListener.assertCycleCompleted(TIMEOUT);

    final ViewProcessImpl viewProcess1 = env.getViewProcess(vp, client1.getUniqueId());
    final ViewProcessImpl viewProcess2 = env.getViewProcess(vp, client2.getUniqueId());
    assertEquals(viewProcess1, viewProcess2);

    client1.pause();
    client1ResultListener.assertNoCalls(TIMEOUT);

    // Now client 1 is paused, so any changes should be batched.
    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), (byte) 1);
    env.getCurrentWorker(viewProcess1).requestCycle();
    client2ResultListener.assertCycleStarted(TIMEOUT);
    client2ResultListener.assertCycleFragmentCompleted(TIMEOUT);
    client2ResultListener.assertCycleCompleted(TIMEOUT);
    assertEquals(0, client2ResultListener.getQueueSize());
    client1ResultListener.assertNoCalls(TIMEOUT);

    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), (byte) 2);
    env.getCurrentWorker(viewProcess1).requestCycle();
    client2ResultListener.assertCycleStarted(TIMEOUT);
    client2ResultListener.assertCycleFragmentCompleted(TIMEOUT);
    client2ResultListener.assertCycleCompleted(TIMEOUT);
    assertEquals(0, client2ResultListener.getQueueSize());
    client1ResultListener.assertNoCalls(TIMEOUT);

    // Resuming should release the most recent result to the client
    client1.resume();
    client1ResultListener.getCycleStarted(TIMEOUT).getCycleMetadata();
    final ViewComputationResultModel result2Fragment = client1ResultListener.getCycleFragmentCompleted(TIMEOUT).getFullFragment();
    final ViewComputationResultModel result2 = client1ResultListener.getCycleCompleted(TIMEOUT).getFullResult();
    Map<ValueRequirement, Object> expected = new HashMap<ValueRequirement, Object>();
    expected.put(ViewProcessorTestEnvironment.getPrimitive1(), (byte) 2);
    expected.put(ViewProcessorTestEnvironment.getPrimitive2(), (byte) 0);
    assertComputationResult(expected, env.getCalculationResult(result2Fragment));
    assertComputationResult(expected, env.getCalculationResult(result2));

    // Changes should now propagate straight away to both listeners
    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), (byte) 3);
    env.getCurrentWorker(viewProcess1).requestCycle();
    client1ResultListener.assertCycleStarted(TIMEOUT);
    client2ResultListener.assertCycleStarted(TIMEOUT);
    client2ResultListener.assertCycleFragmentCompleted(TIMEOUT);
    client2ResultListener.assertCycleCompleted(TIMEOUT);
    final ViewComputationResultModel result3Fragment = client1ResultListener.getCycleFragmentCompleted(TIMEOUT).getFullFragment();
    final ViewComputationResultModel result3 = client1ResultListener.getCycleCompleted(TIMEOUT).getFullResult();
    expected = new HashMap<ValueRequirement, Object>();
    expected.put(ViewProcessorTestEnvironment.getPrimitive1(), (byte) 3);
    expected.put(ViewProcessorTestEnvironment.getPrimitive2(), (byte) 0);
    assertComputationResult(expected, env.getCalculationResult(result3Fragment));
    assertComputationResult(expected, env.getCalculationResult(result3));

    // Pause results again and we should be back to merging both whole cycle results and fragments
    client1.pause();
    client2ResultListener.assertNoCalls(TIMEOUT);
    client1ResultListener.assertNoCalls(TIMEOUT);

    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive2(), (byte) 1);
    env.getCurrentWorker(viewProcess1).requestCycle();
    client2ResultListener.assertCycleStarted(TIMEOUT);
    client2ResultListener.assertCycleFragmentCompleted(TIMEOUT);
    client2ResultListener.assertCycleCompleted(TIMEOUT);
    assertEquals(0, client2ResultListener.getQueueSize());
    client1ResultListener.assertNoCalls(TIMEOUT);

    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive2(), (byte) 2);
    env.getCurrentWorker(viewProcess1).requestCycle();
    client2ResultListener.assertCycleStarted(TIMEOUT);
    client2ResultListener.assertCycleFragmentCompleted(TIMEOUT);
    client2ResultListener.assertCycleCompleted(TIMEOUT);
    assertEquals(0, client2ResultListener.getQueueSize());
    client1ResultListener.assertNoCalls(TIMEOUT);

    // Start results again
    client1.resume();
    client1ResultListener.assertCycleStarted(TIMEOUT);
    final ViewComputationResultModel result4Fragment = client1ResultListener.getCycleFragmentCompleted(TIMEOUT).getFullFragment();
    final ViewComputationResultModel result4 = client1ResultListener.getCycleCompleted(TIMEOUT).getFullResult();
    assertEquals(0, client1ResultListener.getQueueSize());
    client2ResultListener.assertNoCalls(TIMEOUT);
    expected = new HashMap<ValueRequirement, Object>();
    expected.put(ViewProcessorTestEnvironment.getPrimitive1(), (byte) 3);
    expected.put(ViewProcessorTestEnvironment.getPrimitive2(), (byte) 2);
    assertComputationResult(expected, env.getCalculationResult(result4Fragment));
    assertComputationResult(expected, env.getCalculationResult(result4));

    client1.detachFromViewProcess();
    client2ResultListener.assertNoCalls(TIMEOUT);
    client1ResultListener.assertNoCalls(TIMEOUT);

    client1.shutdown();
    client1ResultListener.assertClientShutdown(TIMEOUT);

    client2.setResultListener(null);
    client2.shutdown();
    client2ResultListener.assertNoCalls(TIMEOUT);
  }
View Full Code Here

Examples of com.opengamma.engine.test.TestViewResultListener

    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();

    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
    client.setFragmentResultMode(ViewResultMode.FULL_ONLY);
    final TestViewResultListener resultListener1 = new TestViewResultListener();
    client.setResultListener(resultListener1);

    // Start live computation and collect the initial result
    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), 2);

    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().get()));
    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    assertEquals(ViewProcessState.RUNNING, viewProcess.getState());

    final ViewProcessWorker worker = env.getCurrentWorker(viewProcess);
    resultListener1.assertViewDefinitionCompiled(TIMEOUT);
    resultListener1.assertCycleStarted(TIMEOUT);
    resultListener1.assertCycleFragmentCompleted(TIMEOUT);
    resultListener1.assertCycleCompleted(TIMEOUT);
    assertEquals(0, resultListener1.getQueueSize());

    // Push through a second result
    marketDataProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), 3);
    worker.requestCycle();
    resultListener1.assertCycleStarted(TIMEOUT);
    resultListener1.assertCycleFragmentCompleted(TIMEOUT);
    resultListener1.assertCycleCompleted(TIMEOUT);
    assertEquals(0, resultListener1.getQueueSize());

    // Change listener
    final TestViewResultListener resultListener2 = new TestViewResultListener();
    client.setResultListener(resultListener2);

    // Push through a result which should arrive at the new listener
    worker.requestCycle();
    resultListener2.assertCycleStarted(TIMEOUT);
    resultListener2.assertCycleFragmentCompleted(TIMEOUT);
    resultListener2.assertCycleCompleted(TIMEOUT);
    assertEquals(0, resultListener1.getQueueSize());
    assertEquals(0, resultListener2.getQueueSize());

    client.setResultListener(null);
    client.shutdown();
    assertEquals(ViewProcessState.TERMINATED, viewProcess.getState());
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.