summaryrefslogtreecommitdiff
path: root/utils/src/test/java
diff options
context:
space:
mode:
authorwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-03-13 10:58:21 +0000
committerwbauer <wbauer@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-03-13 10:58:21 +0000
commit2f49ed7ea3649a51a9457b99004c8cb0ca443432 (patch)
tree79aa079428424d13bde34d9bb12fb3d4a8c12e43 /utils/src/test/java
parent2882e14d19cfa58ea382083434210aaf0cfea3e3 (diff)
downloadmocca-2f49ed7ea3649a51a9457b99004c8cb0ca443432.tar.gz
mocca-2f49ed7ea3649a51a9457b99004c8cb0ca443432.tar.bz2
mocca-2f49ed7ea3649a51a9457b99004c8cb0ca443432.zip
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@321 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'utils/src/test/java')
-rw-r--r--utils/src/test/java/at/gv/egiz/urldereferencer/FormDataTest.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/utils/src/test/java/at/gv/egiz/urldereferencer/FormDataTest.java b/utils/src/test/java/at/gv/egiz/urldereferencer/FormDataTest.java
index 1e0ce916..ecd4c8f7 100644
--- a/utils/src/test/java/at/gv/egiz/urldereferencer/FormDataTest.java
+++ b/utils/src/test/java/at/gv/egiz/urldereferencer/FormDataTest.java
@@ -77,12 +77,20 @@ public class FormDataTest implements FormDataURLSupplier {
@Test
public void testFormData() throws IOException {
paramName = "Müllcontainer";
+ testStream = new ByteArrayInputStream("HelloWorld".getBytes("UTF-8"));
String url = "formdata:"+paramName;
StreamData sd = URLDereferencer.getInstance().dereference(url, urlCtx);
- assertNull(sd);
- testStream = new ByteArrayInputStream("HelloWorld".getBytes("UTF-8"));
- sd = URLDereferencer.getInstance().dereference(url, urlCtx);
+ assertNotNull(sd);
String result = StreamUtil.asString(sd.getStream(), "UTF-8");
assertEquals("HelloWorld", result);
- }
+ }
+
+ @Test(expected=IOException.class)
+ public void testFormDataNotFound() throws IOException {
+ paramName = "Müllcontainer";
+ testStream = new ByteArrayInputStream("HelloWorld".getBytes("UTF-8"));
+ String url = "formdata:"+paramName+"2";
+ StreamData sd = URLDereferencer.getInstance().dereference(url, urlCtx);
+ }
+
}