Examples of InfiniteViewCycleExecutionSequence


Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

  }

  public void testInfiniteSequence() {
    final ViewProcessWorkerFactoryMock underlying = new ViewProcessWorkerFactoryMock();
    final SequencePartitioningViewProcessWorkerFactory test = createFactory(underlying);
    final ViewCycleExecutionSequence sequence = new InfiniteViewCycleExecutionSequence();
    final ViewExecutionOptions options = ExecutionOptions.of(sequence, EnumSet.of(ViewExecutionFlags.RUN_AS_FAST_AS_POSSIBLE));
    test.createWorker(Mockito.mock(ViewProcessWorkerContext.class), options, Mockito.mock(ViewDefinition.class));
    assertEquals(underlying._executionOptions.size(), 4);
    for (ViewExecutionOptions spawned : underlying._executionOptions) {
      assertEquals(spawned.getDefaultExecutionOptions(), options.getDefaultExecutionOptions());
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

    final ViewProcessWorkerFactory underlying = Mockito.mock(ViewProcessWorkerFactory.class);
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ParallelRecompilationViewProcessWorkerFactory factory = new ParallelRecompilationViewProcessWorkerFactory(underlying);
    factory.setDelegate(factory);
    final ViewExecutionOptions options = new ExecutionOptions(new InfiniteViewCycleExecutionSequence(), ExecutionFlags.triggersEnabled().awaitMarketData().ignoreCompilationValidity().get());
    factory.createWorker(context, options, viewDefinition);
    Mockito.verify(underlying, Mockito.only()).createWorker(context, options, viewDefinition);
  }
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

    final ViewProcessWorkerFactory underlying = Mockito.mock(ViewProcessWorkerFactory.class);
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ParallelRecompilationViewProcessWorkerFactory factory = new ParallelRecompilationViewProcessWorkerFactory(underlying);
    factory.setDelegate(factory);
    final ViewExecutionOptions options = new ExecutionOptions(new InfiniteViewCycleExecutionSequence(), ExecutionFlags.triggersEnabled().awaitMarketData().get());
    factory.createWorker(context, options, viewDefinition);
    Mockito.verify(underlying, Mockito.only()).createWorker(context, options, viewDefinition);
  }
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

  }

  public void testParallel() {
    final ViewProcessWorkerFactory underlying = Mockito.mock(ViewProcessWorkerFactory.class);
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = new ExecutionOptions(new InfiniteViewCycleExecutionSequence(), ExecutionFlags.triggersEnabled().waitForInitialTrigger()
        .parallelCompilation(ParallelRecompilationMode.PARALLEL_EXECUTION).get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ViewProcessWorker delegateWorker = Mockito.mock(ViewProcessWorker.class);
    Mockito.when(underlying.createWorker(Mockito.<ViewProcessWorkerContext>anyObject(), Mockito.<ViewExecutionOptions>anyObject(), Mockito.<ViewDefinition>anyObject())).then(
        new Answer<ViewProcessWorker>() {
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

  }

  public void testDeferred() {
    final ViewProcessWorkerFactory underlying = Mockito.mock(ViewProcessWorkerFactory.class);
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = new ExecutionOptions(new InfiniteViewCycleExecutionSequence(), ExecutionFlags.none().awaitMarketData()
        .parallelCompilation(ParallelRecompilationMode.DEFERRED_EXECUTION).get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ViewProcessWorker delegateWorker = Mockito.mock(ViewProcessWorker.class);
    Mockito.when(underlying.createWorker(Mockito.<ViewProcessWorkerContext>anyObject(), Mockito.<ViewExecutionOptions>anyObject(), Mockito.<ViewDefinition>anyObject())).then(
        new Answer<ViewProcessWorker>() {
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

  }

  public void testImmediate() {
    final ViewProcessWorkerFactory underlying = Mockito.mock(ViewProcessWorkerFactory.class);
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final ViewExecutionOptions options = new ExecutionOptions(new InfiniteViewCycleExecutionSequence(), ExecutionFlags.none().parallelCompilation(ParallelRecompilationMode.IMMEDIATE_EXECUTION).get());
    final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
    final ViewProcessWorker delegateWorker = Mockito.mock(ViewProcessWorker.class);
    Mockito.when(underlying.createWorker(Mockito.<ViewProcessWorkerContext>anyObject(), Mockito.<ViewExecutionOptions>anyObject(), Mockito.<ViewDefinition>anyObject())).then(
        new Answer<ViewProcessWorker>() {
          @Override
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

    Mockito.verify(context, Mockito.times(0)).viewDefinitionCompilationFailed(Mockito.any(Instant.class), Mockito.any(Exception.class));
  }

  public void testInfiniteSequence() throws InterruptedException {
    final ViewProcessWorkerFactoryMock underlying = new ViewProcessWorkerFactoryMock((int) (Timeout.standardTimeoutMillis() / 32));
    final ViewExecutionOptions options = ExecutionOptions.of(new InfiniteViewCycleExecutionSequence(), EnumSet.of(ViewExecutionFlags.RUN_AS_FAST_AS_POSSIBLE));
    final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
    final SequencePartitioningViewProcessWorker worker = new SequencePartitioningViewProcessWorker(underlying, context, options, Mockito.mock(ViewDefinition.class), 10, 2);
    assertFalse(worker.join(Timeout.standardTimeoutMillis()));
    assertFalse(worker.isTerminated());
    worker.terminate();
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

    vp.start();

    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
    final CycleCountingViewResultListener listener = new CycleCountingViewResultListener(10);
    client.setResultListener(listener);
    final ViewExecutionOptions executionOptions = ExecutionOptions.of(new InfiniteViewCycleExecutionSequence(), ViewCycleExecutionOptions.builder().setMarketDataSpecification(MarketData.live())
        .create(),
        ExecutionFlags.none().runAsFastAsPossible().get());
    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), executionOptions);
    listener.awaitCycles(10 * Timeout.standardTimeoutMillis());

 
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

            .setMarketDataSelector(marketDataSelector)
            .setResolverVersionCorrection(viewRequest.getPortfolioVersionCorrection())
            .create();
    EnumSet<ViewExecutionFlags> flags =
        ExecutionFlags.triggersEnabled().parallelCompilation(parallelViewRecompilation).get();
    _executionOptions = ExecutionOptions.of(new InfiniteViewCycleExecutionSequence(), defaultOptions, flags);
    _listeners = listeners;
    // this recalcs periodically or when market data changes. might need to give
    // the user the option to specify the behaviour
  }
View Full Code Here

Examples of com.opengamma.engine.view.execution.InfiniteViewCycleExecutionSequence

    return serializer.newMessage();
  }

  @Override
  public InfiniteViewCycleExecutionSequence buildObject(FudgeDeserializer deserializer, FudgeMsg message) {
    return new InfiniteViewCycleExecutionSequence();
  }
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.