001: /*
002: * Copyright 2007 Google Inc.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License. You may obtain a copy of
006: * the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013: * License for the specific language governing permissions and limitations under
014: * the License.
015: */
016:
017: package com.google.gwt.i18n.client;
018:
019: import com.google.gwt.core.client.GWT;
020: import com.google.gwt.i18n.client.gen.Colors;
021: import com.google.gwt.i18n.client.gen.TestBadKeys;
022: import com.google.gwt.junit.client.GWTTestCase;
023:
024: /**
025: * TODO: document me.
026: */
027: public class I18N2Test extends GWTTestCase {
028: public String getModuleName() {
029: return "com.google.gwt.i18n.I18N2Test";
030: }
031:
032: public void testBadKeys() {
033: TestBadKeys test = (TestBadKeys) GWT.create(TestBadKeys.class);
034: assertEquals("zh_spacer", test.zh_spacer());
035: assertEquals("zh_spacer", test.getString("zh_spacer"));
036: assertEquals("logger_org_hibernate_jdbc", test
037: .logger_org_hibernate_jdbc());
038: assertEquals("logger_org_hibernate_jdbc", test
039: .getString("logger_org_hibernate_jdbc"));
040: assertEquals("cell_2_5", test.cell_2_5());
041: assertEquals("cell_2_5", test.getString("cell_2_5"));
042: assertEquals("_level", test._level());
043: assertEquals("_level", test.getString("_level"));
044: assertEquals("__s", test.__s());
045: assertEquals("__s", test.getString("__s"));
046: assertEquals(
047: "________________________________________________________________",
048: test
049: .________________________________________________________________());
050: assertEquals(
051: "________________________________________________________________",
052: test
053: .getString("________________________________________________________________"));
054: assertEquals("_", test._());
055: assertEquals("_", test.getString("_"));
056: assertEquals("maven_jdiff_old_tag", test.maven_jdiff_old_tag());
057: assertEquals("maven_jdiff_old_tag", test
058: .getString("maven_jdiff_old_tag"));
059: assertEquals("maven_checkstyle_properties", test
060: .maven_checkstyle_properties());
061: assertEquals("maven_checkstyle_properties", test
062: .getString("maven_checkstyle_properties"));
063: assertEquals("_1_2_3_4", test._1_2_3_4());
064: assertEquals("_1_2_3_4", test.getString("_1_2_3_4"));
065: assertEquals("entity_160", test.entity_160());
066: assertEquals("entity_160", test.getString("entity_160"));
067: assertEquals("a__b", test.a__b());
068: assertEquals("a__b", test.getString("a__b"));
069: assertEquals("AWT_f5", test.AWT_f5());
070: assertEquals("AWT_f5", test.getString("AWT_f5"));
071: assertEquals("Cursor_MoveDrop_32x32_File", test
072: .Cursor_MoveDrop_32x32_File());
073: assertEquals("Cursor_MoveDrop_32x32_File", test
074: .getString("Cursor_MoveDrop_32x32_File"));
075: assertEquals("_c_____", test._c_____());
076: assertEquals("_c_____", test.getString("_c_____"));
077: assertEquals("__s_dup", test.__s_dup());
078: assertEquals("__s_dup", test.getString("__s_dup"));
079: assertEquals("__dup", test.__dup());
080: assertEquals("__dup", test.getString("__dup"));
081: assertEquals("AWT_end", test.AWT_end());
082: assertEquals("AWT_end", test.getString("AWT_end"));
083: assertEquals("permissions_755", test.permissions_755());
084: assertEquals("permissions_755", test
085: .getString("permissions_755"));
086: assertEquals("a_b_c", test.a_b_c());
087: assertEquals("a_b_c", test.getString("a_b_c"));
088: assertEquals("__s_dup_dup", test.__s_dup_dup());
089: }
090:
091: public void testBinding() {
092: TestBinding t = (TestBinding) GWT.create(TestBinding.class);
093: assertEquals("b_c_d", t.a());
094: assertEquals("default", t.b());
095: }
096:
097: public void testCheckColorsAndShapes() {
098: ColorsAndShapes s = (ColorsAndShapes) GWT
099: .create(ColorsAndShapes.class);
100: // should not have changed, because we included no shapesAndColor info.
101: assertEquals("ýéļļöŵ", s.yellow());
102: }
103:
104: public void testWalkUpColorTree() {
105: Colors colors = (Colors) GWT.create(Colors.class);
106: assertEquals("red_b_C_d", colors.red());
107: assertEquals("blue_b_C", colors.blue());
108: assertEquals("yellow_b", colors.yellow());
109: }
110:
111: }
|