Examples of atVersionCorrection()


Examples of com.opengamma.engine.ComputationTargetResolver.atVersionCorrection()

      if (portfolioId == null) {
        throw new OpenGammaRuntimeException("The view definition '" + getContext().getViewDefinition().getName()
            + "' contains required portfolio outputs, but it does not reference a portfolio.");
      }
      final ComputationTargetResolver resolver = getContext().getServices().getFunctionCompilationContext().getRawComputationTargetResolver();
      final ComputationTargetResolver.AtVersionCorrection versioned = resolver.atVersionCorrection(getContext().getResolverVersionCorrection());
      final ComputationTargetSpecification specification = versioned.getSpecificationResolver()
          .getTargetSpecification(new ComputationTargetSpecification(ComputationTargetType.PORTFOLIO, portfolioId));
      if (specification == null) {
        throw new OpenGammaRuntimeException("Unable to identify portfolio '" + portfolioId + "' for view '" + getContext().getViewDefinition().getName() + "'");
      }
View Full Code Here

Examples of com.opengamma.engine.ComputationTargetResolver.atVersionCorrection()

  private FunctionCompilationContext createFunctionCompilationContext() {
    final FunctionCompilationContext context = new FunctionCompilationContext();
    final ComputationTargetResolver targetResolver = Mockito.mock(ComputationTargetResolver.class);
    Mockito.when(targetResolver.resolve(new ComputationTargetSpecification(ComputationTargetType.PORTFOLIO, UniqueId.of("Portfolio", "0", "V")), VersionCorrection.LATEST)).thenReturn(
        new ComputationTarget(ComputationTargetType.PORTFOLIO, createPortfolio()));
    Mockito.when(targetResolver.atVersionCorrection(VersionCorrection.LATEST)).thenReturn(Mockito.mock(ComputationTargetResolver.AtVersionCorrection.class));
    context.setRawComputationTargetResolver(targetResolver);
    return context;
  }

  private FunctionRepository createFunctionRepository() {
View Full Code Here

Examples of com.opengamma.engine.ComputationTargetResolver.atVersionCorrection()

    final DependencyGraphBuilder builder = new DependencyGraphBuilder();
    builder.setMarketDataAvailabilityProvider(_liveDataAvailabilityProvider);
    final FunctionCompilationContext context = new FunctionCompilationContext();
    final ComputationTargetResolver targetResolver = new MapComputationTargetResolver();
    context.setRawComputationTargetResolver(targetResolver);
    context.setComputationTargetResolver(targetResolver.atVersionCorrection(VersionCorrection.of(now, now)));
    builder.setCompilationContext(context);
    final CompiledFunctionService compilationService = new CompiledFunctionService(_functionRepo, new CachingFunctionRepositoryCompiler(), context);
    compilationService.initialize();
    final DefaultFunctionResolver resolver;
    if (prioritizer != null) {
View Full Code Here

Examples of com.opengamma.engine.MapComputationTargetResolver.atVersionCorrection()

    final DependencyGraphBuilder builder = new DependencyGraphBuilder();
    builder.setMarketDataAvailabilityProvider(_liveDataAvailabilityProvider);
    final FunctionCompilationContext context = new FunctionCompilationContext();
    final ComputationTargetResolver targetResolver = new MapComputationTargetResolver();
    context.setRawComputationTargetResolver(targetResolver);
    context.setComputationTargetResolver(targetResolver.atVersionCorrection(VersionCorrection.of(now, now)));
    builder.setCompilationContext(context);
    final CompiledFunctionService compilationService = new CompiledFunctionService(_functionRepo, new CachingFunctionRepositoryCompiler(), context);
    compilationService.initialize();
    final DefaultFunctionResolver resolver;
    if (prioritizer != null) {
View Full Code Here

Examples of com.opengamma.engine.target.ComputationTargetSpecificationResolver.atVersionCorrection()

    for (ValueRequirement requirement : inRequirements) {
      assertEquals(requirement.getValueName(), MarketDataRequirementNames.MARKET_VALUE);
      assertEquals(requirement.getTargetReference(), inRequirementTarget);
      assertTrue(requirement.getConstraints().isSatisfiedBy(ValueProperties.none()));
    }
    Set<ComputedValue> outputs = _function.execute(_functionExecutionContext, new FunctionInputsImpl(resolver.atVersionCorrection(VersionCorrection.LATEST), new ComputedValue(new ValueSpecification(
        MarketDataRequirementNames.MARKET_VALUE, ComputationTargetSpecification.of(UniqueId.of("ExternalId-LiveData", "USD_GBP")), properties), _rateUSD_GBP)), _matrixTarget,
        Collections.singleton(outRequirement));
    assertEquals(1, outputs.size());
    ComputedValue output = outputs.iterator().next();
    assertTrue(output.getValue() instanceof Double);
View Full Code Here

Examples of com.opengamma.engine.target.ComputationTargetSpecificationResolver.atVersionCorrection()

      assertEquals(requirement.getValueName(), MarketDataRequirementNames.MARKET_VALUE);
      assertEquals(requirement.getTargetReference(), inRequirementTarget);
      assertTrue(requirement.getConstraints().isSatisfiedBy(ValueProperties.none()));
    }
    outputs = _function.execute(_functionExecutionContext,
        new FunctionInputsImpl(resolver.atVersionCorrection(VersionCorrection.LATEST), new ComputedValue(new ValueSpecification(MarketDataRequirementNames.MARKET_VALUE,
            ComputationTargetSpecification.of(UniqueId.of("ExternalId-LiveData", "USD_GBP")), properties), _rateUSD_GBP)), _matrixTarget, Collections.singleton(outRequirement));
    assertEquals(1, outputs.size());
    output = outputs.iterator().next();
    assertTrue(output.getValue() instanceof Double);
    assertEquals(1.0 / _rateUSD_GBP, (Double) output.getValue(), Double.MIN_NORMAL);
View Full Code Here

Examples of com.opengamma.engine.target.ComputationTargetSpecificationResolver.atVersionCorrection()

      assertEquals(requirement.getValueName(), MarketDataRequirementNames.MARKET_VALUE);
      assertEquals(requirement.getTargetReference(), inRequirementTarget);
      assertTrue(requirement.getConstraints().isSatisfiedBy(ValueProperties.none()));
    }
    outputs = _function.execute(_functionExecutionContext,
        new FunctionInputsImpl(resolver.atVersionCorrection(VersionCorrection.LATEST), new ComputedValue(new ValueSpecification(MarketDataRequirementNames.MARKET_VALUE,
            ComputationTargetSpecification.of(UniqueId.of("ExternalId-LiveData", "USD_GBP")), properties), _rateUSD_GBP)), _matrixTarget, Collections.singleton(outRequirement));
    assertEquals(1, outputs.size());
    output = outputs.iterator().next();
    assertTrue(output.getValue() instanceof Double);
    assertEquals(_rateEUR_GBP / _rateUSD_GBP, (Double) output.getValue(), Double.MIN_NORMAL);
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.