1.1 --- a/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/HttpResourceTest.java Fri Feb 01 14:16:26 2013 +0100
1.2 +++ b/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/HttpResourceTest.java Tue Feb 05 08:48:23 2013 +0100
1.3 @@ -21,7 +21,7 @@
1.4 import java.net.URL;
1.5 import org.apidesign.bck2brwsr.core.JavaScriptBody;
1.6 import org.apidesign.bck2brwsr.vmtest.BrwsrTest;
1.7 -import org.apidesign.bck2brwsr.vmtest.HttpResource;
1.8 +import org.apidesign.bck2brwsr.vmtest.Http;
1.9 import org.apidesign.bck2brwsr.vmtest.VMTest;
1.10 import org.testng.annotations.Factory;
1.11
1.12 @@ -31,15 +31,21 @@
1.13 */
1.14 public class HttpResourceTest {
1.15
1.16 - @HttpResource(path = "/xhr", content = "Hello Brwsr!", mimeType = "text/plain")
1.17 + @Http({
1.18 + @Http.Resource(path = "/xhr", content = "Hello Brwsr!", mimeType = "text/plain")
1.19 + })
1.20 @BrwsrTest
1.21 +
1.22 +
1.23 public String testReadContentViaXHR() throws Exception {
1.24 String msg = read("/xhr");
1.25 assert "Hello Brwsr!".equals(msg) : "The message was " + msg;
1.26 return msg;
1.27 }
1.28
1.29 - @HttpResource(path = "/url", content = "Hello via URL!", mimeType = "text/plain")
1.30 + @Http({
1.31 + @Http.Resource(path = "/url", content = "Hello via URL!", mimeType = "text/plain")
1.32 + })
1.33 @BrwsrTest
1.34 public String testReadContentViaURL() throws Exception {
1.35 URL url = new URL("http:/url");
1.36 @@ -47,7 +53,9 @@
1.37 assert "Hello via URL!".equals(msg) : "The message was " + msg;
1.38 return msg;
1.39 }
1.40 - @HttpResource(path = "/url", content = "Hello via URL!", mimeType = "text/plain")
1.41 + @Http({
1.42 + @Http.Resource(path = "/url", content = "Hello via URL!", mimeType = "text/plain")
1.43 + })
1.44 @BrwsrTest
1.45 public String testReadContentViaURLWithStringParam() throws Exception {
1.46 URL url = new URL("http:/url");
1.47 @@ -56,7 +64,9 @@
1.48 return msg;
1.49 }
1.50
1.51 - @HttpResource(path = "/bytes", content = "", resource = "0xfe", mimeType = "x-application/binary")
1.52 + @Http({
1.53 + @Http.Resource(path = "/bytes", content = "", resource = "0xfe", mimeType = "x-application/binary")
1.54 + })
1.55 @BrwsrTest
1.56 public void testReadByte() throws Exception {
1.57 URL url = new URL("http:/bytes");
1.58 @@ -67,7 +77,9 @@
1.59 assert arr[0] == 0xfe : "It is 0xfe: " + Integer.toHexString(arr[0]);
1.60 }
1.61
1.62 - @HttpResource(path = "/bytes", content = "", resource = "0xfe", mimeType = "x-application/binary")
1.63 + @Http({
1.64 + @Http.Resource(path = "/bytes", content = "", resource = "0xfe", mimeType = "x-application/binary")
1.65 + })
1.66 @BrwsrTest
1.67 public void testReadByteViaInputStream() throws Exception {
1.68 URL url = new URL("http:/bytes");