Package com.opengamma.engine.test

Examples of com.opengamma.engine.test.MockFunction.addRequirement()


        }
        return super.getResults(context, target, inputs);
      }

    };
    fnConv.addRequirement(helper.getRequirement2Any());
    helper.getFunctionRepository().addFunction(fnConv);
    DependencyGraphBuilder builder = helper.createBuilder(new FunctionPriority() {
      @Override
      public int getPriority(CompiledFunctionDefinition function) {
        if (function == fnConv) {
View Full Code Here


        //assertTrue(outputs.contains(expected));
        return Collections.singleton(helper.getRequirement1Foo());
      }

    };
    fnConv.addRequirement(helper.getRequirement2Any());
    helper.getFunctionRepository().addFunction(fnConv);
    DependencyGraphBuilder builder = helper.createBuilder(null);
    builder.addTarget(helper.getRequirement1Bar());
    DependencyGraph graph = builder.getDependencyGraph();
    assertNotNull(graph);
View Full Code Here

          return Collections.singleton(helper.getRequirement1Foo());
        }
      }

    };
    fnConv.addRequirement(helper.getRequirement2Any());
    helper.getFunctionRepository().addFunction(fnConv);
    DependencyGraphBuilder builder = helper.createBuilder(new FunctionPriority() {
      @Override
      public int getPriority(CompiledFunctionDefinition function) {
        if (function == fn2Foo) {
View Full Code Here

        final ValueRequirement req2bar = helper.getRequirement2Bar();
        return Collections.singleton(new ValueSpecification(req2bar.getValueName(), target.toSpecification(), req2bar.getConstraints().copy().with(ValuePropertyNames.FUNCTION, getUniqueId()).get()));
      }

    };
    fnConv.addRequirement(helper.getRequirement2Foo());
    helper.getFunctionRepository().addFunction(fnConv);
    final MockFunction fn2 = helper.addFunctionRequiringProducing(helper.getRequirement1Foo(), helper.getValue2Foo());
    DependencyGraphBuilder builder = helper.createBuilder(null);
    builder.addTarget(helper.getRequirement2Foo());
    DependencyGraph graph = builder.getDependencyGraph();
View Full Code Here

        getResultsCalled.set(true);
        return super.getResults(context, target, inputs);
      }

    };
    fnConv.addRequirement(helper.getRequirement2Any());
    helper.getFunctionRepository().addFunction(fnConv);
    DependencyGraphBuilder builder = helper.createBuilder(new FunctionPriority() {
      @Override
      public int getPriority(CompiledFunctionDefinition function) {
        if (function == fnConv) {
View Full Code Here

        return Collections.singleton(new ValueSpecification(helper.getRequirement2().getValueName(), target.toSpecification(),
            ValueProperties.with(ValuePropertyNames.FUNCTION, getUniqueId()).with("TEST", input.getProperties().getValues("TEST")).get()));
      }

    };
    fnConv1.addRequirement(helper.getRequirement1Any());
    helper.getFunctionRepository().addFunction(fnConv1);
    // This converter will preserve the value name but manipulate a property; and be selected if a converter is needed on top
    // of fnConv1 after late-stage composition
    final MockFunction fnConv2 = new MockFunction("conv2", helper.getTarget()) {
View Full Code Here

        assertEquals(1, inputs.size());
        return super.getResults(context, target, inputs);
      }

    };
    fnConv2.addRequirement(helper.getRequirement2Any());
    helper.getFunctionRepository().addFunction(fnConv2);
    DependencyGraphBuilder builder = helper.createBuilder(new FunctionPriority() {
      @Override
      public int getPriority(CompiledFunctionDefinition function) {
        if (function == fnConv2) {
View Full Code Here

        getResultsInvoked.incrementAndGet();
        return super.getResults(context, target, inputs);
      }

    };
    fnConv.addRequirement(helper.getRequirement1Any());
    helper.getFunctionRepository().addFunction(fnConv);
    DependencyGraphBuilder builder = helper.createBuilder(null);
    builder.addTarget(helper.getRequirement2Foo());
    builder.addTarget(helper.getRequirement2Bar());
    DependencyGraph graph = builder.getDependencyGraph();
View Full Code Here

    return function;
  }

  public MockFunction addFunctionRequiring2Producing1() {
    final MockFunction function = new MockFunction(FUNCTION_REQUIRING_2_PRODUCING_1, _target);
    function.addRequirement(_req2);
    function.addResult(_value1);
    _functionRepo.addFunction(function);
    return function;
  }
View Full Code Here

    return function;
  }

  public MockFunction addFunctionRequiringProducing(final ValueRequirement requirement, final ComputedValue result) {
    final MockFunction function = new MockFunction(Integer.toString(_mockId++), _target);
    function.addRequirement(requirement);
    function.addResult(result);
    _functionRepo.addFunction(function);
    return function;
  }
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.