Package com.opengamma.id

Examples of com.opengamma.id.UniqueId


    assert101(test.getDocuments().get(0), 1);
  }

  @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());
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  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);
   
View Full Code Here

    assert202(test.getDocuments().get(0));
  }

  @Test
  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);
   
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());
View Full Code Here

    assert201(test.getDocuments().get(1));
  }

  @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());
View Full Code Here

    assert201(test.getDocuments().get(1));
  }

  @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());
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_history_versionsTo_preFirst() {
    UniqueId oid = UniqueId.of("DbPrt", "201");
    PortfolioHistoryRequest request = new PortfolioHistoryRequest(oid);
    request.setVersionsToInstant(_version1Instant.minusSeconds(5));
    PortfolioHistoryResult test = _prtMaster.history(request);
   
    assertEquals(0, test.getPaging().getTotalItems());
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test(expectedExceptions = DataNotFoundException.class)
  public void test_removeConfig_versioned_notFound() {
    UniqueId uniqueId = UniqueId.of("DbCfg", "0", "0");
    _cfgMaster.remove(uniqueId);
  }
View Full Code Here

  @Test
  public void test_remove_removed() {
    Instant now = Instant.now(_cfgMaster.getClock());
   
    UniqueId uniqueId = UniqueId.of("DbCfg", "101", "0");
    _cfgMaster.remove(uniqueId);
    ConfigDocument test = _cfgMaster.get(uniqueId);
   
    assertEquals(uniqueId, test.getUniqueId());
    assertEquals(_version1aInstant, test.getVersionFromInstant());
View Full Code Here

TOP

Related Classes of com.opengamma.id.UniqueId

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.