javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/JSONTest.java
changeset 1750 0b4afadbd494
parent 1412 a51c0d80ee24
     1.1 --- a/javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/JSONTest.java	Fri Nov 22 09:34:48 2013 +0100
     1.2 +++ b/javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/JSONTest.java	Sun Dec 14 16:29:46 2014 +0100
     1.3 @@ -17,7 +17,6 @@
     1.4   */
     1.5  package org.apidesign.bck2brwsr.htmlpage;
     1.6  
     1.7 -import java.util.Arrays;
     1.8  import java.util.Iterator;
     1.9  import org.apidesign.bck2brwsr.core.JavaScriptBody;
    1.10  import org.apidesign.bck2brwsr.htmlpage.api.OnReceive;
    1.11 @@ -173,15 +172,17 @@
    1.12      
    1.13      @Http(@Http.Resource(
    1.14          content = "{'firstName': 'Sitar', 'sex': 'MALE'}", 
    1.15 -        path="/person.json", 
    1.16 +        path="/person33.json", 
    1.17          mimeType = "application/json"
    1.18      ))
    1.19      @BrwsrTest public void loadAndParseJSON() throws InterruptedException {
    1.20 +        try { throw new Exception(); } catch (Exception ex) {
    1.21 +        }
    1.22          if (js == null) {
    1.23              js = new JSONik();
    1.24              js.applyBindings();
    1.25  
    1.26 -            js.fetch("person.json");
    1.27 +            js.fetch("person33.json");
    1.28          }
    1.29      
    1.30          Person p = js.getFetched();
    1.31 @@ -200,7 +201,7 @@
    1.32      
    1.33      @Http(@Http.Resource(
    1.34          content = "$0({'firstName': 'Mitar', 'sex': 'MALE'})", 
    1.35 -        path="/person.json", 
    1.36 +        path="/person22.json", 
    1.37          mimeType = "application/javascript",
    1.38          parameters = { "callme" }
    1.39      ))
    1.40 @@ -213,7 +214,7 @@
    1.41              js = new JSONik();
    1.42              js.applyBindings();
    1.43  
    1.44 -            js.fetchViaJSONP("person.json");
    1.45 +            js.fetchViaJSONP("person22.json");
    1.46          }
    1.47      
    1.48          Person p = js.getFetched();
    1.49 @@ -237,7 +238,7 @@
    1.50      
    1.51      @Http(@Http.Resource(
    1.52          content = "{'firstName': 'Sitar', 'sex': 'MALE'}", 
    1.53 -        path="/person.json", 
    1.54 +        path="/person15.json", 
    1.55          mimeType = "application/json"
    1.56      ))
    1.57      @BrwsrTest public void loadAndParseJSONSentToArray() throws InterruptedException {
    1.58 @@ -245,7 +246,7 @@
    1.59              js = new JSONik();
    1.60              js.applyBindings();
    1.61  
    1.62 -            js.fetchArray("person.json");
    1.63 +            js.fetchArray("person15.json");
    1.64          }
    1.65          
    1.66          Person p = js.getFetched();
    1.67 @@ -260,7 +261,7 @@
    1.68      
    1.69      @Http(@Http.Resource(
    1.70          content = "[{'firstName': 'Gitar', 'sex': 'FEMALE'}]", 
    1.71 -        path="/person.json", 
    1.72 +        path="/person5.json", 
    1.73          mimeType = "application/json"
    1.74      ))
    1.75      @BrwsrTest public void loadAndParseJSONArraySingle() throws InterruptedException {
    1.76 @@ -268,7 +269,7 @@
    1.77              js = new JSONik();
    1.78              js.applyBindings();
    1.79          
    1.80 -            js.fetch("person.json");
    1.81 +            js.fetch("person5.json");
    1.82          }
    1.83          
    1.84          Person p = js.getFetched();
    1.85 @@ -309,7 +310,7 @@
    1.86      
    1.87      @Http(@Http.Resource(
    1.88          content = "{'age':[1, 2, 3]}", 
    1.89 -        path="/people.json", 
    1.90 +        path="/people8.json", 
    1.91          mimeType = "application/json"
    1.92      ))
    1.93      @BrwsrTest public void loadAndParseArrayOfIntegers() throws InterruptedException {
    1.94 @@ -317,7 +318,7 @@
    1.95              js = new JSONik();
    1.96              js.applyBindings();
    1.97          
    1.98 -            js.fetchPeopleAge("people.json");
    1.99 +            js.fetchPeopleAge("people8.json");
   1.100          }
   1.101          
   1.102          if (0 == js.getFetchedCount()) {
   1.103 @@ -336,7 +337,7 @@
   1.104      
   1.105      @Http(@Http.Resource(
   1.106          content = "{'sex':['FEMALE', 'MALE', 'MALE']}", 
   1.107 -        path="/people.json", 
   1.108 +        path="/people11.json", 
   1.109          mimeType = "application/json"
   1.110      ))
   1.111      @BrwsrTest public void loadAndParseArrayOfEnums() throws InterruptedException {
   1.112 @@ -344,7 +345,7 @@
   1.113              js = new JSONik();
   1.114              js.applyBindings();
   1.115          
   1.116 -            js.fetchPeopleSex("people.json");
   1.117 +            js.fetchPeopleSex("people11.json");
   1.118          }
   1.119          
   1.120          if (0 == js.getFetchedCount()) {
   1.121 @@ -363,14 +364,14 @@
   1.122          content = "[{'firstName': 'Gitar', 'sex': 'FEMALE'},"
   1.123          + "{'firstName': 'Peter', 'sex': 'MALE'}"
   1.124          + "]", 
   1.125 -        path="/person.json", 
   1.126 +        path="/person13.json", 
   1.127          mimeType = "application/json"
   1.128      ))
   1.129      @BrwsrTest public void loadAndParseJSONArray() throws InterruptedException {
   1.130          if (js == null) {
   1.131              js = new JSONik();
   1.132              js.applyBindings();
   1.133 -            js.fetchArray("person.json");
   1.134 +            js.fetchArray("person13.json");
   1.135          }
   1.136          
   1.137