You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2009/10/28 16:23:40 UTC

svn commit: r830576 - /xmlgraphics/fop/trunk/test/java/org/apache/fop/util/XMLUtilTestCase.java

Author: vhennebert
Date: Wed Oct 28 15:23:39 2009
New Revision: 830576

URL: http://svn.apache.org/viewvc?rev=830576&view=rev
Log:
XMLUtilTestCase somehow hasn't been included in the merge of the accessibility branch into the Trunk

Added:
    xmlgraphics/fop/trunk/test/java/org/apache/fop/util/XMLUtilTestCase.java   (with props)

Added: xmlgraphics/fop/trunk/test/java/org/apache/fop/util/XMLUtilTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/util/XMLUtilTestCase.java?rev=830576&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/util/XMLUtilTestCase.java (added)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/util/XMLUtilTestCase.java Wed Oct 28 15:23:39 2009
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.util;
+
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests {@link XMLUtil}.
+ */
+public class XMLUtilTestCase extends TestCase {
+
+    public void testLocaleToRFC3066() throws Exception {
+        assertNull(XMLUtil.toRFC3066(null));
+        assertEquals("en", XMLUtil.toRFC3066(new Locale("en")));
+        assertEquals("en-US", XMLUtil.toRFC3066(new Locale("en", "US")));
+        assertEquals("en-US", XMLUtil.toRFC3066(new Locale("EN", "us")));
+    }
+
+    public void testRFC3066ToLocale() throws Exception {
+        assertNull(XMLUtil.convertRFC3066ToLocale(null));
+        assertNull(XMLUtil.convertRFC3066ToLocale(""));
+        assertEquals(new Locale("en"), XMLUtil.convertRFC3066ToLocale("en"));
+        assertEquals(new Locale("en", "US"), XMLUtil.convertRFC3066ToLocale("en-US"));
+        assertEquals(new Locale("en", "US"), XMLUtil.convertRFC3066ToLocale("EN-us"));
+    }
+}

Propchange: xmlgraphics/fop/trunk/test/java/org/apache/fop/util/XMLUtilTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/java/org/apache/fop/util/XMLUtilTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Revision Id



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org