| org.joda.time.field.TestUnsupportedDateTimeField
TestUnsupportedDateTimeField | public class TestUnsupportedDateTimeField extends TestCase (Code) | | 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.
author: Jeremy R. Rickard |
suite | public static TestSuite suite()(Code) | | |
testAlwaysFalseReturnTypes | public void testAlwaysFalseReturnTypes()(Code) | | 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.
|
testDelegatedMethods | public void testDelegatedMethods()(Code) | | 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.
|
testDifferentDurationReturnDifferentObjects | public void testDifferentDurationReturnDifferentObjects()(Code) | | 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
|
testMethodsThatShouldAlwaysReturnNull | public void testMethodsThatShouldAlwaysReturnNull()(Code) | | According to the JavaDocs, there are two methods that should always
return null. * getRangeDurationField() * getLeapDurationField()
Ensure that these are in fact null.
|
testNullValuesToGetInstanceThrowsException | public void testNullValuesToGetInstanceThrowsException()(Code) | | Passing null values into UnsupportedDateTimeField.getInstance() should
throw an IllegalArguementsException
|
testPublicGetNameMethod | public void testPublicGetNameMethod()(Code) | | The getName() method should return the same value as the getName() method
of the DateTimeFieldType that was used to create the instance.
|
testToString | public void testToString()(Code) | | 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)
|
testUnsupportedMethods | public void testUnsupportedMethods()(Code) | | 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)
|
|
|