Java Doc for DateFormatTest.java in  » Internationalization-Localization » icu4j » com » ibm » icu » dev » test » format » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Internationalization Localization » icu4j » com.ibm.icu.dev.test.format 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.ibm.icu.dev.test.TestFmwk
   com.ibm.icu.dev.test.format.DateFormatTest

DateFormatTest
public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk (Code)


Field Summary
final static  StringDATEFORMAT_FIELD_NAMES
     A list of the names of all the fields in DateFormat.
final static  StringPATTERN_CHARS
     This MUST be kept in sync with DateFormatSymbols.patternChars.


Method Summary
public  voidTestBadInput135()
     Verify the correct behavior when handling invalid input strings.
public  voidTestBadInput135a()
     Verify the correct behavior when parsing an array of inputs against an array of patterns, with known results.
public  voidTestChineseDateFormatLocalizedPatternChars()
    
public  voidTestCoverage()
    
public  voidTestCzechMonths459()
     Verify the handling of Czech June and July, which have the unique attribute that one is a proper prefix substring of the other.
public  voidTestDateFormatCalendar()
    
public  voidTestDateFormatZone061()
     Test the formatting of time zones.
public  voidTestDateFormatZone146()
     Test the formatting of time zones.
public  voidTestDayOfYearPattern195()
     Test the day of year pattern.
public  voidTestEquals()
    
public  voidTestEras()
    
public  voidTestExactCountFormat()
     Test handling of "HHmmss" pattern.
public  voidTestFieldPosition()
     Verify that returned field position indices are correct.
public  voidTestGeneral()
     General parse/format tests.
public  voidTestGenericTime()
    
public  voidTestGenericTimeZoneOrder()
    
public  voidTestGreekMay()
    
public  voidTestInvalidPattern()
    
public  voidTestLetterDPattern212()
     Test the handling of 'D' in patterns.
public  voidTestLocaleDateFormat()
     Test the formatting of dates in different locales.
public  voidTestNarrowNames()
    
public  voidTestPartialParse994()
     Verify that strings which contain incomplete specifications are parsed correctly.
public  voidTestQuotePattern161()
     Test the handling of single quotes in patterns.
public  voidTestRunTogetherPattern917()
     Verify the behavior of patterns in which digits for different fields run together without intervening separators.
public  voidTestRunTogetherPattern985()
     Verify the behavior of patterns in which digits for different fields run together without intervening separators.
public  voidTestSpaceParsing()
     Test DateFormat's parsing of space characters.
public  voidTestStandAloneDays()
    
public  voidTestStandAloneMonths()
    
public  voidTestTimeZoneDisplayName()
    
public  voidTestTwoDigitYear()
     Test the parsing of two-digit years.
public  voidTestTwoDigitYearDSTParse()
     Test the parsing of 2-digit years.
public  voidTestWallyWedel()
    
public  voidTestWhiteSpaceParsing()
     Test handling of white space.
public  void_testIt917(SimpleDateFormat fmt, String str, Date expected)
    
 voidexpect(String[] data, Locale loc)
     Test formatting and parsing.
 voidexpectFormat(String[] data, Locale loc)
     Test formatting.
 voidexpectParse(String[] data, Locale loc)
     Test parsing.
public static  voidmain(String[] args)
    
public  voidparse2DigitYear(DateFormat fmt, String str, Date expected)
    
public  voidtestErrorChecking()
    
public  voidtryPat994(SimpleDateFormat format, String pat, String str, Date expected)
    
public  voidtryPattern(SimpleDateFormat sdf, Date d, String pattern, Date expected)
    

Field Detail
DATEFORMAT_FIELD_NAMES
final static String DATEFORMAT_FIELD_NAMES(Code)
A list of the names of all the fields in DateFormat. This MUST be kept in sync with DateFormat.



PATTERN_CHARS
final static String PATTERN_CHARS(Code)
This MUST be kept in sync with DateFormatSymbols.patternChars.





Method Detail
TestBadInput135
public void TestBadInput135()(Code)
Verify the correct behavior when handling invalid input strings.



TestBadInput135a
public void TestBadInput135a()(Code)
Verify the correct behavior when parsing an array of inputs against an array of patterns, with known results. The results are encoded after the input strings in each row.



TestChineseDateFormatLocalizedPatternChars
public void TestChineseDateFormatLocalizedPatternChars()(Code)



TestCoverage
public void TestCoverage()(Code)



TestCzechMonths459
public void TestCzechMonths459()(Code)
Verify the handling of Czech June and July, which have the unique attribute that one is a proper prefix substring of the other.



TestDateFormatCalendar
public void TestDateFormatCalendar()(Code)
Test DateFormat(Calendar) API



TestDateFormatZone061
public void TestDateFormatZone061()(Code)
Test the formatting of time zones.



TestDateFormatZone146
public void TestDateFormatZone146()(Code)
Test the formatting of time zones.



