json-tck/src/main/java/net/java/html/json/tests/JSONTest.java
branchcontext
changeset 115 b236fc0949e0
parent 110 21bf4126e3a9
child 121 81e976eb0fc2
     1.1 --- a/json-tck/src/main/java/net/java/html/json/tests/JSONTest.java	Tue May 28 13:31:42 2013 +0200
     1.2 +++ b/json-tck/src/main/java/net/java/html/json/tests/JSONTest.java	Tue May 28 20:01:30 2013 +0200
     1.3 @@ -46,7 +46,7 @@
     1.4      private Integer orig;
     1.5      
     1.6      @BrwsrTest public void toJSONInABrowser() throws Throwable {
     1.7 -        Person p = new Person(Utils.newContext());
     1.8 +        Person p = Models.bind(new Person(), Utils.newContext());
     1.9          p.setSex(Sex.MALE);
    1.10          p.setFirstName("Jarda");
    1.11          p.setLastName("Tulach");
    1.12 @@ -97,7 +97,7 @@
    1.13      ))
    1.14      @BrwsrTest public void loadAndParseJSON() throws InterruptedException {
    1.15          if (js == null) {
    1.16 -            js = new JSONik(Utils.newContext());
    1.17 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.18              js.applyBindings();
    1.19  
    1.20              js.fetch("person.json");
    1.21 @@ -129,7 +129,7 @@
    1.22              orig = scriptElements();
    1.23              assert orig > 0 : "There should be some scripts on the page";
    1.24              
    1.25 -            js = new JSONik(Utils.newContext());
    1.26 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.27              js.applyBindings();
    1.28  
    1.29              js.fetchViaJSONP("person.json");
    1.30 @@ -166,10 +166,10 @@
    1.31              orig = scriptElements();
    1.32              assert orig > 0 : "There should be some scripts on the page";
    1.33              
    1.34 -            js = new JSONik(Utils.newContext());
    1.35 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.36              js.applyBindings();
    1.37  
    1.38 -            Person p = new Person(BrwsrCtx.EMPTY);
    1.39 +            Person p = Models.bind(new Person(), BrwsrCtx.EMPTY);
    1.40              p.setFirstName("Jarda");
    1.41              js.putPerson("person.json", p);
    1.42          }
    1.43 @@ -208,7 +208,7 @@
    1.44      ))
    1.45      @BrwsrTest public void loadAndParseJSONSentToArray() throws InterruptedException {
    1.46          if (js == null) {
    1.47 -            js = new JSONik(Utils.newContext());
    1.48 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.49              js.applyBindings();
    1.50  
    1.51              js.fetchArray("person.json");
    1.52 @@ -230,7 +230,7 @@
    1.53      ))
    1.54      @BrwsrTest public void loadAndParseJSONArraySingle() throws InterruptedException {
    1.55          if (js == null) {
    1.56 -            js = new JSONik(Utils.newContext());
    1.57 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.58              js.applyBindings();
    1.59          
    1.60              js.fetch("person.json");
    1.61 @@ -252,7 +252,7 @@
    1.62      ))
    1.63      @BrwsrTest public void loadAndParseArrayInPeople() throws InterruptedException {
    1.64          if (js == null) {
    1.65 -            js = new JSONik(Utils.newContext());
    1.66 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.67              js.applyBindings();
    1.68          
    1.69              js.fetchPeople("people.json");
    1.70 @@ -278,7 +278,7 @@
    1.71      ))
    1.72      @BrwsrTest public void loadAndParseArrayOfIntegers() throws InterruptedException {
    1.73          if (js == null) {
    1.74 -            js = new JSONik(Utils.newContext());
    1.75 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.76              js.applyBindings();
    1.77          
    1.78              js.fetchPeopleAge("people.json");
    1.79 @@ -305,7 +305,7 @@
    1.80      ))
    1.81      @BrwsrTest public void loadAndParseArrayOfEnums() throws InterruptedException {
    1.82          if (js == null) {
    1.83 -            js = new JSONik(Utils.newContext());
    1.84 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.85              js.applyBindings();
    1.86          
    1.87              js.fetchPeopleSex("people.json");
    1.88 @@ -332,7 +332,7 @@
    1.89      ))
    1.90      @BrwsrTest public void loadAndParseJSONArray() throws InterruptedException {
    1.91          if (js == null) {
    1.92 -            js = new JSONik(Utils.newContext());
    1.93 +            js = Models.bind(new JSONik(), Utils.newContext());
    1.94              js.applyBindings();
    1.95              js.fetchArray("person.json");
    1.96          }