// This function doesn't actually require anything, so it can compute at the node level without anything else.
// Hence, the only target will be the node.
final MockFunction fn1 = MockFunction.getMockFunction(new ComputationTarget(ComputationTargetType.PORTFOLIO_NODE, pn), 14.2);
final InMemoryFunctionRepository functionRepo = new InMemoryFunctionRepository();
functionRepo.addFunction(fn1);
final FunctionCompilationContext functionCompilationContext = new FunctionCompilationContext();
functionCompilationContext.setFunctionInitId(123);
functionCompilationContext.setSecuritySource(securitySource);
final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), functionCompilationContext);
cfs.initialize();
final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource),
_cacheManager);
functionCompilationContext.setRawComputationTargetResolver(computationTargetResolver);
final ViewCompilationServices vcs = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, functionCompilationContext, new PoolExecutor(1, getClass()
.getSimpleName()),
new DependencyGraphBuilderFactory());
final ViewDefinition viewDefinition = new ViewDefinition("My View", UniqueId.of("FOO", "BAR"), "kirk");
// We've not provided a function that targets the position level, so we can't ask for it.