Examples of HolidayDocument


Examples of com.opengamma.master.holiday.HolidayDocument

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_add_addCurrencyWithMissingCurrencyProperty() {
    ManageableHoliday holiday = new ManageableHoliday();
    holiday.setType(HolidayType.CURRENCY);
    HolidayDocument doc = new HolidayDocument();
    doc.setName("Test");
    doc.setHoliday(holiday);
    _holMaster.add(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test
  public void test_add_addSettlementWithMinimalProperties() {
    ManageableHoliday holiday = new ManageableHoliday();
    holiday.setType(HolidayType.SETTLEMENT);
    holiday.setExchangeExternalId(ExternalId.of("A", "B"));
    HolidayDocument doc = new HolidayDocument();
    doc.setName("Test");
    doc.setHoliday(holiday);
    _holMaster.add(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_add_addSettlementWithMissingExchangeProperty() {
    ManageableHoliday holiday = new ManageableHoliday();
    holiday.setType(HolidayType.SETTLEMENT);
    HolidayDocument doc = new HolidayDocument();
    doc.setName("Test");
    doc.setHoliday(holiday);
    _holMaster.add(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test
  public void test_add_addTradingWithMinimalProperties() {
    ManageableHoliday holiday = new ManageableHoliday();
    holiday.setType(HolidayType.TRADING);
    holiday.setExchangeExternalId(ExternalId.of("A", "B"));
    HolidayDocument doc = new HolidayDocument();
    doc.setName("Test");
    doc.setHoliday(holiday);
    _holMaster.add(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_add_addTradingWithMissingExchangeProperty() {
    ManageableHoliday holiday = new ManageableHoliday();
    holiday.setType(HolidayType.TRADING);
    HolidayDocument doc = new HolidayDocument();
    doc.setName("Test");
    doc.setHoliday(holiday);
    _holMaster.add(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  //-------------------------------------------------------------------------
  @Test
  public void test_example() throws Exception {
    ManageableHoliday hol = new ManageableHoliday(Currency.GBP, Arrays.asList(LocalDate.of(2010, 2, 3)));
    HolidayDocument addDoc = new HolidayDocument(hol);
    HolidayDocument added = _holMaster.add(addDoc);
   
    HolidayDocument loaded = _holMaster.get(added.getUniqueId());
    assertEquals(added, loaded);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_correct_noHolidayId() {
    UniqueId uniqueId = UniqueId.of("DbHol", "101");
    ManageableHoliday holiday = new ManageableHoliday(Currency.USD, Arrays.asList(LocalDate.of(2010, 6, 9)));
    holiday.setUniqueId(uniqueId);
    HolidayDocument doc = new HolidayDocument(holiday);
    doc.setUniqueId(null);
    _holMaster.correct(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

    _holMaster.correct(doc);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_correct_noHoliday() {
    HolidayDocument doc = new HolidayDocument();
    doc.setUniqueId(UniqueId.of("DbHol", "101", "0"));
    _holMaster.correct(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test(expectedExceptions = DataNotFoundException.class)
  public void test_correct_notFound() {
    UniqueId uniqueId = UniqueId.of("DbHol", "0", "0");
    ManageableHoliday holiday = new ManageableHoliday(Currency.USD, Arrays.asList(LocalDate.of(2010, 6, 9)));
    holiday.setUniqueId(uniqueId);
    HolidayDocument doc = new HolidayDocument(holiday);
    _holMaster.correct(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test
  public void test_correct_getUpdateGet() {
    Instant now = Instant.now(_holMaster.getClock());
   
    UniqueId uniqueId = UniqueId.of("DbHol", "101", "0");
    HolidayDocument base = _holMaster.get(uniqueId);
    ManageableHoliday holiday = new ManageableHoliday(Currency.USD, Arrays.asList(LocalDate.of(2010, 6, 9)));
    holiday.setUniqueId(uniqueId);
    HolidayDocument input = new HolidayDocument(holiday);
   
    HolidayDocument corrected = _holMaster.correct(input);
    assertEquals(false, base.getUniqueId().equals(corrected.getUniqueId()));
    assertEquals(base.getVersionFromInstant(), corrected.getVersionFromInstant());
    assertEquals(base.getVersionToInstant(), corrected.getVersionToInstant());
    assertEquals(now, corrected.getCorrectionFromInstant());
    assertEquals(null, corrected.getCorrectionToInstant());
    assertEquals(input.getHoliday(), corrected.getHoliday());
   
    HolidayDocument old = _holMaster.get(UniqueId.of("DbHol", "101", "0"));
    assertEquals(base.getUniqueId(), old.getUniqueId());
    assertEquals(base.getVersionFromInstant(), old.getVersionFromInstant());
    assertEquals(base.getVersionToInstant(), old.getVersionToInstant());
    assertEquals(base.getCorrectionFromInstant(), old.getCorrectionFromInstant());
    assertEquals(now, old.getCorrectionToInstant())// old version ended
    assertEquals(base.getHoliday(), old.getHoliday());
   
    HolidayHistoryRequest search = new HolidayHistoryRequest(base.getUniqueId(), now, null);
    HolidayHistoryResult searchResult = _holMaster.history(search);
    assertEquals(2, searchResult.getDocuments().size());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.