diff truffle/com.oracle.truffle.tools.test/src/com/oracle/truffle/tools/test/TruffleToolTest.java @ 22219:1c0f490984d5

Merge with f47b601edbc626dcfe8b3636933b4834c89f7779
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Wed, 16 Sep 2015 15:36:22 -0700
parents dc83cc1f94f2 3aad794eec0e
children 964e789e17f7
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.tools.test/src/com/oracle/truffle/tools/test/TruffleToolTest.java	Wed Sep 16 12:27:08 2015 +0200
+++ b/truffle/com.oracle.truffle.tools.test/src/com/oracle/truffle/tools/test/TruffleToolTest.java	Wed Sep 16 15:36:22 2015 -0700
@@ -24,21 +24,25 @@
  */
 package com.oracle.truffle.tools.test;
 
-import com.oracle.truffle.api.instrument.InstrumentationTool;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 
+import com.oracle.truffle.api.instrument.InstrumentationTool;
+import com.oracle.truffle.api.instrument.Instrumenter;
+
 /**
  * Test the basic life cycle properties shared by all instances of {@link InstrumentationTool}.
  */
 public class TruffleToolTest {
 
     @Test
-    public void testEmptyLifeCycle() {
+    public void testEmptyLifeCycle() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
+        final Instrumenter instrumenter = TestNodes.createInstrumenter();
         final DummyTruffleTool tool = new DummyTruffleTool();
         assertFalse(tool.isEnabled());
-        tool.install();
+        tool.install(instrumenter);
         assertTrue(tool.isEnabled());
         tool.reset();
         assertTrue(tool.isEnabled());
@@ -73,40 +77,45 @@
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testAlreadyInstalled() {
+    public void testAlreadyInstalled() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
+        final Instrumenter instrumenter = TestNodes.createInstrumenter();
         final DummyTruffleTool tool = new DummyTruffleTool();
-        tool.install();
-        tool.install();
+        tool.install(instrumenter);
+        tool.install(instrumenter);
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testAlreadyDisposed1() {
+    public void testAlreadyDisposed1() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
+        final Instrumenter instrumenter = TestNodes.createInstrumenter();
         final DummyTruffleTool tool = new DummyTruffleTool();
-        tool.install();
+        tool.install(instrumenter);
         tool.dispose();
-        tool.install();
+        tool.install(instrumenter);
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testAlreadyDisposed2() {
+    public void testAlreadyDisposed2() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
+        final Instrumenter instrumenter = TestNodes.createInstrumenter();
         final DummyTruffleTool tool = new DummyTruffleTool();
-        tool.install();
+        tool.install(instrumenter);
         tool.dispose();
         tool.reset();
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testAlreadyDisposed3() {
+    public void testAlreadyDisposed3() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
+        final Instrumenter instrumenter = TestNodes.createInstrumenter();
         final DummyTruffleTool tool = new DummyTruffleTool();
-        tool.install();
+        tool.install(instrumenter);
         tool.dispose();
         tool.setEnabled(true);
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testAlreadyDisposed4() {
+    public void testAlreadyDisposed4() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
+        final Instrumenter instrumenter = TestNodes.createInstrumenter();
         final DummyTruffleTool tool = new DummyTruffleTool();
-        tool.install();
+        tool.install(instrumenter);
         tool.dispose();
         tool.dispose();
     }