Package com.opengamma.master.holiday

Examples of com.opengamma.master.holiday.HolidaySearchRequest


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

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_search_holidayIds_badSchemeValidOid() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.addHolidayObjectId(ObjectId.of("Rubbish", "120"));
    _holMaster.search(request);
  }
View Full Code Here


  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_versionAsOf_below() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.setVersionCorrection(VersionCorrection.ofVersionAsOf(_version1Instant.minusSeconds(5)));
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

    assertEquals(0, test.getDocuments().size());
  }

  @Test
  public void test_search_versionAsOf_mid() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.setVersionCorrection(VersionCorrection.ofVersionAsOf(_version1Instant.plusSeconds(5)));
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(3, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
View Full Code Here

    assert201(test.getDocuments().get(2))// old version
  }

  @Test
  public void test_search_versionAsOf_above() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.setVersionCorrection(VersionCorrection.ofVersionAsOf(_version2Instant.plusSeconds(5)));
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(3, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_searchHolidays_documents() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(1, test.getPaging().getFirstItemOneBased());
    assertEquals(Integer.MAX_VALUE, test.getPaging().getPagingSize());
    assertEquals(_totalHolidays, test.getPaging().getTotalItems());
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_pageOne() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.setPagingRequest(PagingRequest.ofPage(1, 2));
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(1, test.getPaging().getFirstItemOneBased());
    assertEquals(2, test.getPaging().getPagingSize());
    assertEquals(_totalHolidays, test.getPaging().getTotalItems());
View Full Code Here

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

  @Test
  public void test_search_pageTwo() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.setPagingRequest(PagingRequest.ofPage(2, 2));
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(3, test.getPaging().getFirstItemOneBased());
    assertEquals(2, test.getPaging().getPagingSize());
    assertEquals(_totalHolidays, test.getPaging().getTotalItems());
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_name_noMatch() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.setName("FooBar");
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

    assertEquals(0, test.getDocuments().size());
  }

  @Test
  public void test_search_name() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.setName("TestHoliday102");
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert102(test.getDocuments().get(0));
  }
View Full Code Here

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

  @Test
  public void test_search_name_case() {
    HolidaySearchRequest request = new HolidaySearchRequest();
    request.setName("TESTHoliday102");
    HolidaySearchResult test = _holMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert102(test.getDocuments().get(0));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.holiday.HolidaySearchRequest

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.