Package com.opengamma.master.portfolio

Examples of com.opengamma.master.portfolio.PortfolioSearchRequest


    // We should get a position automatically generated for the trade
    String fileLocation = "src/test/resources/xml_portfolios/swaption_no_position.xml";
    File file = new File(fileLocation);
    new PortfolioLoader(_toolContext, "guff", null, file.getAbsolutePath(), true, false, false, false, true, true, null).execute();

    assertEquals(_portfolioMaster.search(new PortfolioSearchRequest()).getPortfolios().size(), 1);
    assertEquals(_positionMaster.search(new PositionSearchRequest()).getPositions().size(), 1);

    // We end up with 2 securities: the swaption itself, and its underlying swap
    assertEquals(_securityMaster.search(new SecuritySearchRequest()).getSecurities().size(), 2);
  }
View Full Code Here


    // We should get a position automatically generated for the trades
    String fileLocation = "src/test/resources/xml_portfolios/double_fx_option_no_position.xml";
    File file = new File(fileLocation);
    new PortfolioLoader(_toolContext, "guff", null, file.getAbsolutePath(), true, false, false, false, true, true, null).execute();

    assertEquals(_portfolioMaster.search(new PortfolioSearchRequest()).getPortfolios().size(), 1);
    assertEquals(_positionMaster.search(new PositionSearchRequest()).getPositions().size(), 2);
    assertEquals(_securityMaster.search(new SecuritySearchRequest()).getSecurities().size(), 2);
  }
View Full Code Here

    String fileLocation = "src/test/resources/xml_portfolios/triple_irs.xml";
    File file = new File(fileLocation);
    new PortfolioLoader(_toolContext, "guff", null, file.getAbsolutePath(), true, false, false, false, true, true, null).execute();

    assertEquals(_portfolioMaster.search(new PortfolioSearchRequest()).getPortfolios().size(), 1);
    assertEquals(_positionMaster.search(new PositionSearchRequest()).getPositions().size(), 3);
    assertEquals(_securityMaster.search(new SecuritySearchRequest()).getSecurities().size(), 3);
  }
View Full Code Here

  public void testNestedPortfolios() {
    String fileLocation = "src/test/resources/xml_portfolios/nested_portfolios.xml";
    File file = new File(fileLocation);
    new PortfolioLoader(_toolContext, "guff", null, file.getAbsolutePath(), true, false, false, false, true, true, null).execute();

    List<ManageablePortfolio> portfolios = _portfolioMaster.search(new PortfolioSearchRequest()).getPortfolios();
    assertEquals(portfolios.size(), 1);

    assertEquals(portfolios.get(0).getRootNode().getChildNodes().size(), 2);

    assertEquals(_positionMaster.search(new PositionSearchRequest()).getPositions().size(), 4);
View Full Code Here

    String fileLocation = "src/test/resources/xml_portfolios/position_defined_securities_portfolio.xml";
    File file = new File(fileLocation);
    new PortfolioLoader(_toolContext, "guff", null, file.getAbsolutePath(), true, false, false, false, true, true, null).execute();

    assertEquals(_portfolioMaster.search(new PortfolioSearchRequest()).getPortfolios().size(), 1);
    assertEquals(_positionMaster.search(new PositionSearchRequest()).getPositions().size(), 2);
    assertEquals(_securityMaster.search(new SecuritySearchRequest()).getSecurities().size(), 2);
  }
View Full Code Here

    String fileLocation = "src/test/resources/xml_portfolios/multi_portfolio.xml";
    File file = new File(fileLocation);
    new PortfolioLoader(_toolContext, "guff", null, file.getAbsolutePath(), true, false, false, false, true, true, null).execute();

    assertEquals(_portfolioMaster.search(new PortfolioSearchRequest()).getPortfolios().size(), 2);
    assertEquals(_positionMaster.search(new PositionSearchRequest()).getPositions().size(), 2);
    assertEquals(_securityMaster.search(new SecuritySearchRequest()).getSecurities().size(), 2);
  }
View Full Code Here

    String fileLocation = "src/test/resources/xml_portfolios/multitype_portfolio.xml";
    File file = new File(fileLocation);
    new PortfolioLoader(_toolContext, "guff", null, file.getAbsolutePath(), true, false, false, false, true, true, null).execute();

    assertEquals(_portfolioMaster.search(new PortfolioSearchRequest()).getPortfolios().size(), 1);
    assertEquals(_positionMaster.search(new PositionSearchRequest()).getPositions().size(), 2);
    Set<ManageableTrade> tradeSet = extractTrades(_positionMaster);
    assertEquals(tradeSet.size(), 2);
    assertEquals(_securityMaster.search(new SecuritySearchRequest()).getSecurities().size(), 2);
  }
View Full Code Here

    String fileLocation = "src/test/resources/xml_portfolios/double_portfolio_one_bad.xml";
    File file = new File(fileLocation);
    new PortfolioLoader(_toolContext, "guff", null, file.getAbsolutePath(), true, false, false, false, true, true, null).execute();

    // Only one of the portfolios should ,make it in
    assertEquals(_portfolioMaster.search(new PortfolioSearchRequest()).getPortfolios().size(), 1);
    assertEquals(_positionMaster.search(new PositionSearchRequest()).getPositions().size(), 1);
    assertEquals(_securityMaster.search(new SecuritySearchRequest()).getSecurities().size(), 1);
  }
View Full Code Here

    SecurityMaster securityMaster = new InMemorySecurityMaster();
    SecuritySource securitySource = new MasterSecuritySource(securityMaster);
   
    // Set up mock portfolio master
    PortfolioMaster portfolioMaster = mock(PortfolioMaster.class);
    PortfolioSearchRequest portSearchRequest = new PortfolioSearchRequest();
    portSearchRequest.setName(PORTFOLIO_NAME);
    PortfolioSearchResult portSearchResult = new PortfolioSearchResult();
    when(portfolioMaster.search(portSearchRequest)).thenReturn(portSearchResult);
    ManageablePortfolioNode rootNode = new ManageablePortfolioNode(PORTFOLIO_NAME);
    rootNode.setUniqueId(UniqueId.of("abc", "123"));
    ManageablePortfolio portfolio = new ManageablePortfolio(PORTFOLIO_NAME, rootNode);
View Full Code Here

TOP

Related Classes of com.opengamma.master.portfolio.PortfolioSearchRequest

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.