01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: TestLocalizationUtils.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.tools;
09:
10: import junit.framework.TestCase;
11:
12: public class TestLocalizationUtils extends TestCase {
13: public TestLocalizationUtils(String name) {
14: super (name);
15: }
16:
17: public void testExtractLocalizedUrl() {
18: assertEquals("/root", Localization
19: .extractLocalizedUrl("en:/root,nl:/wortel"));
20: assertEquals(
21: "/logout",
22: Localization
23: .extractLocalizedUrl("nl:/afmelden,/logout,fr:/deconnection"));
24: assertNull(Localization.extractLocalizedUrl(null));
25: assertEquals("/root", Localization.extractLocalizedUrl("/root"));
26: assertEquals(null, Localization
27: .extractLocalizedUrl("nl:/afmelden,fr:/deconnection"));
28: assertEquals("http://www.uwyn.com", Localization
29: .extractLocalizedUrl("http://www.uwyn.com"));
30: assertEquals(
31: "http://www.uwyn.com",
32: Localization
33: .extractLocalizedUrl("fr:/racine,en:http://www.uwyn.com,nl:/wortel"));
34: }
35: }
|