aboutsummaryrefslogtreecommitdiff
path: root/common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java
diff options
context:
space:
mode:
authorgregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-07-07 10:58:37 +0000
committergregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-07-07 10:58:37 +0000
commitece7d18cf35374bf4e26d041799cda8f791c89f8 (patch)
tree33707cb77627b65a2a4e7327a2e93fb7751c1b76 /common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java
parent273aed93c03b18a6c6bb1af745ae46a13ad3c7f2 (diff)
downloadmoa-id-spss-ece7d18cf35374bf4e26d041799cda8f791c89f8.tar.gz
moa-id-spss-ece7d18cf35374bf4e26d041799cda8f791c89f8.tar.bz2
moa-id-spss-ece7d18cf35374bf4e26d041799cda8f791c89f8.zip
Initial commit
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@2 d688527b-c9ab-4aba-bd8d-4036d912da1d
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);
+ }
+}