1.1 --- a/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/impl/Bck2BrwsrCase.java Fri Feb 01 18:03:03 2013 +0100
1.2 +++ b/vmtest/src/main/java/org/apidesign/bck2brwsr/vmtest/impl/Bck2BrwsrCase.java Tue Feb 05 08:48:23 2013 +0100
1.3 @@ -28,7 +28,7 @@
1.4 import org.apidesign.bck2brwsr.launcher.Launcher;
1.5 import org.apidesign.bck2brwsr.launcher.InvocationContext;
1.6 import org.apidesign.bck2brwsr.vmtest.HtmlFragment;
1.7 -import org.apidesign.bck2brwsr.vmtest.HttpResource;
1.8 +import org.apidesign.bck2brwsr.vmtest.Http;
1.9 import org.testng.ITest;
1.10 import org.testng.annotations.Test;
1.11
1.12 @@ -42,10 +42,10 @@
1.13 private final String type;
1.14 private final boolean fail;
1.15 private final HtmlFragment html;
1.16 - private final HttpResource http;
1.17 + private final Http.Resource[] http;
1.18 Object value;
1.19
1.20 - Bck2BrwsrCase(Method m, String type, Launcher l, boolean fail, HtmlFragment html, HttpResource http) {
1.21 + Bck2BrwsrCase(Method m, String type, Launcher l, boolean fail, HtmlFragment html, Http.Resource[] http) {
1.22 this.l = l;
1.23 this.m = m;
1.24 this.type = type;
1.25 @@ -62,12 +62,14 @@
1.26 c.setHtmlFragment(html.value());
1.27 }
1.28 if (http != null) {
1.29 - if (!http.content().isEmpty()) {
1.30 - InputStream is = new ByteArrayInputStream(http.content().getBytes("UTF-8"));
1.31 - c.setHttpResource(http.path(), http.mimeType(), is);
1.32 - } else {
1.33 - InputStream is = m.getDeclaringClass().getResourceAsStream(http.resource());
1.34 - c.setHttpResource(http.path(), http.mimeType(), is);
1.35 + for (Http.Resource r : http) {
1.36 + if (!r.content().isEmpty()) {
1.37 + InputStream is = new ByteArrayInputStream(r.content().getBytes("UTF-8"));
1.38 + c.addHttpResource(r.path(), r.mimeType(), is);
1.39 + } else {
1.40 + InputStream is = m.getDeclaringClass().getResourceAsStream(r.resource());
1.41 + c.addHttpResource(r.path(), r.mimeType(), is);
1.42 + }
1.43 }
1.44 }
1.45 String res = c.invoke();