Package com.opengamma.master.portfolio

Examples of com.opengamma.master.portfolio.PortfolioHistoryResult


  }

  //-------------------------------------------------------------------------
  @Override
  public PortfolioHistoryResult history(final PortfolioHistoryRequest request) {
    return doHistory(request, new PortfolioHistoryResult(), new PortfolioDocumentExtractor(true, true));
  }
View Full Code Here


  //-------------------------------------------------------------------------
  @Test
  public void test_history_documents_noInstants_node_depthZero() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertEquals(2, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
    assert201(test.getDocuments().get(1));
  }
View Full Code Here

  @Test
  public void test_history_documents_noInstants_node_depthOne() {
    UniqueId oid = UniqueId.of("DbPrt", "101");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setDepth(1);
    PortfolioHistoryResult test = _prtMaster.history(request);
    assert101(test.getDocuments().get(0), 1);
  }
View Full Code Here

  @Test
  public void test_history_documents_noInstants_node_maxDepth() {
    UniqueId oid = UniqueId.of("DbPrt", "101");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setDepth(-1);
    PortfolioHistoryResult test = _prtMaster.history(request);
    assert101(test.getDocuments().get(0), 999);
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Test
  public void test_history_noInstants() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertEquals(PagingRequest.ALL, test.getPaging().getRequest());
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(2, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
    assert201(test.getDocuments().get(1));
  }
View Full Code Here

  public void test_history_noInstants_pageOne() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PagingRequest pr = PagingRequest.ofPage(1, 1);
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setPagingRequest(pr);
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertEquals(pr, test.getPaging().getRequest());
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(1, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
  }
View Full Code Here

  public void test_history_noInstants_pageTwo() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PagingRequest pr = PagingRequest.ofPage(2, 1);
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setPagingRequest(pr);
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertNotNull(test);
    assertNotNull(test.getPaging());
    assertEquals(pr, test.getPaging().getRequest());
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertNotNull(test.getDocuments());
    assertEquals(1, test.getDocuments().size());
    assert201(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_history_versionsFrom_preFirst() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setVersionsFromInstant(_version1Instant.minusSeconds(5));
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(2, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
    assert201(test.getDocuments().get(1));
  }
View Full Code Here

  @Test
  public void test_history_versionsFrom_firstToSecond() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setVersionsFromInstant(_version1Instant.plusSeconds(5));
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(2, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
    assert201(test.getDocuments().get(1));
  }
View Full Code Here

  @Test
  public void test_history_versionsFrom_postSecond() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setVersionsFromInstant(_version2Instant.plusSeconds(5));
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
   
    assertEquals(1, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
  }
View Full Code Here

TOP

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

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.