01: /*
02: * Copyright 2007 Gerd Ziegler (www.gerdziegler.de)
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: * http://www.apache.org/licenses/LICENSE-2.0
07: * Unless required by applicable law or agreed to in writing,
08: * software distributed under the License is distributed on an
09: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
10: * either express or implied. See the License for the specific
11: * language governing permissions and limitations under the License.
12: * 22.09.2007
13: * @author www.gerdziegler.de
14: */
15: package org.ztemplates.test.actions.urlhandler.i18n;
16:
17: import junit.framework.TestCase;
18:
19: import org.apache.log4j.Logger;
20: import org.ztemplates.actions.urlhandler.ZIUrlHandler;
21: import org.ztemplates.actions.urlhandler.tree.ZUrlHandlerFactory;
22:
23: public class I18nTest extends TestCase {
24: private static Logger log = Logger.getLogger(I18nTest.class);
25:
26: ZIUrlHandler up;
27:
28: protected void setUp() throws Exception {
29: super .setUp();
30: up = ZUrlHandlerFactory.create(I18nTest.class.getPackage()
31: .getName(), ZUrlHandlerFactory.defaultSecurityService);
32: }
33:
34: protected void tearDown() throws Exception {
35: up = null;
36: super .tearDown();
37: }
38:
39: public void testUmlautProp() throws Exception {
40: I18nHandler h1 = new I18nHandler();
41: h1.setProp("äöü");
42:
43: String url = up.createUrl(h1);
44: I18nHandler obj = (I18nHandler) up.process(url);
45: assertNotNull(obj);
46: assertEquals(url, h1.getProp(), obj.getProp());
47: }
48:
49: public void testUmlautParam() throws Exception {
50: I18nHandler h1 = new I18nHandler();
51: h1.setParam("äöü");
52: String url = up.createUrl(h1);
53: I18nHandler obj = (I18nHandler) up.process(url);
54: assertNotNull(obj);
55: assertEquals(url, h1.getParam(), obj.getParam());
56: }
57: }
|