コード例 #1
0
 // -------------------------------------------------------------------------
 public void test_builder_ensureDefaults() {
   ResetSchedule test =
       ResetSchedule.builder()
           .resetFrequency(P1M)
           .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO))
           .build();
   assertEquals(test.getResetFrequency(), P1M);
   assertEquals(test.getBusinessDayAdjustment(), BusinessDayAdjustment.of(FOLLOWING, GBLO));
   assertEquals(test.getResetMethod(), UNWEIGHTED);
 }
コード例 #2
0
 // -------------------------------------------------------------------------
 public void coverage() {
   ResetSchedule test =
       ResetSchedule.builder()
           .resetFrequency(P1M)
           .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO))
           .build();
   coverImmutableBean(test);
   ResetSchedule test2 =
       ResetSchedule.builder()
           .resetFrequency(P3M)
           .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO))
           .resetMethod(WEIGHTED)
           .build();
   coverBeanEquals(test, test2);
 }
コード例 #3
0
 public void test_serialization() {
   ResetSchedule test =
       ResetSchedule.builder()
           .resetFrequency(P1M)
           .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO))
           .build();
   assertSerialization(test);
 }
コード例 #4
0
 // -------------------------------------------------------------------------
 public void test_resolve() {
   ResetSchedule test =
       ResetSchedule.builder()
           .resetFrequency(P1M)
           .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO))
           .build();
   SchedulePeriod accrualPeriod =
       SchedulePeriod.of(DATE_01_06, DATE_04_07, DATE_01_05, DATE_04_05);
   Schedule schedule = test.createSchedule(DAY_5, REF_DATA).apply(accrualPeriod);
   Schedule expected =
       Schedule.builder()
           .periods(
               SchedulePeriod.of(DATE_01_06, DATE_02_05, DATE_01_05, DATE_02_05),
               SchedulePeriod.of(DATE_02_05, DATE_03_05, DATE_02_05, DATE_03_05),
               SchedulePeriod.of(DATE_03_05, DATE_04_07, DATE_03_05, DATE_04_05))
           .frequency(P1M)
           .rollConvention(DAY_5)
           .build();
   assertEquals(schedule, expected);
 }