Package com.opengamma.engine.view.impl

Examples of com.opengamma.engine.view.impl.ViewProcessContext


public class PlanExecutorTest {

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

  private ViewProcessContext createViewProcessContext(final JobDispatcher jobDispatcher) {
    final ViewProcessContext context = Mockito.mock(ViewProcessContext.class);
    Mockito.when(context.getComputationJobDispatcher()).thenReturn(jobDispatcher);
    Mockito.when(context.getGraphExecutorStatisticsGathererProvider()).thenReturn(new TotallingGraphStatisticsGathererProvider());
    return context;
  }
View Full Code Here


    final Instant now = Instant.now();
    final SingleComputationCycle cycle = Mockito.mock(SingleComputationCycle.class);
    Mockito.when(cycle.getUniqueId()).thenReturn(UniqueId.of("Cycle", "Test"));
    Mockito.when(cycle.getValuationTime()).thenReturn(now);
    Mockito.when(cycle.getVersionCorrection()).thenReturn(VersionCorrection.of(now, now));
    final ViewProcessContext context = createViewProcessContext(jobDispatcher);
    Mockito.when(cycle.getViewProcessContext()).thenReturn(context);
    Mockito.when(cycle.getViewProcessId()).thenReturn(UniqueId.of("View", "Test"));
    Mockito.when(cycle.toString()).thenReturn("TEST-CYCLE");
    return cycle;
  }
View Full Code Here

    final GraphExecutorStatisticsGathererProvider graphExecutorStatisticsProvider = new DiscardingGraphStatisticsGathererProvider();
    final ViewDefinition viewDefinition = new ViewDefinition("TestView", UserPrincipal.getTestUser());
    viewDefinition.addViewCalculationConfiguration(new ViewCalculationConfiguration(viewDefinition, "default"));
    final MockConfigSource configSource = new MockConfigSource();
    configSource.put(viewDefinition);
    final ViewProcessContext vpc = new ViewProcessContext(UniqueId.of("Process", "Test"), configSource, viewPermissionProvider,
                                                          new DefaultViewPortfolioPermissionProvider(),
                                                          marketDataProviderResolver, compilationService, functionResolver,
        computationCacheSource, jobDispatcher, new SingleThreadViewProcessWorkerFactory(), new DependencyGraphBuilderFactory(), factory, graphExecutorStatisticsProvider,
        new DummyOverrideOperationCompiler(), new EngineResourceManagerImpl<SingleComputationCycle>(), new VersionedUniqueIdSupplier("Test", "1"), new InMemoryViewExecutionCache());
    final DependencyGraph graph = new DependencyGraph("Default");
View Full Code Here

      Mockito.when(targetResolver.changeManager()).thenReturn(changeManager);
      final FunctionCompilationContext ctx = new FunctionCompilationContext();
      ctx.setRawComputationTargetResolver(targetResolver);
      final CompiledFunctionService cfs = Mockito.mock(CompiledFunctionService.class);
      Mockito.when(cfs.getFunctionCompilationContext()).thenReturn(ctx);
      final ViewProcessContext vpContext = Mockito.mock(ViewProcessContext.class);
      Mockito.when(vpContext.getFunctionCompilationService()).thenReturn(cfs);
      final MockContext context = new MockContext(vpContext);
      final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
      final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
      final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory(executor, resolutions), context, options, viewDefinition);
      callback.execute(worker, options);
View Full Code Here

TOP

Related Classes of com.opengamma.engine.view.impl.ViewProcessContext

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.