1.1 --- a/javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/ModelTest.java Tue Feb 19 15:42:41 2013 +0100
1.2 +++ b/javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/ModelTest.java Fri Feb 22 08:59:40 2013 +0100
1.3 @@ -33,20 +33,21 @@
1.4 *
1.5 * @author Jaroslav Tulach <jtulach@netbeans.org>
1.6 */
1.7 -@Page(xhtml = "Empty.html", className = "Model", properties = {
1.8 +@Page(xhtml = "Empty.html", className = "Modelik", properties = {
1.9 @Property(name = "value", type = int.class),
1.10 @Property(name = "count", type = int.class),
1.11 @Property(name = "unrelated", type = long.class),
1.12 @Property(name = "names", type = String.class, array = true),
1.13 - @Property(name = "values", type = int.class, array = true)
1.14 + @Property(name = "values", type = int.class, array = true),
1.15 + @Property(name = "people", type = PersonImpl.class, array = true)
1.16 })
1.17 public class ModelTest {
1.18 - private Model model;
1.19 - private static Model leakedModel;
1.20 + private Modelik model;
1.21 + private static Modelik leakedModel;
1.22
1.23 @BeforeMethod
1.24 public void createModel() {
1.25 - model = new Model();
1.26 + model = new Modelik();
1.27 }
1.28
1.29 @Test public void classGeneratedWithSetterGetter() {
1.30 @@ -189,11 +190,21 @@
1.31 }
1.32
1.33 static class MockKnockout extends Knockout {
1.34 - List<String> mutated = new ArrayList<String>();
1.35 + List<String> mutated = new ArrayList<>();
1.36
1.37 @Override
1.38 public void valueHasMutated(String prop) {
1.39 mutated.add(prop);
1.40 }
1.41 }
1.42 +
1.43 + public @Test void hasPersonPropertyAndComputedFullName() {
1.44 + List<Person> arr = model.getPeople();
1.45 + assertEquals(arr.size(), 0, "By default empty");
1.46 + Person p = null;
1.47 + if (p != null) {
1.48 + String fullNameGenerated = p.getFullName();
1.49 + assertNotNull(fullNameGenerated);
1.50 + }
1.51 + }
1.52 }