1.1 --- a/json-tck/pom.xml Thu Jun 20 12:51:26 2013 +0200
1.2 +++ b/json-tck/pom.xml Fri Jun 21 15:54:38 2013 +0200
1.3 @@ -47,12 +47,6 @@
1.4 </exclusions>
1.5 </dependency>
1.6 <dependency>
1.7 - <groupId>org.apidesign.bck2brwsr</groupId>
1.8 - <artifactId>vmtest</artifactId>
1.9 - <version>${bck2brwsr.version}</version>
1.10 - <type>jar</type>
1.11 - </dependency>
1.12 - <dependency>
1.13 <groupId>org.netbeans.api</groupId>
1.14 <artifactId>org-openide-util</artifactId>
1.15 <scope>provided</scope>
2.1 --- a/json-tck/src/main/java/net/java/html/json/tests/ConvertTypesTest.java Thu Jun 20 12:51:26 2013 +0200
2.2 +++ b/json-tck/src/main/java/net/java/html/json/tests/ConvertTypesTest.java Fri Jun 21 15:54:38 2013 +0200
2.3 @@ -27,9 +27,8 @@
2.4 import java.util.Map;
2.5 import net.java.html.BrwsrCtx;
2.6 import net.java.html.json.Models;
2.7 -import org.apidesign.bck2brwsr.vmtest.BrwsrTest;
2.8 -import org.apidesign.bck2brwsr.vmtest.VMTest;
2.9 import org.apidesign.html.json.impl.JSON;
2.10 +import org.apidesign.html.json.tck.KOTest;
2.11
2.12 /**
2.13 *
2.14 @@ -61,7 +60,7 @@
2.15 return Utils.createObject(map, ConvertTypesTest.class);
2.16 }
2.17
2.18 - @BrwsrTest
2.19 + @KOTest
2.20 public void testConvertToPeople() throws Exception {
2.21 final Object o = createJSON(true);
2.22
2.23 @@ -72,7 +71,7 @@
2.24 assert Sex.MALE.equals(p.getSex()) : "Sex: " + p.getSex();
2.25 }
2.26
2.27 - @BrwsrTest
2.28 + @KOTest
2.29 public void parseConvertToPeople() throws Exception {
2.30 final BrwsrCtx c = newContext();
2.31 final InputStream o = createIS(true, false);
2.32 @@ -84,7 +83,7 @@
2.33 assert Sex.MALE.equals(p.getSex()) : "Sex: " + p.getSex();
2.34 }
2.35
2.36 - @BrwsrTest
2.37 + @KOTest
2.38 public void parseConvertToPeopleWithAddress() throws Exception {
2.39 final BrwsrCtx c = newContext();
2.40 final InputStream o = createIS(true, true);
2.41 @@ -98,7 +97,7 @@
2.42 assert p.getAddress().getStreet().equals("Schnirchova") : "Is Schnirchova: " + p.getAddress();
2.43 }
2.44
2.45 - @BrwsrTest
2.46 + @KOTest
2.47 public void testConvertToPeopleWithoutSex() throws Exception {
2.48 final Object o = createJSON(false);
2.49
2.50 @@ -109,7 +108,7 @@
2.51 assert p.getSex() == null : "No sex: " + p.getSex();
2.52 }
2.53
2.54 - @BrwsrTest
2.55 + @KOTest
2.56 public void parseConvertToPeopleWithoutSex() throws Exception {
2.57 final BrwsrCtx c = newContext();
2.58 final InputStream o = createIS(false, false);
2.59 @@ -123,8 +122,4 @@
2.60 private static BrwsrCtx newContext() {
2.61 return Utils.newContext(ConvertTypesTest.class);
2.62 }
2.63 -
2.64 - static Object[] create() {
2.65 - return VMTest.create(ConvertTypesTest.class);
2.66 - }
2.67 }
2.68 \ No newline at end of file
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/json-tck/src/main/java/net/java/html/json/tests/Http.java Fri Jun 21 15:54:38 2013 +0200
3.3 @@ -0,0 +1,41 @@
3.4 +/**
3.5 + * HTML via Java(tm) Language Bindings
3.6 + * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
3.7 + *
3.8 + * This program is free software: you can redistribute it and/or modify
3.9 + * it under the terms of the GNU General Public License as published by
3.10 + * the Free Software Foundation, version 2 of the License.
3.11 + *
3.12 + * This program is distributed in the hope that it will be useful,
3.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.15 + * GNU General Public License for more details. apidesign.org
3.16 + * designates this particular file as subject to the
3.17 + * "Classpath" exception as provided by apidesign.org
3.18 + * in the License file that accompanied this code.
3.19 + *
3.20 + * You should have received a copy of the GNU General Public License
3.21 + * along with this program. Look for COPYING file in the top folder.
3.22 + * If not, see http://wiki.apidesign.org/wiki/GPLwithClassPathException
3.23 + */
3.24 +/*
3.25 + * To change this license header, choose License Headers in Project Properties.
3.26 + * To change this template file, choose Tools | Templates
3.27 + * and open the template in the editor.
3.28 + */
3.29 +package net.java.html.json.tests;
3.30 +
3.31 +/**
3.32 + *
3.33 + * @author Jaroslav Tulach <jtulach@netbeans.org>
3.34 + */
3.35 +@interface Http {
3.36 + Resource[] value();
3.37 +
3.38 + @interface Resource {
3.39 + String content();
3.40 + String path();
3.41 + String mimeType();
3.42 + String[] parameters() default {};
3.43 + }
3.44 +}
4.1 --- a/json-tck/src/main/java/net/java/html/json/tests/JSONTest.java Thu Jun 20 12:51:26 2013 +0200
4.2 +++ b/json-tck/src/main/java/net/java/html/json/tests/JSONTest.java Fri Jun 21 15:54:38 2013 +0200
4.3 @@ -26,10 +26,8 @@
4.4 import net.java.html.json.Models;
4.5 import net.java.html.json.OnReceive;
4.6 import net.java.html.json.Property;
4.7 -import org.apidesign.bck2brwsr.vmtest.BrwsrTest;
4.8 -import org.apidesign.bck2brwsr.vmtest.Http;
4.9 -import org.apidesign.bck2brwsr.vmtest.VMTest;
4.10 import org.apidesign.html.json.impl.JSON;
4.11 +import org.apidesign.html.json.tck.KOTest;
4.12
4.13 /** Need to verify that models produce reasonable JSON objects.
4.14 *
4.15 @@ -45,7 +43,7 @@
4.16 private JSONik js;
4.17 private Integer orig;
4.18
4.19 - @BrwsrTest public void toJSONInABrowser() throws Throwable {
4.20 + @KOTest public void toJSONInABrowser() throws Throwable {
4.21 Person p = Models.bind(new Person(), newContext());
4.22 p.setSex(Sex.MALE);
4.23 p.setFirstName("Jarda");
4.24 @@ -95,7 +93,7 @@
4.25 path="/person.json",
4.26 mimeType = "application/json"
4.27 ))
4.28 - @BrwsrTest public void loadAndParseJSON() throws InterruptedException {
4.29 + @KOTest public void loadAndParseJSON() throws InterruptedException {
4.30 if (js == null) {
4.31 js = Models.bind(new JSONik(), newContext());
4.32 js.applyBindings();
4.33 @@ -123,7 +121,7 @@
4.34 mimeType = "application/javascript",
4.35 parameters = { "callme" }
4.36 ))
4.37 - @BrwsrTest public void loadAndParseJSONP() throws InterruptedException, Exception {
4.38 + @KOTest public void loadAndParseJSONP() throws InterruptedException, Exception {
4.39
4.40 if (js == null) {
4.41 orig = scriptElements();
4.42 @@ -161,7 +159,7 @@
4.43 mimeType = "text/plain",
4.44 parameters = { "http.method", "http.requestBody" }
4.45 ))
4.46 - @BrwsrTest public void putPeopleUsesRightMethod() throws InterruptedException, Exception {
4.47 + @KOTest public void putPeopleUsesRightMethod() throws InterruptedException, Exception {
4.48 if (js == null) {
4.49 orig = scriptElements();
4.50 assert orig > 0 : "There should be some scripts on the page";
4.51 @@ -210,7 +208,7 @@
4.52 path="/person.json",
4.53 mimeType = "application/json"
4.54 ))
4.55 - @BrwsrTest public void loadAndParseJSONSentToArray() throws InterruptedException {
4.56 + @KOTest public void loadAndParseJSONSentToArray() throws InterruptedException {
4.57 if (js == null) {
4.58 js = Models.bind(new JSONik(), newContext());
4.59 js.applyBindings();
4.60 @@ -232,7 +230,7 @@
4.61 path="/person.json",
4.62 mimeType = "application/json"
4.63 ))
4.64 - @BrwsrTest public void loadAndParseJSONArraySingle() throws InterruptedException {
4.65 + @KOTest public void loadAndParseJSONArraySingle() throws InterruptedException {
4.66 if (js == null) {
4.67 js = Models.bind(new JSONik(), newContext());
4.68 js.applyBindings();
4.69 @@ -254,7 +252,7 @@
4.70 path="/people.json",
4.71 mimeType = "application/json"
4.72 ))
4.73 - @BrwsrTest public void loadAndParseArrayInPeople() throws InterruptedException {
4.74 + @KOTest public void loadAndParseArrayInPeople() throws InterruptedException {
4.75 if (js == null) {
4.76 js = Models.bind(new JSONik(), newContext());
4.77 js.applyBindings();
4.78 @@ -280,7 +278,7 @@
4.79 path="/people.json",
4.80 mimeType = "application/json"
4.81 ))
4.82 - @BrwsrTest public void loadAndParseArrayOfIntegers() throws InterruptedException {
4.83 + @KOTest public void loadAndParseArrayOfIntegers() throws InterruptedException {
4.84 if (js == null) {
4.85 js = Models.bind(new JSONik(), newContext());
4.86 js.applyBindings();
4.87 @@ -307,7 +305,7 @@
4.88 path="/people.json",
4.89 mimeType = "application/json"
4.90 ))
4.91 - @BrwsrTest public void loadAndParseArrayOfEnums() throws InterruptedException {
4.92 + @KOTest public void loadAndParseArrayOfEnums() throws InterruptedException {
4.93 if (js == null) {
4.94 js = Models.bind(new JSONik(), newContext());
4.95 js.applyBindings();
4.96 @@ -334,7 +332,7 @@
4.97 path="/person.json",
4.98 mimeType = "application/json"
4.99 ))
4.100 - @BrwsrTest public void loadAndParseJSONArray() throws InterruptedException {
4.101 + @KOTest public void loadAndParseJSONArray() throws InterruptedException {
4.102 if (js == null) {
4.103 js = Models.bind(new JSONik(), newContext());
4.104 js.applyBindings();
4.105 @@ -360,7 +358,7 @@
4.106 static class NandV {
4.107 }
4.108
4.109 - @BrwsrTest public void parseNullNumber() throws Exception {
4.110 + @KOTest public void parseNullNumber() throws Exception {
4.111 String txt = "{ \"name\":\"M\" }";
4.112 ByteArrayInputStream is = new ByteArrayInputStream(txt.getBytes("UTF-8"));
4.113 NameAndValue v = Models.parse(newContext(), NameAndValue.class, is);
4.114 @@ -373,8 +371,4 @@
4.115 return Utils.newContext(JSONTest.class);
4.116 }
4.117
4.118 - static Object[] create() {
4.119 - return VMTest.create(JSONTest.class);
4.120 - }
4.121 -
4.122 }
5.1 --- a/json-tck/src/main/java/net/java/html/json/tests/KnockoutTest.java Thu Jun 20 12:51:26 2013 +0200
5.2 +++ b/json-tck/src/main/java/net/java/html/json/tests/KnockoutTest.java Fri Jun 21 15:54:38 2013 +0200
5.3 @@ -27,9 +27,7 @@
5.4 import net.java.html.json.Model;
5.5 import net.java.html.json.Models;
5.6 import net.java.html.json.Property;
5.7 -import org.apidesign.bck2brwsr.vmtest.BrwsrTest;
5.8 -import org.apidesign.bck2brwsr.vmtest.HtmlFragment;
5.9 -import org.apidesign.bck2brwsr.vmtest.VMTest;
5.10 +import org.apidesign.html.json.tck.KOTest;
5.11
5.12 /**
5.13 *
5.14 @@ -44,22 +42,23 @@
5.15 })
5.16 public final class KnockoutTest {
5.17
5.18 - @HtmlFragment(
5.19 - "<h1 data-bind=\"text: helloMessage\">Loading Bck2Brwsr's Hello World...</h1>\n" +
5.20 - "Your name: <input id='input' data-bind=\"value: name\"></input>\n" +
5.21 - "<button id=\"hello\">Say Hello!</button>\n"
5.22 - )
5.23 - @BrwsrTest public void modifyValueAssertChangeInModel() throws Exception {
5.24 + @KOTest public void modifyValueAssertChangeInModel() throws Exception {
5.25 + Object exp = Utils.exposeHTML(KnockoutTest.class,
5.26 + "<h1 data-bind=\"text: helloMessage\">Loading Bck2Brwsr's Hello World...</h1>\n" +
5.27 + "Your name: <input id='input' data-bind=\"value: name\"></input>\n" +
5.28 + "<button id=\"hello\">Say Hello!</button>\n"
5.29 + );
5.30 +
5.31 KnockoutModel m = Models.bind(new KnockoutModel(), newContext());
5.32 m.setName("Kukuc");
5.33 m.applyBindings();
5.34 -
5.35 +
5.36 String v = getSetInput(null);
5.37 assert "Kukuc".equals(v) : "Value is really kukuc: " + v;
5.38 -
5.39 +
5.40 getSetInput("Jardo");
5.41 triggerEvent("input", "change");
5.42 -
5.43 +
5.44 assert "Jardo".equals(m.getName()) : "Name property updated: " + m.getName();
5.45 }
5.46
5.47 @@ -82,82 +81,86 @@
5.48 );
5.49 }
5.50
5.51 - @HtmlFragment(
5.52 - "<ul id='ul' data-bind='foreach: results'>\n"
5.53 - + " <li data-bind='text: $data, click: $root.call'/>\n"
5.54 - + "</ul>\n"
5.55 - )
5.56 - @BrwsrTest public void displayContentOfArray() throws Exception {
5.57 + @KOTest public void displayContentOfArray() throws Exception {
5.58 + Object exp = Utils.exposeHTML(KnockoutTest.class,
5.59 + "<ul id='ul' data-bind='foreach: results'>\n"
5.60 + + " <li data-bind='text: $data, click: $root.call'/>\n"
5.61 + + "</ul>\n"
5.62 + );
5.63 +
5.64 KnockoutModel m = Models.bind(new KnockoutModel(), newContext());
5.65 m.getResults().add("Ahoj");
5.66 m.applyBindings();
5.67 -
5.68 +
5.69 int cnt = countChildren("ul");
5.70 assert cnt == 1 : "One child, but was " + cnt;
5.71 -
5.72 +
5.73 m.getResults().add("Hi");
5.74
5.75 cnt = countChildren("ul");
5.76 assert cnt == 2 : "Two children now, but was " + cnt;
5.77 -
5.78 +
5.79 triggerChildClick("ul", 1);
5.80 -
5.81 +
5.82 assert 1 == m.getCallbackCount() : "One callback " + m.getCallbackCount();
5.83 assert "Hi".equals(m.getName()) : "We got callback from 2nd child " + m.getName();
5.84 }
5.85
5.86 - @HtmlFragment(
5.87 - "<input type='checkbox' id='b' data-bind='checked: enabled'></input>\n"
5.88 - )
5.89 - @BrwsrTest public void checkBoxToBooleanBinding() throws Exception {
5.90 + @KOTest public void checkBoxToBooleanBinding() throws Exception {
5.91 + Object exp = Utils.exposeHTML(KnockoutTest.class,
5.92 + "<input type='checkbox' id='b' data-bind='checked: enabled'></input>\n"
5.93 + );
5.94 +
5.95 KnockoutModel m = Models.bind(new KnockoutModel(), newContext());
5.96 m.applyBindings();
5.97 -
5.98 +
5.99 assert !m.isEnabled() : "Is disabled";
5.100
5.101 triggerClick("b");
5.102 -
5.103 +
5.104 assert m.isEnabled() : "Now the model is enabled";
5.105 }
5.106
5.107
5.108
5.109 - @HtmlFragment(
5.110 - "<ul id='ul' data-bind='foreach: cmpResults'>\n"
5.111 - + " <li><b data-bind='text: $data'></b></li>\n"
5.112 - + "</ul>\n"
5.113 - )
5.114 - @BrwsrTest public void displayContentOfDerivedArray() throws Exception {
5.115 + @KOTest public void displayContentOfDerivedArray() throws Exception {
5.116 + Object exp = Utils.exposeHTML(KnockoutTest.class,
5.117 + "<ul id='ul' data-bind='foreach: cmpResults'>\n"
5.118 + + " <li><b data-bind='text: $data'></b></li>\n"
5.119 + + "</ul>\n"
5.120 + );
5.121 +
5.122 KnockoutModel m = Models.bind(new KnockoutModel(), newContext());
5.123 m.getResults().add("Ahoj");
5.124 m.applyBindings();
5.125 -
5.126 +
5.127 int cnt = countChildren("ul");
5.128 assert cnt == 1 : "One child, but was " + cnt;
5.129 -
5.130 +
5.131 m.getResults().add("hello");
5.132
5.133 cnt = countChildren("ul");
5.134 assert cnt == 2 : "Two children now, but was " + cnt;
5.135 }
5.136
5.137 - @HtmlFragment(
5.138 - "<ul id='ul' data-bind='foreach: people'>\n"
5.139 - + " <li data-bind='text: $data.firstName, click: $root.removePerson'></li>\n"
5.140 - + "</ul>\n"
5.141 - )
5.142 - @BrwsrTest public void displayContentOfArrayOfPeople() throws Exception {
5.143 + @KOTest public void displayContentOfArrayOfPeople() throws Exception {
5.144 + Object exp = Utils.exposeHTML(KnockoutTest.class,
5.145 + "<ul id='ul' data-bind='foreach: people'>\n"
5.146 + + " <li data-bind='text: $data.firstName, click: $root.removePerson'></li>\n"
5.147 + + "</ul>\n"
5.148 + );
5.149 +
5.150 KnockoutModel m = Models.bind(new KnockoutModel(), newContext());
5.151 -
5.152 +
5.153 final Person first = Models.bind(new Person(), newContext());
5.154 first.setFirstName("first");
5.155 m.getPeople().add(first);
5.156 -
5.157 +
5.158 m.applyBindings();
5.159 -
5.160 +
5.161 int cnt = countChildren("ul");
5.162 assert cnt == 1 : "One child, but was " + cnt;
5.163 -
5.164 +
5.165 final Person second = Models.bind(new Person(), newContext());
5.166 second.setFirstName("second");
5.167 m.getPeople().add(second);
5.168 @@ -166,17 +169,17 @@
5.169 assert cnt == 2 : "Two children now, but was " + cnt;
5.170
5.171 triggerChildClick("ul", 1);
5.172 -
5.173 +
5.174 assert 1 == m.getCallbackCount() : "One callback " + m.getCallbackCount();
5.175
5.176 cnt = countChildren("ul");
5.177 assert cnt == 1 : "Again one child, but was " + cnt;
5.178 -
5.179 +
5.180 String txt = childText("ul", 0);
5.181 assert "first".equals(txt) : "Expecting 'first': " + txt;
5.182 -
5.183 +
5.184 first.setFirstName("changed");
5.185 -
5.186 +
5.187 txt = childText("ul", 0);
5.188 assert "changed".equals(txt) : "Expecting 'changed': " + txt;
5.189 }
5.190 @@ -186,21 +189,23 @@
5.191 return people.isEmpty() ? null : people.get(0);
5.192 }
5.193
5.194 - @HtmlFragment(
5.195 - "<p id='ul' data-bind='with: firstPerson'>\n"
5.196 - + " <span data-bind='text: firstName, click: changeSex'></span>\n"
5.197 - + "</p>\n"
5.198 - )
5.199 - @BrwsrTest public void accessFirstPersonWithOnFunction() throws Exception {
5.200 + @KOTest public void accessFirstPersonWithOnFunction() throws Exception {
5.201 + Object exp = Utils.exposeHTML(KnockoutTest.class,
5.202 + "<p id='ul' data-bind='with: firstPerson'>\n"
5.203 + + " <span data-bind='text: firstName, click: changeSex'></span>\n"
5.204 + + "</p>\n"
5.205 + );
5.206 +
5.207 trasfertToFemale();
5.208 }
5.209
5.210 - @HtmlFragment(
5.211 - "<ul id='ul' data-bind='foreach: people'>\n"
5.212 - + " <li data-bind='text: $data.firstName, click: changeSex'></li>\n"
5.213 - + "</ul>\n"
5.214 - )
5.215 - @BrwsrTest public void onPersonFunction() throws Exception {
5.216 + @KOTest public void onPersonFunction() throws Exception {
5.217 + Object exp = Utils.exposeHTML(KnockoutTest.class,
5.218 + "<ul id='ul' data-bind='foreach: people'>\n"
5.219 + + " <li data-bind='text: $data.firstName, click: changeSex'></li>\n"
5.220 + + "</ul>\n"
5.221 + );
5.222 +
5.223 trasfertToFemale();
5.224 }
5.225
5.226 @@ -247,10 +252,6 @@
5.227 return results;
5.228 }
5.229
5.230 - static Object[] create() {
5.231 - return VMTest.create(KnockoutTest.class);
5.232 - }
5.233 -
5.234 private static int countChildren(String id) throws Exception {
5.235 return ((Number)Utils.executeScript(
5.236 KnockoutTest.class,
6.1 --- a/json-tck/src/main/java/net/java/html/json/tests/Utils.java Thu Jun 20 12:51:26 2013 +0200
6.2 +++ b/json-tck/src/main/java/net/java/html/json/tests/Utils.java Fri Jun 21 15:54:38 2013 +0200
6.3 @@ -60,6 +60,19 @@
6.4 throw new AssertionError("Can't find appropriate Context in ServiceLoader!");
6.5 }
6.6
6.7 + static Object exposeHTML(Class<?> clazz, String html) throws Exception {
6.8 + String s =
6.9 + "var n = window.document.getElementById('ko.test.div'); \n "
6.10 + + "if (!n) { \n"
6.11 + + " n = window.document.createElement('div'); \n "
6.12 + + " n.id = 'ko.test.div'; \n "
6.13 + + " var body = window.document.getElementsByTagName('body')[0];\n"
6.14 + + " body.appendChild(n); return n;\n"
6.15 + + "}\n"
6.16 + + "n.innerHTML = arguments[0]; \n ";
6.17 + return executeScript(clazz, s, html);
6.18 + }
6.19 +
6.20 private static ClassLoader cl(Class<?> c) {
6.21 try {
6.22 return c.getClassLoader();
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/json-tck/src/main/java/org/apidesign/html/json/tck/KOTest.java Fri Jun 21 15:54:38 2013 +0200
7.3 @@ -0,0 +1,38 @@
7.4 +/**
7.5 + * HTML via Java(tm) Language Bindings
7.6 + * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
7.7 + *
7.8 + * This program is free software: you can redistribute it and/or modify
7.9 + * it under the terms of the GNU General Public License as published by
7.10 + * the Free Software Foundation, version 2 of the License.
7.11 + *
7.12 + * This program is distributed in the hope that it will be useful,
7.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7.15 + * GNU General Public License for more details. apidesign.org
7.16 + * designates this particular file as subject to the
7.17 + * "Classpath" exception as provided by apidesign.org
7.18 + * in the License file that accompanied this code.
7.19 + *
7.20 + * You should have received a copy of the GNU General Public License
7.21 + * along with this program. Look for COPYING file in the top folder.
7.22 + * If not, see http://wiki.apidesign.org/wiki/GPLwithClassPathException
7.23 + */
7.24 +package org.apidesign.html.json.tck;
7.25 +
7.26 +import java.lang.annotation.ElementType;
7.27 +import java.lang.annotation.Retention;
7.28 +import java.lang.annotation.RetentionPolicy;
7.29 +import java.lang.annotation.Target;
7.30 +
7.31 +/** Annotates method that is part of {@link KnockoutTCK test compatibility kit}
7.32 + * and should be executed in appropriate environment. The method annotated by
7.33 + * this annotation will be public instance method of its class
7.34 + * with no arguments.
7.35 + *
7.36 + * @author Jaroslav Tulach <jtulach@netbeans.org>
7.37 + */
7.38 +@Retention(RetentionPolicy.RUNTIME)
7.39 +@Target(ElementType.METHOD)
7.40 +public @interface KOTest {
7.41 +}
8.1 --- a/json-tck/src/main/java/org/apidesign/html/json/tck/KnockoutTCK.java Thu Jun 20 12:51:26 2013 +0200
8.2 +++ b/json-tck/src/main/java/org/apidesign/html/json/tck/KnockoutTCK.java Fri Jun 21 15:54:38 2013 +0200
8.3 @@ -25,8 +25,6 @@
8.4 import net.java.html.json.tests.ConvertTypesTest;
8.5 import net.java.html.json.tests.KnockoutTest;
8.6 import net.java.html.json.tests.JSONTest;
8.7 -import org.apidesign.bck2brwsr.vmtest.BrwsrTest;
8.8 -import org.apidesign.bck2brwsr.vmtest.VMTest;
8.9 import org.openide.util.lookup.ServiceProvider;
8.10
8.11 /** Entry point for providers of different HTML binding technologies (like
8.12 @@ -69,8 +67,9 @@
8.13 */
8.14 public abstract Object executeScript(String script, Object[] arguments);
8.15
8.16 - /** Gives you list of classes included in the TCK. Send them
8.17 - * to {@link VMTest#create(java.lang.Class)} factory method.
8.18 + /** Gives you list of classes included in the TCK. Their test methods
8.19 + * are annotated by {@link KOTest} annotation. The methods are public
8.20 + * instance methods that take no arguments.
8.21 *
8.22 * @return classes with methods annotated by {@link BrwsrTest} annotation
8.23 */
9.1 --- a/ko-fx/pom.xml Thu Jun 20 12:51:26 2013 +0200
9.2 +++ b/ko-fx/pom.xml Fri Jun 21 15:54:38 2013 +0200
9.3 @@ -73,5 +73,12 @@
9.4 <version>${project.version}</version>
9.5 <type>jar</type>
9.6 </dependency>
9.7 + <dependency>
9.8 + <groupId>org.apidesign.bck2brwsr</groupId>
9.9 + <artifactId>vmtest</artifactId>
9.10 + <version>0.8-SNAPSHOT</version>
9.11 + <scope>test</scope>
9.12 + <type>jar</type>
9.13 + </dependency>
9.14 </dependencies>
9.15 </project>
10.1 --- a/ko-fx/src/test/java/org/apidesign/html/kofx/KnockoutFXTest.java Thu Jun 20 12:51:26 2013 +0200
10.2 +++ b/ko-fx/src/test/java/org/apidesign/html/kofx/KnockoutFXTest.java Fri Jun 21 15:54:38 2013 +0200
10.3 @@ -27,6 +27,7 @@
10.4 import org.apidesign.html.context.spi.Contexts;
10.5 import org.apidesign.html.json.spi.Technology;
10.6 import org.apidesign.html.json.spi.Transfer;
10.7 +import org.apidesign.html.json.tck.KOTest;
10.8 import org.apidesign.html.json.tck.KnockoutTCK;
10.9 import org.json.JSONException;
10.10 import org.json.JSONObject;
10.11 @@ -43,7 +44,10 @@
10.12 }
10.13
10.14 @Factory public static Object[] compatibilityTests() {
10.15 - return VMTest.newTests().withClasses(testClasses()).withLaunchers("fxbrwsr").build();
10.16 + return VMTest.newTests().
10.17 + withClasses(testClasses()).
10.18 + withTestAnnotation(KOTest.class).
10.19 + withLaunchers("fxbrwsr").build();
10.20 }
10.21
10.22 @Override