Merging additional test
authorJaroslav Tulach <jaroslav.tulach@netbeans.org>
Tue, 21 Jan 2014 15:37:40 +0100
changeset 480929fe7cc911b
parent 478 d135f0263960
parent 479 72fca24897e7
child 481 57ec368e771a
Merging additional test
     1.1 --- a/json/src/test/java/org/netbeans/html/json/impl/JSONListTest.java	Tue Jan 21 11:21:23 2014 +0100
     1.2 +++ b/json/src/test/java/org/netbeans/html/json/impl/JSONListTest.java	Tue Jan 21 15:37:40 2014 +0100
     1.3 @@ -45,9 +45,11 @@
     1.4  import java.util.HashMap;
     1.5  import java.util.Map;
     1.6  import net.java.html.BrwsrCtx;
     1.7 +import net.java.html.json.Model;
     1.8  import net.java.html.json.Models;
     1.9  import net.java.html.json.People;
    1.10  import net.java.html.json.Person;
    1.11 +import net.java.html.json.Property;
    1.12  import net.java.html.json.Sex;
    1.13  import org.apidesign.html.context.spi.Contexts;
    1.14  import org.apidesign.html.json.spi.FunctionBinding;
    1.15 @@ -61,6 +63,9 @@
    1.16   *
    1.17   * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.18   */
    1.19 +@Model(className = "JSNLst", properties = {
    1.20 +    @Property(name = "names", type = String.class, array = true)
    1.21 +})
    1.22  public class JSONListTest implements Technology<Object> {
    1.23      private boolean replaceArray;
    1.24      private final Map<String,PropertyBinding> bindings = new HashMap<String,PropertyBinding>();
    1.25 @@ -151,6 +156,11 @@
    1.26          
    1.27          assertEquals(pb.getValue(), this, "I am the model of the array");
    1.28      }
    1.29 +    
    1.30 +    @Test public void toStringOnArrayOfStrings() {
    1.31 +        JSNLst l = new JSNLst("Jarda", "Jirka", "Parda");
    1.32 +        assertEquals(l.toString(), "{\"names\":[\"Jarda\",\"Jirka\",\"Parda\"]}", "Properly quoted");
    1.33 +    }
    1.34  
    1.35      @Override
    1.36      public Object wrapModel(Object model) {