TestDayOfYearPattern195
public void TestDayOfYearPattern195()(Code)
Test the day of year pattern.



TestEquals
public void TestEquals()(Code)



TestEras
public void TestEras()(Code)



TestExactCountFormat
public void TestExactCountFormat()(Code)
Test handling of "HHmmss" pattern.



TestFieldPosition
public void TestFieldPosition()(Code)
Verify that returned field position indices are correct.



TestGeneral
public void TestGeneral()(Code)
General parse/format tests. Add test cases as needed.



TestGenericTime
public void TestGenericTime()(Code)



TestGenericTimeZoneOrder
public void TestGenericTimeZoneOrder()(Code)



TestGreekMay
public void TestGreekMay()(Code)



TestInvalidPattern
public void TestInvalidPattern()(Code)



TestLetterDPattern212
public void TestLetterDPattern212()(Code)
Test the handling of 'D' in patterns.



TestLocaleDateFormat
public void TestLocaleDateFormat()(Code)
Test the formatting of dates in different locales.



TestNarrowNames
public void TestNarrowNames()(Code)



TestPartialParse994
public void TestPartialParse994()(Code)
Verify that strings which contain incomplete specifications are parsed correctly. In some instances, this means not being parsed at all, and returning an appropriate error.



TestQuotePattern161
public void TestQuotePattern161()(Code)
Test the handling of single quotes in patterns.



TestRunTogetherPattern917
public void TestRunTogetherPattern917()(Code)
Verify the behavior of patterns in which digits for different fields run together without intervening separators.



TestRunTogetherPattern985
public void TestRunTogetherPattern985()(Code)
Verify the behavior of patterns in which digits for different fields run together without intervening separators.



TestSpaceParsing
public void TestSpaceParsing()(Code)
Test DateFormat's parsing of space characters. See jitterbug 1916.



TestStandAloneDays
public void TestStandAloneDays()(Code)



TestStandAloneMonths
public void TestStandAloneMonths()(Code)



TestTimeZoneDisplayName
public void TestTimeZoneDisplayName()(Code)



TestTwoDigitYear
public void TestTwoDigitYear()(Code)
Test the parsing of two-digit years.



TestTwoDigitYearDSTParse
public void TestTwoDigitYearDSTParse()(Code)
Test the parsing of 2-digit years.



TestWallyWedel
public void TestWallyWedel()(Code)



TestWhiteSpaceParsing
public void TestWhiteSpaceParsing()(Code)
Test handling of white space.



_testIt917
public void _testIt917(SimpleDateFormat fmt, String str, Date expected)(Code)



expect
void expect(String[] data, Locale loc)(Code)
Test formatting and parsing. Input is an array of String that starts with a single 'header' element [0] = reference dateformat pattern string (ref) followed by test cases, each of which is 4 or 5 elements: [i] = test dateformat pattern string (test), or null to reuse prior test pattern [i+1] = control string, either "fp", "pf", or "F". [i+2] = data string A [i+3] = data string B [i+4] = data string C (not present for 'F' control string) Note: the number of data strings depends on the control string. fp formats a date, checks the result, then parses the result and checks against a (possibly different) date pf parses a string, checks the result, then formats the result and checks against a (possibly different) string F is a shorthand for fp when the second date is the same as the first P is a shorthand for pf when the second string is the same as the first Examples: (fp) "y/M/d H:mm:ss.SS", "fp", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.56", "2004 03 10 16:36:31.560", -- ref.parse A, get t0 -- test.format t0, get r0 -- compare r0 to B, fail if not equal -- test.parse B, get t1 -- ref.parse C, get t2 -- compare t1 and t2, fail if not equal (F) "y/M/d H:mm:ss.SSS", "F", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.567" -- ref.parse A, get t0 -- test.format t0, get r0 -- compare r0 to B, fail if not equal -- test.parse B, get t1 -- compare t1 and t0, fail if not equal (pf) "y/M/d H:mm:ss.SSSS", "pf", "2004/3/10 16:36:31.5679", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.5670", -- test.parse A, get t0 -- ref.parse B, get t1 -- compare t0 to t1, fail if not equal -- test.format t1, get r0 -- compare r0 and C, fail if not equal (P) "y/M/d H:mm:ss.SSSS", "P", "2004/3/10 16:36:31.5679", "2004 03 10 16:36:31.567"", -- test.parse A, get t0 -- ref.parse B, get t1 -- compare t0 to t1, fail if not equal -- test.format t1, get r0 -- compare r0 and A, fail if not equal



expectFormat
void expectFormat(String[] data, Locale loc)(Code)
Test formatting. Input is an array of String that starts with a single 'header' element [0] = reference dateformat pattern string (ref) followed by test cases, each of which is 4 or 5 elements: [i] = test dateformat pattern string (test), or null to reuse prior test pattern [i+1] = data string A [i+2] = data string B Formats a date, checks the result. Examples: "y/M/d H:mm:ss.SSS", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.567" -- ref.parse A, get t0 -- test.format t0, get r0 -- compare r0 to B, fail if not equal



