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