Beispiel #1
0
 public void test_serialization() {
   IborIndex index =
       ImmutableIborIndex.builder()
           .name("OGIBOR")
           .currency(Currency.GBP)
           .fixingCalendar(GBLO)
           .fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, GBLO))
           .effectiveDateOffset(DaysAdjustment.ofBusinessDays(2, GBLO))
           .maturityDateOffset(
               TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.NONE))
           .dayCount(ACT_360)
           .build();
   assertSerialization(index);
 }
Beispiel #2
0
 // -------------------------------------------------------------------------
 public void coverage() {
   ImmutableIborIndex index =
       ImmutableIborIndex.builder()
           .name("OGIBOR")
           .currency(Currency.GBP)
           .fixingCalendar(GBLO)
           .fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, GBLO))
           .effectiveDateOffset(DaysAdjustment.ofBusinessDays(2, GBLO))
           .maturityDateOffset(
               TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.NONE))
           .dayCount(ACT_360)
           .build();
   coverImmutableBean(index);
   coverPrivateConstructor(IborIndices.class);
 }
Beispiel #3
0
 // -------------------------------------------------------------------------
 public void test_equals() {
   ImmutableIborIndex a =
       ImmutableIborIndex.builder()
           .name("OGIBOR")
           .currency(Currency.GBP)
           .fixingCalendar(GBLO)
           .fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, GBLO))
           .effectiveDateOffset(DaysAdjustment.ofBusinessDays(2, GBLO))
           .maturityDateOffset(
               TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.NONE))
           .dayCount(ACT_360)
           .build();
   IborIndex b = a.toBuilder().name("Rubbish").build();
   assertEquals(a.equals(b), false);
 }
Beispiel #4
0
 public void test_euibor3m() {
   IborIndex test = IborIndex.of("EUR-EURIBOR-3M");
   assertEquals(test.getCurrency(), EUR);
   assertEquals(test.getName(), "EUR-EURIBOR-3M");
   assertEquals(test.getTenor(), TENOR_3M);
   assertEquals(test.getFixingCalendar(), EUTA);
   assertEquals(test.getFixingDateOffset(), DaysAdjustment.ofBusinessDays(-2, EUTA));
   assertEquals(test.getEffectiveDateOffset(), DaysAdjustment.ofBusinessDays(2, EUTA));
   assertEquals(
       test.getMaturityDateOffset(),
       TenorAdjustment.ofLastBusinessDay(
           TENOR_3M, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)));
   assertEquals(test.getDayCount(), ACT_360);
   assertEquals(test.toString(), "EUR-EURIBOR-3M");
 }
Beispiel #5
0
 public void test_usdLibor3m() {
   IborIndex test = IborIndex.of("USD-LIBOR-3M");
   assertEquals(test.getCurrency(), USD);
   assertEquals(test.getName(), "USD-LIBOR-3M");
   assertEquals(test.getTenor(), TENOR_3M);
   assertEquals(test.getFixingCalendar(), GBLO);
   assertEquals(test.getFixingDateOffset(), DaysAdjustment.ofBusinessDays(-2, GBLO));
   assertEquals(
       test.getEffectiveDateOffset(),
       DaysAdjustment.ofBusinessDays(
           2, GBLO, BusinessDayAdjustment.of(FOLLOWING, GBLO.combineWith(USNY))));
   assertEquals(
       test.getMaturityDateOffset(),
       TenorAdjustment.ofLastBusinessDay(
           TENOR_3M, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO.combineWith(USNY))));
   assertEquals(test.getDayCount(), ACT_360);
   assertEquals(test.toString(), "USD-LIBOR-3M");
 }
Beispiel #6
0
 public void test_gbpLibor3m() {
   IborIndex test = IborIndex.of("GBP-LIBOR-3M");
   assertEquals(test.getCurrency(), GBP);
   assertEquals(test.getName(), "GBP-LIBOR-3M");
   assertEquals(test.getTenor(), TENOR_3M);
   assertEquals(test.getFixingCalendar(), GBLO);
   assertEquals(
       test.getFixingDateOffset(),
       DaysAdjustment.ofCalendarDays(0, BusinessDayAdjustment.of(PRECEDING, GBLO)));
   assertEquals(
       test.getEffectiveDateOffset(),
       DaysAdjustment.ofCalendarDays(0, BusinessDayAdjustment.of(FOLLOWING, GBLO)));
   assertEquals(
       test.getMaturityDateOffset(),
       TenorAdjustment.ofLastBusinessDay(
           TENOR_3M, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO)));
   assertEquals(test.getDayCount(), ACT_365F);
   assertEquals(test.toString(), "GBP-LIBOR-3M");
 }