コード例 #1
0
 // -----------------------------------------------------------------------
 public void test_constructor() {
   BaseDateTimeField field = new MockPreciseDurationDateTimeField();
   assertEquals(DateTimeFieldType.secondOfMinute(), field.getType());
   try {
     field = new MockPreciseDurationDateTimeField(null, null);
     fail();
   } catch (IllegalArgumentException ex) {
   }
   try {
     field =
         new MockPreciseDurationDateTimeField(
             DateTimeFieldType.minuteOfHour(),
             new MockImpreciseDurationField(DurationFieldType.minutes()));
     fail();
   } catch (IllegalArgumentException ex) {
   }
   try {
     field =
         new MockPreciseDurationDateTimeField(
             DateTimeFieldType.minuteOfHour(),
             new MockZeroDurationField(DurationFieldType.minutes()));
     fail();
   } catch (IllegalArgumentException ex) {
   }
 }
コード例 #2
0
 public void test_toString() {
   BaseDateTimeField field =
       new MockPreciseDurationDateTimeField(
           DateTimeFieldType.secondOfDay(),
           new MockCountingDurationField(DurationFieldType.minutes()));
   assertEquals("DateTimeField[secondOfDay]", field.toString());
 }
コード例 #3
0
 public void test_getName() {
   BaseDateTimeField field =
       new MockPreciseDurationDateTimeField(
           DateTimeFieldType.secondOfDay(),
           new MockCountingDurationField(DurationFieldType.minutes()));
   assertEquals("secondOfDay", field.getName());
 }
コード例 #4
0
 public DurationField getRangeDurationField() {
   return new MockCountingDurationField(DurationFieldType.minutes());
 }