Package com.opengamma.engine

Examples of com.opengamma.engine.ComputationTargetSpecification.replaceIdentifier()


          if (constraintValues.isEmpty() || constraintValues.contains(TARGET_SPECIFICATION_UNIQUE)) {
            requirementTarget = target.toSpecification();
          } else if (constraintValues.contains(TARGET_SPECIFICATION_OBJECT)) {
            final ComputationTargetSpecification targetSpec = target.toSpecification();
            if (targetSpec.getUniqueId() != null) {
              requirementTarget = ComputationTargetResolverUtils.simplifyType(targetSpec.replaceIdentifier(target.getUniqueId().toLatest()), resolver);
            } else {
              // Null - special case
              requirementTarget = targetSpec;
            }
          } else if (constraintValues.contains(TARGET_SPECIFICATION_EXTERNAL)) {
View Full Code Here


    final ComputationTargetResolver.AtVersionCorrection underlying = Mockito.mock(ComputationTargetResolver.AtVersionCorrection.class);
    final ConcurrentMap<ComputationTargetReference, UniqueId> resolutions = new ConcurrentHashMap<ComputationTargetReference, UniqueId>();
    final Set<UniqueId> expiredResolutions = new HashSet<UniqueId>();
    final ComputationTargetResolver.AtVersionCorrection resolver = TargetResolutionLogger.of(underlying, resolutions, expiredResolutions);
    final ComputationTargetSpecification spec = new ComputationTargetSpecification(ComputationTargetType.PRIMITIVE, UniqueId.of("Foo", "Bar"));
    final ComputationTarget target = new ComputationTarget(spec.replaceIdentifier(UniqueId.of("Foo", "Bar", "Cow")), new Primitive(UniqueId.of("Foo", "Bar", "Cow")));
    Mockito.when(underlying.resolve(spec)).thenReturn(target);
    final ObjectResolver shallowResolver = Mockito.mock(ObjectResolver.class);
    Mockito.when(underlying.getResolver(spec)).thenReturn(shallowResolver);
    assertSame(resolver.resolve(spec), target);
  }
View Full Code Here

    final ComputationTargetResolver.AtVersionCorrection underlying = Mockito.mock(ComputationTargetResolver.AtVersionCorrection.class);
    final ConcurrentMap<ComputationTargetReference, UniqueId> resolutions = new ConcurrentHashMap<ComputationTargetReference, UniqueId>();
    final Set<UniqueId> expiredResolutions = new HashSet<UniqueId>();
    final ComputationTargetResolver.AtVersionCorrection resolver = TargetResolutionLogger.of(underlying, resolutions, expiredResolutions);
    final ComputationTargetSpecification spec = new ComputationTargetSpecification(ComputationTargetType.PRIMITIVE, UniqueId.of("Foo", "Bar"));
    final ComputationTarget target = new ComputationTarget(spec.replaceIdentifier(UniqueId.of("Foo", "Bar", "Cow")), new Primitive(UniqueId.of("Foo", "Bar", "Cow")));
    Mockito.when(underlying.resolve(spec)).thenReturn(target);
    final ObjectResolver deepResolver = Mockito.mock(ObjectResolver.class);
    Mockito.when(deepResolver.deepResolver()).thenReturn(new DeepResolver() {
      @SuppressWarnings("serial")
      @Override
View Full Code Here

    } else {
      // Different type
      resolvedSpecification = (ComputationTargetSpecification) requestedSpecification.replaceType(resolvedType);
    }
    if (requestedSpecification.getUniqueId().isLatest() && target.getUniqueId().isVersioned()) {
      resolvedSpecification = resolvedSpecification.replaceIdentifier(target.getUniqueId());
    }
    return new ComputationTarget(resolvedSpecification, target);
  }

  @SuppressWarnings("unchecked")
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.