Package com.opengamma.core.position.impl

Examples of com.opengamma.core.position.impl.SimplePortfolioNode


  }

  @Test
  public void testAllChildrenDenyMeansParentPartials() {

    SimplePortfolioNode root =
        nodeTree(1,
                 nodeTree(2),
                 nodeTree(3),
                 nodeTree(4));
View Full Code Here


  }

  @Test
  public void testChildrenAllowAndDenyMeansParentPartials() {

    SimplePortfolioNode root =
        nodeTree(1,
                 nodeTree(2),
                 nodeTree(3),
                 nodeTree(4));
View Full Code Here

  }

  @Test
  public void testParentsDenialOverridesChildren() {

    SimplePortfolioNode root =
        nodeTree(1,
                 nodeTree(2),
                 nodeTree(3),
                 nodeTree(4));
View Full Code Here

  }

  @Test
  public void testMultilevelTree() {

    SimplePortfolioNode root =
        nodeTree(1,
           nodeTree(2,
              nodeTree(5),
              nodeTree(6)),
           nodeTree(3,
              nodeTree(7)),
           nodeTree(4,
              nodeTree(8),
              nodeTree(9)));

    // When we add child nodes, it's possible they are copied,
    // so we can't just pull these vars out as we construct
    // the tree
    List<PortfolioNode> childNodes = root.getChildNodes();
    PortfolioNode node2 = childNodes.get(0);
    PortfolioNode node3 = childNodes.get(1);
    PortfolioNode node4 = childNodes.get(2);

    Map< Integer, PortfolioPermission> permissions =
View Full Code Here

  }

  private DependencyGraph createDependencyGraph() {
    final DependencyGraph graph = new DependencyGraph("Default");
    final ValueProperties properties = ValueProperties.with(ValuePropertyNames.FUNCTION, "Mock").get();
    final ComputationTarget t1 = new ComputationTarget(ComputationTargetType.PORTFOLIO_NODE, new SimplePortfolioNode(UniqueId.of("Node", "0"), "node"));
    final DependencyNode n1 = new DependencyNode(t1.toSpecification());
    n1.setFunction(new MockFunction("F1", t1));
    n1.addOutputValue(new ValueSpecification("Foo", t1.toSpecification(), properties));
    n1.addTerminalOutputValue(new ValueSpecification("Foo", t1.toSpecification(), properties));
    graph.addDependencyNode(n1);
View Full Code Here

    return context;
  }

  private FunctionRepository createFunctionRepository() {
    final InMemoryFunctionRepository functions = new InMemoryFunctionRepository();
    functions.addFunction(new MockFunction("F1", new ComputationTarget(ComputationTargetType.PORTFOLIO_NODE, new SimplePortfolioNode(UniqueId.of("Node", "0"), "node"))));
    functions.addFunction(new MockFunction("F2", new ComputationTarget(ComputationTargetType.POSITION, new SimplePosition(UniqueId.of("Pos", "0"), BigDecimal.ONE, ExternalId.of("Security", "Foo")))));
    functions.addFunction(new MockFunction("F3", new ComputationTarget(ComputationTargetType.SECURITY, createSecurity(UniqueId.of("Pos", "0"), ExternalId.of("Security", "Foo")))));
    return functions;
  }
View Full Code Here

    return new TargetResolverPortfolioNode(resolver, this);
  }

  @Override
  protected SimplePortfolioNode simpleObject() {
    return new SimplePortfolioNode(this);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.core.position.impl.SimplePortfolioNode

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.