Package com.opengamma.master.position

Examples of com.opengamma.master.position.PositionHistoryResult


  //-------------------------------------------------------------------------
  @Test
  public void test_searchPositionHistoric_documents() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(2, test.getDocuments().size());
    assert222(test.getDocuments().get(0));
    assert221(test.getDocuments().get(1));
  }
View Full Code Here


  @Test
  public void test_searchPositionHistoric_documentCountWhenMultipleSecurities() {
    ObjectId oid = ObjectId.of("DbPos", "121");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
    assertEquals(1, test.getDocuments().size());
    assert121(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_searchPositionHistoric_documentCountWhenMultipleSecuritiesAndMultipleTrades() {
    ObjectId oid = ObjectId.of("DbPos", "123");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
    assertEquals(1, test.getDocuments().size());
    assert123(test.getDocuments().get(0));
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Test
  public void test_searchPositionHistoric_noInstants() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(1, test.getPaging().getFirstItemOneBased());
    assertEquals(Integer.MAX_VALUE, test.getPaging().getPagingSize());
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(2, test.getDocuments().size());
    assert222(test.getDocuments().get(0));
    assert221(test.getDocuments().get(1));
  }
View Full Code Here

  @Test
  public void test_searchPositionHistoric_noInstants_pageOne() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setPagingRequest(PagingRequest.ofPage(1, 1));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(1, test.getPaging().getFirstItemOneBased());
    assertEquals(1, test.getPaging().getPagingSize());
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(1, test.getDocuments().size());
    assert222(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_searchPositionHistoric_noInstants_pageTwo() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setPagingRequest(PagingRequest.ofPage(2, 1));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertNotNull(test);
    assertNotNull(test.getPaging());
    assertEquals(2, test.getPaging().getFirstItemOneBased());
    assertEquals(1, test.getPaging().getPagingSize());
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertNotNull(test.getDocuments());
    assertEquals(1, test.getDocuments().size());
    assert221(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_searchPositionHistoric_versionsFrom_preFirst() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setVersionsFromInstant(_version1Instant.minusSeconds(5));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(2, test.getDocuments().size());
    assert222(test.getDocuments().get(0));
    assert221(test.getDocuments().get(1));
  }
View Full Code Here

  @Test
  public void test_searchPositionHistoric_versionsFrom_firstToSecond() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setVersionsFromInstant(_version1Instant.plusSeconds(5));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(2, test.getPaging().getTotalItems());
   
    assertEquals(2, test.getDocuments().size());
    assert222(test.getDocuments().get(0));
    assert221(test.getDocuments().get(1));
  }
View Full Code Here

  @Test
  public void test_searchPositionHistoric_versionsFrom_postSecond() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setVersionsFromInstant(_version2Instant.plusSeconds(5));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
   
    assertEquals(1, test.getDocuments().size());
    assert222(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_searchPositionHistoric_versionsTo_preFirst() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setVersionsToInstant(_version1Instant.minusSeconds(5));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(0, test.getPaging().getTotalItems());
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.position.PositionHistoryResult

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.