org.apache.myfaces.trinidad.convert
Class DateTimeConverterTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jmock.core.VerifyingTestCase
              extended by org.jmock.core.MockObjectSupportTestCase
                  extended by org.jmock.MockObjectTestCase
                      extended by org.jmock.cglib.MockObjectTestCase
                          extended by org.apache.shale.test.jmock.AbstractJmockJsfTestCase
                              extended by org.apache.myfaces.trinidadbuild.test.AbstractBaseTestCase
                                  extended by org.apache.myfaces.trinidad.convert.ConverterTestCase
                                      extended by org.apache.myfaces.trinidad.convert.DateTimeConverterTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
JsfDateTimeConverterTest, TrinidadDateTimeConverterTest

public abstract class DateTimeConverterTestCase
extends ConverterTestCase

Test DateTimeConverter

Version:
$Name: $ ($version: $) $Date: 16-aug-2005.15:12:23 $

Field Summary
protected static int _DATE_STYLE
           
protected static int _TIME_STYLE
           
 
Fields inherited from class org.apache.shale.test.jmock.AbstractJmockJsfTestCase
application, config, externalContext, facesContext, facesContextFactory, lifecycle, lifecycleFactory, renderKit, request, response, servletContext, session
 
Fields inherited from class org.jmock.core.MockObjectSupportTestCase
ANYTHING, NOT_NULL, NULL
 
Constructor Summary
DateTimeConverterTestCase(String testName)
           
 
Method Summary
protected  void checkConversionOnLongPatternWithTimeZone()
           
protected  void checkDatesForPatternBasedChecks()
           
protected  void checkDateStyleValidity()
           
protected  void checkEquals()
          Test for equality of converters
protected  void checkGetAsObject()
           
protected  void checkNullComponent()
           
protected  void checkNullContext()
          Test when context is set to null
protected  void checkNullInputValue()
          Tests that null returns immediately.
protected  void checkStateHolderSaveRestore()
          Tests that dates after the date range cause a ValidationException.
protected  void checkTimeStyleValidity()
           
protected  void doTestStyleValidity(int styleType, String[] styles)
           
protected abstract  javax.faces.convert.DateTimeConverter getDateTimeConverter()
           
protected static TimeZone getTzone(String timeZoneId)
           
protected static boolean isEqual(Date convDate, Date expectedDate)
           
protected abstract  void setSecondaryPattern(javax.faces.convert.DateTimeConverter converter, String secondaryPattern)
           
 void testCommonScenarios()
           
 
Methods inherited from class org.apache.myfaces.trinidad.convert.ConverterTestCase
doTestBlankValue, doTestEquals, doTestGetAsObject, doTestGetAsString, doTestNull, doTestNullComponent, doTestNullContext, doTestStateHolderSaveRestore, equals
 
Methods inherited from class org.apache.myfaces.trinidadbuild.test.AbstractBaseTestCase
buildMockUIComponent, buildMockUIComponent, buildMockUIComponent, setFacesContext, setUp, tearDown
 
Methods inherited from class org.jmock.cglib.MockObjectTestCase
mock, mock, newCoreMock, newCoreMock
 
Methods inherited from class org.jmock.MockObjectTestCase
atLeastOnce, atMostOnce, defaultMockNameForType, doAll, doAll, doAll, doAll, exactly, mock, mock, never, never, newDummy, newDummy, newDummy, once, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, returnIterator, returnIterator, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, throwException
 
Methods inherited from class org.jmock.core.MockObjectSupportTestCase
and, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, collectionContaining, collectionContaining, compatibleType, contains, endsWith, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, hasProperty, hasProperty, isA, isIn, isIn, mapContaining, mapContaining, mapWithKey, mapWithKey, mapWithValue, mapWithValue, not, or, same, startsWith, stringContains, toString
 
Methods inherited from class org.jmock.core.VerifyingTestCase
registerToVerify, runBare, unregisterToVerify, verify
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_TIME_STYLE

protected static final int _TIME_STYLE
See Also:
Constant Field Values

_DATE_STYLE

protected static final int _DATE_STYLE
See Also:
Constant Field Values
Constructor Detail

DateTimeConverterTestCase

public DateTimeConverterTestCase(String testName)
Method Detail

testCommonScenarios

public void testCommonScenarios()

checkNullInputValue

protected void checkNullInputValue()
                            throws javax.faces.convert.ConverterException
Tests that null returns immediately.

Throws:
javax.faces.convert.ConverterException - when test fails

checkNullContext

protected void checkNullContext()
Test when context is set to null


checkNullComponent

protected void checkNullComponent()

checkEquals

protected void checkEquals()
Test for equality of converters


checkStateHolderSaveRestore

protected void checkStateHolderSaveRestore()
Tests that dates after the date range cause a ValidationException.


checkGetAsObject

protected void checkGetAsObject()

checkConversionOnLongPatternWithTimeZone

protected void checkConversionOnLongPatternWithTimeZone()

checkDatesForPatternBasedChecks

protected void checkDatesForPatternBasedChecks()

checkDateStyleValidity

protected void checkDateStyleValidity()

checkTimeStyleValidity

protected void checkTimeStyleValidity()

doTestStyleValidity

protected void doTestStyleValidity(int styleType,
                                   String[] styles)

getDateTimeConverter

protected abstract javax.faces.convert.DateTimeConverter getDateTimeConverter()

setSecondaryPattern

protected abstract void setSecondaryPattern(javax.faces.convert.DateTimeConverter converter,
                                            String secondaryPattern)

getTzone

protected static TimeZone getTzone(String timeZoneId)

isEqual

protected static boolean isEqual(Date convDate,
                                 Date expectedDate)
Parameters:
convDate -
expectedDate -
Returns:


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.