expectParse
void expectParse(String[] data, Locale loc)(Code)
Test parsing. Input is an array that starts with the following header: [0] = pattern string to parse [i+2] with followed by test cases, each of which is 3 array elements: [i] = pattern, or null to reuse prior pattern [i+1] = input string [i+2] = expected parse result (parsed with pattern [0]) If expect parse failure, then [i+2] should be null.



main
public static void main(String[] args) throws Exception(Code)



parse2DigitYear
public void parse2DigitYear(DateFormat fmt, String str, Date expected)(Code)



testErrorChecking
public void testErrorChecking()(Code)



tryPat994
public void tryPat994(SimpleDateFormat format, String pat, String str, Date expected)(Code)



tryPattern
public void tryPattern(SimpleDateFormat sdf, Date d, String pattern, Date expected)(Code)



Fields inherited from com.ibm.icu.dev.test.TestFmwk
protected TestParams params(Code)(Java Doc)

Methods inherited from com.ibm.icu.dev.test.TestFmwk
protected boolean assertEquals(String message, boolean expected, boolean actual)(Code)(Java Doc)
protected boolean assertEquals(String message, long expected, long actual)(Code)(Java Doc)
protected boolean assertEquals(String message, float expected, float actual, double error)(Code)(Java Doc)
protected boolean assertEquals(String message, double expected, double actual, double error)(Code)(Java Doc)
protected boolean assertEquals(String message, Object expected, Object actual)(Code)(Java Doc)
protected boolean assertFalse(String message, boolean condition)(Code)(Java Doc)
protected boolean assertNotEquals(String message, Object expected, Object actual)(Code)(Java Doc)
protected boolean assertNotNull(String message, Object actual)(Code)(Java Doc)
protected boolean assertNotSame(String message, Object expected, Object actual)(Code)(Java Doc)
protected boolean assertNull(String message, Object actual)(Code)(Java Doc)
protected boolean assertSame(String message, Object expected, Object actual)(Code)(Java Doc)
protected boolean assertTrue(String message, boolean condition)(Code)(Java Doc)
protected int checkArray(String msg, String array, String expected)(Code)(Java Doc)
protected int checkArray(String msg, Locale array, String expected)(Code)(Java Doc)
protected int checkArray(String msg, ULocale array, String expected)(Code)(Java Doc)
protected Random createRandom()(Code)(Java Doc)
protected void fail(String message)(Code)(Java Doc)
protected static synchronized java.util.Date getDate(int year, int month, int dom)(Code)(Java Doc)
protected String getDescription()(Code)(Java Doc)
protected int getErrorCount()(Code)(Java Doc)
public PrintWriter getErrorLogPrintWriter()(Code)(Java Doc)
public int getInclusion()(Code)(Java Doc)
public PrintWriter getLogPrintWriter()(Code)(Java Doc)
protected String getMethodDescription(String name)(Code)(Java Doc)
protected TestFmwk getSubtest(String prefix) throws TestFmwkException(Code)(Java Doc)
protected Target getTargets(String targetName)(Code)(Java Doc)
public String getTranslitTestFilter()(Code)(Java Doc)
protected void handleException(Throwable e)(Code)(Java Doc)
public static String hex(char[] s)(Code)(Java Doc)
public static String hex(byte[] s)(Code)(Java Doc)
public static String hex(char ch)(Code)(Java Doc)
public static String hex(int ch)(Code)(Java Doc)
public static String hex(String s)(Code)(Java Doc)
public static String hex(StringBuffer s)(Code)(Java Doc)
protected void init() throws Exception(Code)(Java Doc)
public boolean isDateAtLeast(int year, int month, int day)(Code)(Java Doc)
public boolean isMemTracking()(Code)(Java Doc)
public boolean isModularBuild()(Code)(Java Doc)
public boolean isQuick()(Code)(Java Doc)
public boolean isTiming()(Code)(Java Doc)
public boolean isVerbose()(Code)(Java Doc)
public void msg(String message, int level, boolean incCount, boolean newln)(Code)(Java Doc)
public boolean noData()(Code)(Java Doc)
public static String prettify(String s)(Code)(Java Doc)
public static String prettify(StringBuffer s)(Code)(Java Doc)
public Target resolveTarget(TestParams params)(Code)(Java Doc)
public Target resolveTarget(TestParams params, String targetPath)(Code)(Java Doc)
public void run(String[] args)(Code)(Java Doc)
public int run(String[] args, PrintWriter log)(Code)(Java Doc)
public int runTests(TestParams params, String[] tests)(Code)(Java Doc)
protected TimeZone safeGetTimeZone(String id)(Code)(Java Doc)
public void usage()(Code)(Java Doc)
public static void usage(PrintWriter pw, String className)(Code)(Java Doc)
protected boolean validate()(Code)(Java Doc)
protected boolean validateMethod(String name)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.