ko-archetype/src/main/resources/archetype-resources/src/test/java/IntegrationTest.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 13 May 2013 14:25:37 +0200
changeset 1202 5f04bdbc6ee1
parent 1201 b6fd8b9ccc7a
permissions -rw-r--r--
Moving archetype tests into separate module - at that moment it is possible to use the previously generated archetype
jaroslav@1201
     1
package ${package};
jaroslav@1201
     2
jaroslav@1201
     3
import org.apidesign.bck2brwsr.vmtest.BrwsrTest;
jaroslav@1201
     4
import org.apidesign.bck2brwsr.vmtest.HtmlFragment;
jaroslav@1201
     5
import org.apidesign.bck2brwsr.vmtest.VMTest;
jaroslav@1201
     6
import org.testng.annotations.Factory;
jaroslav@1201
     7
jaroslav@1201
     8
/** Sometimes it is useful to run tests inside of the real browser. 
jaroslav@1201
     9
 * To do that just annotate your method with {@link org.apidesign.bck2brwsr.vmtest.BrwsrTest}
jaroslav@1201
    10
 * and that is it. If your code references elements on the HTML page,
jaroslav@1201
    11
 * you can pass in an {@link org.apidesign.bck2brwsr.vmtest.HtmlFragment} which
jaroslav@1201
    12
 * will be made available on the page before your test starts.
jaroslav@1201
    13
 */
jaroslav@1201
    14
public class IntegrationTest {
jaroslav@1201
    15
    
jaroslav@1201
    16
    /** Write to testing code here. Use <code>assert</code> (but not TestNG's
jaroslav@1201
    17
     * Assert, as TestNG is not compiled with target 1.6 yet).
jaroslav@1201
    18
     */
jaroslav@1201
    19
    @HtmlFragment(
jaroslav@1202
    20
        "<h1>Put this snippet on the HTML page</h1>\n"
jaroslav@1201
    21
    )
jaroslav@1201
    22
    @BrwsrTest
jaroslav@1202
    23
    public void runThisTestInABrowser() {
jaroslav@1201
    24
    }
jaroslav@1201
    25
jaroslav@1201
    26
    @Factory
jaroslav@1201
    27
    public static Object[] create() {
jaroslav@1201
    28
        return VMTest.create(IntegrationTest.class);
jaroslav@1201
    29
    }
jaroslav@1201
    30
    
jaroslav@1201
    31
}