comparison truffle/com.oracle.truffle.tools.test/src/com/oracle/truffle/tools/test/CoverageTrackerTest.java @ 22335:906a5f6e07cc

Giving the PolyglotEngine builder factory method more sensible name.
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Mon, 02 Nov 2015 19:13:21 +0100
parents 0d36601f233e
children
comparison
equal deleted inserted replaced
22334:c12a7960bd7b 22335:906a5f6e07cc
42 42
43 public class CoverageTrackerTest { 43 public class CoverageTrackerTest {
44 44
45 @Test 45 @Test
46 public void testNoExecution() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { 46 public void testNoExecution() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
47 final PolyglotEngine vm = PolyglotEngine.buildNew().build(); 47 final PolyglotEngine vm = PolyglotEngine.newBuilder().build();
48 final Field field = PolyglotEngine.class.getDeclaredField("instrumenter"); 48 final Field field = PolyglotEngine.class.getDeclaredField("instrumenter");
49 field.setAccessible(true); 49 field.setAccessible(true);
50 final Instrumenter instrumenter = (Instrumenter) field.get(vm); 50 final Instrumenter instrumenter = (Instrumenter) field.get(vm);
51 instrumenter.registerASTProber(new ToolTestUtil.TestASTProber()); 51 instrumenter.registerASTProber(new ToolTestUtil.TestASTProber());
52 final CoverageTracker tool = new CoverageTracker(); 52 final CoverageTracker tool = new CoverageTracker();
70 assertTrue(Arrays.equals(resultCounts, expectedCounts)); 70 assertTrue(Arrays.equals(resultCounts, expectedCounts));
71 } 71 }
72 72
73 @Test 73 @Test
74 public void testCountingCoverage() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, IOException { 74 public void testCountingCoverage() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, IOException {
75 final PolyglotEngine vm = PolyglotEngine.buildNew().build(); 75 final PolyglotEngine vm = PolyglotEngine.newBuilder().build();
76 final Field field = PolyglotEngine.class.getDeclaredField("instrumenter"); 76 final Field field = PolyglotEngine.class.getDeclaredField("instrumenter");
77 field.setAccessible(true); 77 field.setAccessible(true);
78 final Instrumenter instrumenter = (Instrumenter) field.get(vm); 78 final Instrumenter instrumenter = (Instrumenter) field.get(vm);
79 instrumenter.registerASTProber(new ToolTestUtil.TestASTProber()); 79 instrumenter.registerASTProber(new ToolTestUtil.TestASTProber());
80 final Source source = ToolTestUtil.createTestSource("testCountingCoverage"); 80 final Source source = ToolTestUtil.createTestSource("testCountingCoverage");