Source Code Cross Referenced for UnitTest.java in  » Internationalization-Localization » icu4j » com » ibm » icu » tests » 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.tests 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         ******************************************************************************
003:         * Copyright (C) 2005, International Business Machines Corporation and        *
004:         * others. All Rights Reserved.                                               *
005:         ******************************************************************************
006:         */
007:        package com.ibm.icu.tests;
008:
009:        import junit.framework.TestCase;
010:        import com.ibm.icu.dev.test.TestAll;
011:        import com.ibm.icu.dev.test.TestFmwk;
012:        import com.ibm.icu.dev.test.TestFmwk.TestParams;
013:
014:        //import com.ibm.icu.text.DateFormat;
015:        //import com.ibm.icu.util.Calendar;
016:        //import com.ibm.icu.util.GregorianCalendar;
017:        //import com.ibm.icu.util.TimeZone;
018:        //import com.ibm.icu.util.ULocale;
019:
020:        public class UnitTest extends TestCase {
021:
022:            public void testCalendar() throws Exception {
023:                runUtility("Calendar");
024:            }
025:
026:            public void testCollator() throws Exception {
027:                runUtility("Collator");
028:            }
029:
030:            public void testCompression() throws Exception {
031:                runUtility("Compression");
032:            }
033:
034:            public void testDiagBigDecimal() throws Exception {
035:                runUtility("DiagBigDecimal");
036:            }
037:
038:            public void testFormat() throws Exception {
039:                runUtility("Format");
040:            }
041:
042:            public void testImpl() throws Exception {
043:                runUtility("Impl");
044:            }
045:
046:            public void testNormalizer() throws Exception {
047:                runUtility("Normalizer");
048:            }
049:
050:            public void testProperty() throws Exception {
051:                runUtility("Property");
052:            }
053:
054:            public void testRBBI() throws Exception {
055:                runUtility("RBBI");
056:            }
057:
058:            public void testSearchTest() throws Exception {
059:                runUtility("SearchTest");
060:            }
061:
062:            public void testStringPrep() throws Exception {
063:                runUtility("StringPrep");
064:            }
065:
066:            public void testTestCharsetDetector() throws Exception {
067:                runUtility("TestCharsetDetector");
068:            }
069:
070:            public void testTestUCharacterIterator() throws Exception {
071:                runUtility("TestUCharacterIterator");
072:            }
073:
074:            public void testTimeScale() throws Exception {
075:                runUtility("TimeScale");
076:            }
077:
078:            public void testTimeZone() throws Exception {
079:                runUtility("TimeZone");
080:            }
081:
082:            public void testTranslit() throws Exception {
083:                runUtility("Translit");
084:            }
085:
086:            public void testUtil() throws Exception {
087:                runUtility("Util");
088:            }
089:
090:            public void runUtility(String testname) throws Exception {
091:                TestParams params = TestParams.create("-n", null);
092:                TestFmwk test = new TestAll();
093:                test.resolveTarget(params, testname).run();
094:                if (params.errorCount > 0) {
095:                    fail(params.errorSummary.toString());
096:                }
097:            }
098:
099:            // sample tests from ICU4J test suite
100:
101:            // Calendar
102:            //    public void testCalendarSimple() throws Exception {
103:            //    	TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
104:            //    	GregorianCalendar gc = new GregorianCalendar(tz);
105:            //    	gc.set(2005,9,17,14,15,33);
106:            //    	Date time = gc.getTime();
107:            //    	
108:            //    	final String[] calendars = {
109:            //    		"buddhist", "chinese", "coptic", "ethiopic", "gregorian", 
110:            //    		"hebrew", "islamic", "islamic-civil", "japanese"
111:            //    	};
112:            //    	final String[] ustimes = {
113:            //    		"Monday, October 17, 2548 BE 2:15:33 PM PDT",
114:            //    		"Monday 22x78-9-15 2:15:33 PM PDT",
115:            //    		"Monday, Baba 7, 1722 2:15:33 PM PDT",
116:            //    		"Monday, Tekemt 7, 1998 2:15:33 PM PDT",
117:            //    		"Monday, October 17, 2005 2:15:33 PM PDT",
118:            //    		"Monday, Tishri 14, 5766 2:15:33 PM PDT",
119:            //    		"Monday, Ramadan 14, 1426 2:15:33 PM PDT",
120:            //    		"Monday, Ramadan 14, 1426 2:15:33 PM PDT",
121:            //    		"Monday, October 17, 17 Heisei 2:15:33 PM PDT",
122:            //    	};
123:            //    	final String[] detimes = {
124:            //    		"Montag, Oktober 17, 2548 BE 2:15:33 nachm. GMT-07:00",
125:            //    		"Montag 22x78-9-15 2:15:33 nachm. GMT-07:00",
126:            //    		"Montag, 7. Baba 1722 14:15 Uhr GMT-07:00",
127:            //    		"Montag, 7. Tekemt 1998 14:15 Uhr GMT-07:00",
128:            //    		"Montag, 17. Oktober 2005 14:15 Uhr GMT-07:00",
129:            //    		"Montag, 14. Tishri 5766 14:15 Uhr GMT-07:00",
130:            //    		"Montag, 14. Ramadan 1426 14:15 Uhr GMT-07:00",
131:            //    		"Montag, 14. Ramadan 1426 14:15 Uhr GMT-07:00",
132:            //    		"Montag, Oktober 17, 17 Heisei 2:15:33 nachm. GMT-07:00",
133:            //    	};
134:            //    	
135:            //    	ULocale[] locales = {ULocale.US, ULocale.GERMANY };
136:            //    	String[][] times = { ustimes, detimes };
137:            //    	for (int j = 0; j < locales.length; ++j) {
138:            //    		ULocale ul = new ULocale("en_US");
139:            //    		for (int i = 0; i < calendars.length; ++i) {
140:            //    			ul = ul.setKeywordValue("calendar", calendars[i]);
141:            //    			Calendar cal = Calendar.getInstance(ul);
142:            //    			DateFormat fmt = cal.getDateTimeFormat(DateFormat.FULL, DateFormat.FULL, locales[j]);
143:            //    			String result = fmt.format(time);
144:            //  			    System.out.println(calendars[i] + ": " + result);
145:            //    			if (!result.equals(times[j][i])) {
146:            //    				fail("calendar: " + calendars[i]);
147:            //    			}
148:            //    		}
149:            //    	}
150:            //    }
151:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.