public class TimeValidatorTest extends junit.framework.TestCase
| Modifier and Type | Field and Description |
|---|---|
protected static TimeZone |
EST |
protected static TimeZone |
GMT |
protected Date[] |
localeExpect |
protected String[] |
localeInvalid |
protected String[] |
localeValid |
protected Date[] |
patternExpect |
protected String[] |
patternInvalid |
protected String[] |
patternValid |
protected org.apache.commons.validator.routines.TimeValidator |
validator |
| Constructor and Description |
|---|
TimeValidatorTest(String name)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected static Date |
createDate(TimeZone zone,
int time,
int millisecond)
Create a date instance for a specified time zone, date and time.
|
protected static Calendar |
createTime(TimeZone zone,
int time,
int millisecond)
Create a calendar instance for a specified time zone, date and time.
|
protected void |
setUp() |
protected void |
tearDown()
Tear down
|
void |
testCompare()
Test compare date methods
|
void |
testFormat()
Test Invalid Dates with "locale" validation
|
void |
testLocaleInvalid()
Test Invalid Dates with "locale" validation
|
void |
testLocaleValid()
Test Valid Dates with "locale" validation
|
void |
testPatternInvalid()
Test Invalid Dates with "pattern" validation
|
void |
testPatternValid()
Test Valid Dates with "pattern" validation
|
void |
testTimeZone()
Test time zone methods.
|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toStringassertEquals, 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, failSameprotected org.apache.commons.validator.routines.TimeValidator validator
protected String[] patternValid
protected Date[] patternExpect
protected String[] localeValid
protected Date[] localeExpect
protected String[] patternInvalid
protected String[] localeInvalid
public TimeValidatorTest(String name)
name - test nameprotected void setUp() throws Exception
setUp in class junit.framework.TestCaseExceptionprotected void tearDown() throws Exception
tearDown in class junit.framework.TestCaseExceptionpublic void testPatternValid()
public void testPatternInvalid()
public void testLocaleValid()
public void testLocaleInvalid()
public void testTimeZone()
public void testFormat()
public void testCompare()
protected static Calendar createTime(TimeZone zone, int time, int millisecond)
zone - The time zonetime - the time in HH:mm:ss formatmillisecond - the millisecondsprotected static Date createDate(TimeZone zone, int time, int millisecond)
zone - The time zonetime - the time in HH:mm:ss formatmillisecond - the millisecondsCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.