1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/rt/mojo/src/main/resources/archetype-resources/src/test/java/AppTest.java Tue Apr 02 15:40:51 2013 +0200
1.3 @@ -0,0 +1,26 @@
1.4 +package ${package};
1.5 +
1.6 +import static org.testng.Assert.*;
1.7 +import org.testng.annotations.BeforeMethod;
1.8 +import org.testng.annotations.Test;
1.9 +
1.10 +/** Demonstrating POJO testing of HTML page model. Runs in good old HotSpot
1.11 + * as it does not reference any HTML elements or browser functionality. Just
1.12 + * operates on the page model.
1.13 + *
1.14 + * @author Jaroslav Tulach <jtulach@netbeans.org>
1.15 + */
1.16 +public class AppTest {
1.17 + private Index model;
1.18 +
1.19 +
1.20 + @BeforeMethod
1.21 + public void initModel() {
1.22 + model = new Index().applyBindings();
1.23 + }
1.24 +
1.25 + @Test public void testHelloMessage() {
1.26 + model.setName("Joe");
1.27 + assertEquals(model.getHelloMessage(), "Hello Joe!", "Cleared after pressing +");
1.28 + }
1.29 +}