mojo/src/main/resources/archetype-resources/src/test/java/AppTest.java
branchmodel
changeset 528 08cd5a0c967e
parent 514 f761555d8312
child 534 3cefccd50bd5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mojo/src/main/resources/archetype-resources/src/test/java/AppTest.java	Tue Jan 22 09:19:47 2013 +0100
     1.3 @@ -0,0 +1,24 @@
     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.
    1.11 + *
    1.12 + * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.13 + */
    1.14 +public class AppTest {
    1.15 +    private Index model;
    1.16 +    
    1.17 +
    1.18 +    @BeforeMethod
    1.19 +    public void initModel() {
    1.20 +        model = new Index().applyBindings();
    1.21 +    }
    1.22 +
    1.23 +    @Test public void testHelloMessage() {
    1.24 +        model.setName("Joe");
    1.25 +        assertEquals(model.getHelloMessage(), "Hello Joe!", "Cleared after pressing +");
    1.26 +    }
    1.27 +}