Package com.opengamma.engine.test

Examples of com.opengamma.engine.test.PrimitiveTestFunction


    return context;
  }

  public void testBasicResolution() {
    final ComputationTarget target = new ComputationTarget(ComputationTargetType.PRIMITIVE, UniqueId.of("scheme", "test_target"));
    final ParameterizedFunction parameterizedF1 = function(new PrimitiveTestFunction("req1"), "1");
    final ParameterizedFunction parameterizedF2 = function(new PrimitiveTestFunction("req1"), "2");
    final DefaultCompiledFunctionResolver resolver = new DefaultCompiledFunctionResolver(createFunctionCompilationContext());
    resolver.addRule(new ResolutionRule(parameterizedF1, ApplyToAllTargets.INSTANCE, 100));
    resolver.addRule(new ResolutionRule(parameterizedF2, ApplyToAllTargets.INSTANCE, 200));
    resolver.compileRules();
    Triple<ParameterizedFunction, ValueSpecification, Collection<ValueSpecification>> result = resolver.resolveFunction("req1", target, ValueProperties.none()).next();
View Full Code Here


  }

  public void testFilteredRule() {
    final ComputationTarget target = new ComputationTarget(ComputationTargetType.PRIMITIVE, UniqueId.of("scheme", "test_target"));
    final ParameterizedFunction parameterizedF1 = function(new PrimitiveTestFunction("req1"), "1");
    final ParameterizedFunction parameterizedF2 = function(new PrimitiveTestFunction("req1"), "2");
    final DefaultCompiledFunctionResolver resolver = new DefaultCompiledFunctionResolver(createFunctionCompilationContext());
    resolver.addRule(new ResolutionRule(parameterizedF1, ApplyToAllTargets.INSTANCE, 100));
    resolver.addRule(new ResolutionRule(parameterizedF2, new Filter(target), 200));
    resolver.compileRules();
    Triple<ParameterizedFunction, ValueSpecification, Collection<ValueSpecification>> result = resolver.resolveFunction("req1", target, ValueProperties.none()).next();
View Full Code Here

TOP

Related Classes of com.opengamma.engine.test.PrimitiveTestFunction

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.