rt/mojo/src/main/resources/archetype-resources/src/test/java/IntegrationTest.java
Moving modules around so the runtime is under one master pom and can be built without building other modules that are in the repository
3 import org.apidesign.bck2brwsr.htmlpage.api.OnEvent;
4 import org.apidesign.bck2brwsr.vmtest.BrwsrTest;
5 import org.apidesign.bck2brwsr.vmtest.HtmlFragment;
6 import org.apidesign.bck2brwsr.vmtest.VMTest;
7 import org.testng.annotations.Factory;
9 /** Sometimes it is useful to run tests inside of the real browser.
10 * To do that just annotate your method with {@link org.apidesign.bck2brwsr.vmtest.BrwsrTest}
11 * and that is it. If your code references elements on the HTML page,
12 * you can pass in an {@link org.apidesign.bck2brwsr.vmtest.HtmlFragment} which
13 * will be made available on the page before your test starts.
15 * @author Jaroslav Tulach <jtulach@netbeans.org>
17 public class IntegrationTest {
19 /** Write to testing code here. Use <code>assert</code> (but not TestNG's
20 * Assert, as TestNG is not compiled with target 1.6 yet).
23 "<h1 data-bind=\"text: helloMessage\">Loading Bck2Brwsr's Hello World...</h1>\n" +
24 "Your name: <input id='input' data-bind=\"value: name, valueUpdate: 'afterkeydown'\"></input>\n" +
25 "<button id=\"hello\">Say Hello!</button>\n" +
27 " <canvas id=\"canvas\" width=\"300\" height=\"50\"></canvas>\n" +
31 public void modifyValueAssertChangeInModel() {
32 Index m = new Index();
33 m.setName("Joe Hacker");
35 assert "Joe Hacker".equals(m.INPUT.getValue()) : "Value is really Joe Hacker: " + m.INPUT.getValue();
36 m.INPUT.setValue("Happy Joe");
37 m.triggerEvent(m.INPUT, OnEvent.CHANGE);
38 assert "Happy Joe".equals(m.getName()) : "Name property updated to Happy Joe: " + m.getName();
42 public static Object[] create() {
43 return VMTest.create(IntegrationTest.class);