diff graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java @ 7717:cf94bd18eb47

lift GraalCompilerTest.getMethod to a common base class
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 05 Feb 2013 15:35:34 +0100
parents 5e3d1a68664e
children 2338b991f14d
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java	Tue Feb 05 15:24:15 2013 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java	Tue Feb 05 15:35:34 2013 +0100
@@ -43,6 +43,7 @@
 import com.oracle.graal.phases.PhasePlan.PhasePosition;
 import com.oracle.graal.phases.schedule.*;
 import com.oracle.graal.printer.*;
+import com.oracle.graal.test.*;
 
 /**
  * Base class for Graal compiler unit tests.
@@ -63,7 +64,7 @@
  * <p>
  * These tests will be run by the {@code mx unittest} command.
  */
-public abstract class GraalCompilerTest {
+public abstract class GraalCompilerTest extends GraalTest {
 
     protected final GraalCodeCacheProvider runtime;
     protected final GraalCompiler graalCompiler;
@@ -146,21 +147,6 @@
         return parse(getMethod(methodName));
     }
 
-    protected Method getMethod(String methodName) {
-        Method found = null;
-        for (Method m : this.getClass().getMethods()) {
-            if (m.getName().equals(methodName)) {
-                Assert.assertNull(found);
-                found = m;
-            }
-        }
-        if (found != null) {
-            return found;
-        } else {
-            throw new RuntimeException("method not found: " + methodName);
-        }
-    }
-
     private static int compilationId = 0;
 
     /**