java.lang.Object | ||
↳ | TestCase | |
↳ | org.joda.time.field.TestUnsupportedDateTimeField |
This class is a JUnit test to test only the UnsupportedDateTimeField class. This set of test cases exercises everything described in the Javadoc for this class.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
As this is an unsupported date/time field, some normal methods will
always return false, as they are not supported.
| |||||||||||
As this is an unsupported date/time field, many normal methods are
unsupported.
| |||||||||||
This test exercises the logic in UnsupportedDateTimeField.getInstance.
| |||||||||||
According to the JavaDocs, there are two methods that should always
return null.
| |||||||||||
Passing null values into UnsupportedDateTimeField.getInstance() should
throw an IllegalArguementsException
| |||||||||||
The getName() method should return the same value as the getName() method
of the DateTimeFieldType that was used to create the instance.
| |||||||||||
The toString method should return a suitable debug message (not null).
| |||||||||||
As this is an unsupported date/time field, many normal methods are
unsupported and throw an UnsupportedOperationException.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
As this is an unsupported date/time field, some normal methods will always return false, as they are not supported. Verify that each method correctly returns null.
As this is an unsupported date/time field, many normal methods are unsupported. Some delegate and can possibly throw an UnsupportedOperationException or have a valid return. Verify that each method correctly throws this exception when appropriate and delegates correctly based on the Duration used to get the instance.
This test exercises the logic in UnsupportedDateTimeField.getInstance. If getInstance() is invoked twice with: - the same DateTimeFieldType - different duration fields Then the field returned in the first invocation should not be equal to the field returned by the second invocation. In otherwords, the generated instance should be the same for a unique pairing of DateTimeFieldType/DurationField
According to the JavaDocs, there are two methods that should always return null. * getRangeDurationField() * getLeapDurationField() Ensure that these are in fact null.
Passing null values into UnsupportedDateTimeField.getInstance() should throw an IllegalArguementsException
The getName() method should return the same value as the getName() method of the DateTimeFieldType that was used to create the instance.
The toString method should return a suitable debug message (not null). Ensure that the toString method returns a string with length greater than 0 (and not null)
As this is an unsupported date/time field, many normal methods are unsupported and throw an UnsupportedOperationException. Verify that each method correctly throws this exception. * add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) * addWrapField(long instant, int value) * addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) * addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) * get(long instant) * getAsShortText(int fieldValue, Locale locale) * getAsShortText(long instant) * getAsShortText(long instant, Locale locale) * getAsShortText(ReadablePartial partial, int fieldValue, Locale locale) * getAsShortText(ReadablePartial partial, Locale locale) * getAsText(int fieldValue, Locale locale) * getAsText(long instant) * getAsText(long instant, Locale locale) * getAsText(ReadablePartial partial, int fieldValue, Locale locale) * getAsText(ReadablePartial partial, Locale locale) * getLeapAmount(long instant) * getMaximumShortTextLength(Locale locale) * getMaximumTextLength(Locale locale) * getMaximumValue() * getMaximumValue(long instant) * getMaximumValue(ReadablePartial instant) * getMaximumValue(ReadablePartial instant, int[] values) * getMinimumValue() * getMinimumValue(long instant) * getMinimumValue(ReadablePartial instant) * getMinimumValue(ReadablePartial instant, int[] values) * isLeap(long instant) * remainder(long instant) * roundCeiling(long instant) * roundFloor(long instant) * roundHalfCeiling(long instant) * roundHalfEven(long instant) * roundHalfFloor(long instant) * set(long instant, int value) * set(long instant, String text) * set(long instant, String text, Locale locale) * set(ReadablePartial instant, int fieldIndex, int[] values, int newValue) * set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale)