Examples of HolidayDocument


Examples of com.opengamma.master.holiday.HolidayDocument

    _holMaster.add(null);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_add_noHoliday() {
    HolidayDocument doc = new HolidayDocument();
    _holMaster.add(doc);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test
  public void test_add_add_currency() {
    Instant now = Instant.now(_holMaster.getClock());
   
    ManageableHoliday holiday = new ManageableHoliday(Currency.USD, Arrays.asList(LocalDate.of(2010, 6, 9)));
    HolidayDocument doc = new HolidayDocument(holiday);
    String name = doc.getName();
    HolidayDocument test = _holMaster.add(doc);
   
    UniqueId uniqueId = test.getUniqueId();
    assertNotNull(uniqueId);
    assertEquals("DbHol", uniqueId.getScheme());
    assertTrue(uniqueId.isVersioned());
    assertTrue(Long.parseLong(uniqueId.getValue()) >= 1000);
    assertEquals("0", uniqueId.getVersion());
    assertEquals(now, test.getVersionFromInstant());
    assertEquals(null, test.getVersionToInstant());
    assertEquals(now, test.getCorrectionFromInstant());
    assertEquals(null, test.getCorrectionToInstant());
    ManageableHoliday testHoliday = test.getHoliday();
    assertNotNull(testHoliday);
    assertEquals(uniqueId, testHoliday.getUniqueId());
    assertEquals(name, test.getName());
    assertEquals(HolidayType.CURRENCY, testHoliday.getType());
    assertEquals("USD", testHoliday.getCurrency().getCode());
    assertEquals(null, testHoliday.getRegionExternalId());
    assertEquals(null, testHoliday.getExchangeExternalId());
    assertEquals(Arrays.asList(LocalDate.of(2010, 6, 9)), testHoliday.getHolidayDates());
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test
  public void test_add_add_bank() {
    Instant now = Instant.now(_holMaster.getClock());
   
    ManageableHoliday holiday = new ManageableHoliday(HolidayType.BANK, ExternalId.of("A", "B"), Arrays.asList(LocalDate.of(2010, 6, 9)));
    HolidayDocument doc = new HolidayDocument(holiday);
    String name = doc.getName();
    HolidayDocument test = _holMaster.add(doc);
   
    UniqueId uniqueId = test.getUniqueId();
    assertNotNull(uniqueId);
    assertEquals("DbHol", uniqueId.getScheme());
    assertTrue(uniqueId.isVersioned());
    assertTrue(Long.parseLong(uniqueId.getValue()) >= 1000);
    assertEquals("0", uniqueId.getVersion());
    assertEquals(now, test.getVersionFromInstant());
    assertEquals(null, test.getVersionToInstant());
    assertEquals(now, test.getCorrectionFromInstant());
    assertEquals(null, test.getCorrectionToInstant());
    ManageableHoliday testHoliday = test.getHoliday();
    assertNotNull(testHoliday);
    assertEquals(uniqueId, testHoliday.getUniqueId());
    assertEquals(name, test.getName());
    assertEquals(HolidayType.BANK, testHoliday.getType());
    assertEquals(null, testHoliday.getCurrency());
    assertEquals(ExternalId.of("A", "B"), testHoliday.getRegionExternalId());
    assertEquals(null, testHoliday.getExchangeExternalId());
    assertEquals(Arrays.asList(LocalDate.of(2010, 6, 9)), testHoliday.getHolidayDates());
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test
  public void test_add_add_settlement() {
    Instant now = Instant.now(_holMaster.getClock());
   
    ManageableHoliday holiday = new ManageableHoliday(HolidayType.SETTLEMENT, ExternalId.of("A", "B"), Arrays.asList(LocalDate.of(2010, 6, 9)));
    HolidayDocument doc = new HolidayDocument(holiday);
    String name = doc.getName();
    HolidayDocument test = _holMaster.add(doc);
   
    UniqueId uniqueId = test.getUniqueId();
    assertNotNull(uniqueId);
    assertEquals("DbHol", uniqueId.getScheme());
    assertTrue(uniqueId.isVersioned());
    assertTrue(Long.parseLong(uniqueId.getValue()) >= 1000);
    assertEquals("0", uniqueId.getVersion());
    assertEquals(now, test.getVersionFromInstant());
    assertEquals(null, test.getVersionToInstant());
    assertEquals(now, test.getCorrectionFromInstant());
    assertEquals(null, test.getCorrectionToInstant());
    ManageableHoliday testHoliday = test.getHoliday();
    assertNotNull(testHoliday);
    assertEquals(uniqueId, testHoliday.getUniqueId());
    assertEquals(name, test.getName());
    assertEquals(HolidayType.SETTLEMENT, testHoliday.getType());
    assertEquals(null, testHoliday.getCurrency());
    assertEquals(null, testHoliday.getRegionExternalId());
    assertEquals(ExternalId.of("A", "B"), testHoliday.getExchangeExternalId());
    assertEquals(Arrays.asList(LocalDate.of(2010, 6, 9)), testHoliday.getHolidayDates());
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  @Test
  public void test_add_add_trading() {
    Instant now = Instant.now(_holMaster.getClock());
   
    ManageableHoliday holiday = new ManageableHoliday(HolidayType.TRADING, ExternalId.of("A", "B"), Arrays.asList(LocalDate.of(2010, 6, 9)));
    HolidayDocument doc = new HolidayDocument(holiday);
    String name = doc.getName();
    HolidayDocument test = _holMaster.add(doc);
   
    UniqueId uniqueId = test.getUniqueId();
    assertNotNull(uniqueId);
    assertEquals("DbHol", uniqueId.getScheme());
    assertTrue(uniqueId.isVersioned());
    assertTrue(Long.parseLong(uniqueId.getValue()) >= 1000);
    assertEquals("0", uniqueId.getVersion());
    assertEquals(now, test.getVersionFromInstant());
    assertEquals(null, test.getVersionToInstant());
    assertEquals(now, test.getCorrectionFromInstant());
    assertEquals(null, test.getCorrectionToInstant());
    ManageableHoliday testHoliday = test.getHoliday();
    assertNotNull(testHoliday);
    assertEquals(uniqueId, testHoliday.getUniqueId());
    assertEquals(name, test.getName());
    assertEquals(HolidayType.TRADING, testHoliday.getType());
    assertEquals(null, testHoliday.getCurrency());
    assertEquals(null, testHoliday.getRegionExternalId());
    assertEquals(ExternalId.of("A", "B"), testHoliday.getExchangeExternalId());
    assertEquals(Arrays.asList(LocalDate.of(2010, 6, 9)), testHoliday.getHolidayDates());
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  }

  @Test
  public void test_add_addThenGet() {
    ManageableHoliday holiday = new ManageableHoliday(Currency.USD, Arrays.asList(LocalDate.of(2010, 6, 9)));
    HolidayDocument doc = new HolidayDocument(holiday);
    HolidayDocument added = _holMaster.add(doc);
   
    HolidayDocument test = _holMaster.get(added.getUniqueId());
    assertEquals(added, test);
  }
View Full Code Here

Examples of com.opengamma.master.holiday.HolidayDocument

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_add_addWithMissingTypeProperty() {
    ManageableHoliday holiday = new ManageableHoliday();
    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_addBankWithMinimalProperties() {
    ManageableHoliday holiday = new ManageableHoliday();
    holiday.setType(HolidayType.BANK);
    holiday.setRegionExternalId(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_addBankWithMissingRegionProperty() {
    ManageableHoliday holiday = new ManageableHoliday();
    holiday.setType(HolidayType.BANK);
    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_addCurrencyWithMinimalProperties() {
    ManageableHoliday holiday = new ManageableHoliday();
    holiday.setType(HolidayType.CURRENCY);
    holiday.setCurrency(Currency.USD);
    HolidayDocument doc = new HolidayDocument();
    doc.setName("Test");
    doc.setHoliday(holiday);
    _holMaster.add(doc);
  }
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.