rt/vm8/src/test/java/org/apidesign/bck2brwsr/vm8/DefaultsTest.java
branchjdk8
changeset 1680 3b553acbd931
parent 1673 2d3d0b72af04
child 1687 baa80d712c77
     1.1 --- a/rt/vm8/src/test/java/org/apidesign/bck2brwsr/vm8/DefaultsTest.java	Sun Aug 17 19:58:05 2014 +0200
     1.2 +++ b/rt/vm8/src/test/java/org/apidesign/bck2brwsr/vm8/DefaultsTest.java	Sat Sep 13 14:37:49 2014 +0200
     1.3 @@ -17,40 +17,24 @@
     1.4   */
     1.5  package org.apidesign.bck2brwsr.vm8;
     1.6  
     1.7 +import org.apidesign.bck2brwsr.vmtest.Compare;
     1.8 +import org.apidesign.bck2brwsr.vmtest.VMTest;
     1.9  import org.testng.annotations.AfterClass;
    1.10  import org.testng.annotations.BeforeClass;
    1.11 +import org.testng.annotations.Factory;
    1.12  import org.testng.annotations.Test;
    1.13  
    1.14  public class DefaultsTest {
    1.15 -    private static TestVM code;
    1.16 -    
    1.17 -    @Test public void callStatic() throws Exception {
    1.18 -        Object js = code.execCode("Value from static method",
    1.19 -            Defaults.class, "staticValue__I", 42
    1.20 -        );
    1.21 +    @Compare public int callStatic() throws Exception {
    1.22 +        return Defaults.defaultValue();
    1.23      }
    1.24  
    1.25 -    @Test public void defaultValue() throws Exception {
    1.26 -        Object js = code.execCode("Value from interface",
    1.27 -            Defaults.class, "defaultValue__I", 42
    1.28 -        );
    1.29 +    @Compare public int overridenValue() throws Exception {
    1.30 +        return Defaults.myValue();
    1.31      }
    1.32  
    1.33 -    @Test public void overridenValue() throws Exception {
    1.34 -        Object js = code.execCode("Value from class",
    1.35 -            Defaults.class, "myValue__I", 7
    1.36 -        );
    1.37 -    }
    1.38 -
    1.39 -    @BeforeClass
    1.40 -    public static void compileTheCode() throws Exception {
    1.41 -        code = TestVM.compileClass(
    1.42 -                "org/apidesign/bck2brwsr/vm8/Defaults");
    1.43 -    }
    1.44 -
    1.45 -    @AfterClass
    1.46 -    public static void releaseTheCode() {
    1.47 -        code = null;
    1.48 +    @Factory public static Object[] create() {
    1.49 +        return VMTest.create(DefaultsTest.class);
    1.50      }
    1.51      
    1.52  }