aboutsummaryrefslogtreecommitdiff
path: root/common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java')
-rw-r--r--common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java b/common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java
new file mode 100644
index 000000000..b6ea0e152
--- /dev/null
+++ b/common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java
@@ -0,0 +1,29 @@
+package test.at.gv.egovernment.moa.util;
+
+import java.net.URLEncoder;
+
+import at.gv.egovernment.moa.util.FileUtils;
+import at.gv.egovernment.moa.util.URLDecoder;
+
+import junit.framework.TestCase;
+
+/*
+ * @author Paul Ivancsics
+ * @version $Id$
+ */
+public class URLDecoderTest extends TestCase {
+
+ public void test() throws Exception {
+ String s = "immerZUA0129<>%==$$%&/()@?{()=} \\\"äöüÄÖÜ?§";
+ String senc = URLEncoder.encode(s);
+ String sdec = URLDecoder.decode(senc, "ISO-8859-1");
+ assertEquals(s, sdec);
+ }
+ public void testUTF8() throws Exception {
+ String s = new String(FileUtils.readFile("data/test/xml/CreateXMLSignature/CreateXMLSignatureResponse.xml"));
+ String senc = URLEncoder.encode(s);
+ String sdec = URLDecoder.decode(senc, "UTF-8");
+ String sutf8 = FileUtils.readFile("data/test/xml/CreateXMLSignature/CreateXMLSignatureResponse.xml", "UTF-8");
+ assertEquals(sutf8, sdec);
+ }
+}