Package com.opengamma.master.user

Examples of com.opengamma.master.user.UserHistoryResult


  //-------------------------------------------------------------------------
  @Test
  public void test_history_documents() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    UserHistoryRequest request = new UserHistoryRequest(oid);
    UserHistoryResult test = _usrMaster.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_documentCountWhenMultipleUsers() {
    ObjectId oid = ObjectId.of("DbUsr", "102");
    UserHistoryRequest request = new UserHistoryRequest(oid);
    UserHistoryResult test = _usrMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
   
    assertEquals(1, test.getDocuments().size());
    assert102(test.getDocuments().get(0));
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Test
  public void test_history_noInstants() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    UserHistoryRequest request = new UserHistoryRequest(oid);
    UserHistoryResult test = _usrMaster.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() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    PagingRequest pr = PagingRequest.ofPage(1, 1);
    UserHistoryRequest request = new UserHistoryRequest(oid);
    request.setPagingRequest(pr);
    UserHistoryResult test = _usrMaster.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() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    PagingRequest pr = PagingRequest.ofPage(2, 1);
    UserHistoryRequest request = new UserHistoryRequest(oid);
    request.setPagingRequest(pr);
    UserHistoryResult test = _usrMaster.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() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    UserHistoryRequest request = new UserHistoryRequest(oid);
    request.setVersionsFromInstant(_version1Instant.minusSeconds(5));
    UserHistoryResult test = _usrMaster.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() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    UserHistoryRequest request = new UserHistoryRequest(oid);
    request.setVersionsFromInstant(_version1Instant.plusSeconds(5));
    UserHistoryResult test = _usrMaster.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() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    UserHistoryRequest request = new UserHistoryRequest(oid);
    request.setVersionsFromInstant(_version2Instant.plusSeconds(5));
    UserHistoryResult test = _usrMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
   
    assertEquals(1, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_history_versionsTo_preFirst() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    UserHistoryRequest request = new UserHistoryRequest(oid);
    request.setVersionsToInstant(_version1Instant.minusSeconds(5));
    UserHistoryResult test = _usrMaster.history(request);
   
    assertEquals(0, test.getPaging().getTotalItems());
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  @Test
  public void test_history_versionsTo_firstToSecond() {
    ObjectId oid = ObjectId.of("DbUsr", "201");
    UserHistoryRequest request = new UserHistoryRequest(oid);
    request.setVersionsToInstant(_version1Instant.plusSeconds(5));
    UserHistoryResult test = _usrMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
   
    assertEquals(1, test.getDocuments().size());
    assert201(test.getDocuments().get(0));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.user.UserHistoryResult

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.