public class

TestUnsupportedDateTimeField

extends TestCase
java.lang.Object
   ↳ TestCase
     ↳ org.joda.time.field.TestUnsupportedDateTimeField

Class Overview

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.

Summary

Public Constructors
TestUnsupportedDateTimeField()
Public Methods
static TestSuite suite()
void testAlwaysFalseReturnTypes()
As this is an unsupported date/time field, some normal methods will always return false, as they are not supported.
void testDelegatedMethods()
As this is an unsupported date/time field, many normal methods are unsupported.
void testDifferentDurationReturnDifferentObjects()
This test exercises the logic in UnsupportedDateTimeField.getInstance.
void testMethodsThatShouldAlwaysReturnNull()
According to the JavaDocs, there are two methods that should always return null.
void testNullValuesToGetInstanceThrowsException()
Passing null values into UnsupportedDateTimeField.getInstance() should throw an IllegalArguementsException
void testPublicGetNameMethod()
The getName() method should return the same value as the getName() method of the DateTimeFieldType that was used to create the instance.
void testToString()
The toString method should return a suitable debug message (not null).
void testUnsupportedMethods()
As this is an unsupported date/time field, many normal methods are unsupported and throw an UnsupportedOperationException.
Protected Methods
void setUp()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TestUnsupportedDateTimeField ()

Public Methods

public static TestSuite suite ()

public void testAlwaysFalseReturnTypes ()

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.

public void testDelegatedMethods ()

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.

public void testDifferentDurationReturnDifferentObjects ()

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

public void testMethodsThatShouldAlwaysReturnNull ()

According to the JavaDocs, there are two methods that should always return null. * getRangeDurationField() * getLeapDurationField() Ensure that these are in fact null.

public void testNullValuesToGetInstanceThrowsException ()

Passing null values into UnsupportedDateTimeField.getInstance() should throw an IllegalArguementsException

public void testPublicGetNameMethod ()

The getName() method should return the same value as the getName() method of the DateTimeFieldType that was used to create the instance.

public void testToString ()

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)

public void testUnsupportedMethods ()

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)

Protected Methods

protected void setUp ()

Throws
Exception