Search for miranda methods in virtual methods instead of interface.

Also added tests that get miranda methods via reflection and jni.
Miranda methods can't be found via reflection, and have the interface
class as their declaring class when found via jni.

Bug: 11736932
Change-Id: I92b4fdf31be64269898ed2686a28dfb6008b213a
diff --git a/test/run-test b/test/run-test
index f706110..c3943e7 100755
--- a/test/run-test
+++ b/test/run-test
@@ -65,7 +65,7 @@
 dev_mode="no"
 update_mode="no"
 debug_mode="no"
-dalvik_mode="no"
+runtime="art"
 usage="no"
 build_only="no"
 
@@ -77,6 +77,7 @@
         shift
     elif [ "x$1" = "x--jvm" ]; then
         target_mode="no"
+        runtime="jvm"
         RUN="${progdir}/etc/reference-run-test-classes"
         NEED_DEX="false"
         shift
@@ -85,7 +86,7 @@
         shift
     elif [ "x$1" = "x--dalvik" ]; then
         lib="libdvm.so"
-        dalvik_mode="yes"
+        runtime="dalvik"
         shift
     elif [ "x$1" = "x--image" ]; then
         shift
@@ -155,15 +156,11 @@
     fi
 done
 
-run_args="${run_args} --lib $lib"
+if [ ! "$runtime" = "jvm" ]; then
+  run_args="${run_args} --lib $lib"
+fi
 
-if [ "$dalvik_mode" = "no" ]; then
-    if [ "$target_mode" = "no" ]; then
-        run_args="${run_args} --boot -Ximage:${ANDROID_HOST_OUT}/framework/core.art"
-    else
-        run_args="${run_args} --boot -Ximage:/data/art-test/core.art"
-    fi
-else
+if [ "$runtime" = "dalvik" ]; then
     if [ "$target_mode" = "no" ]; then
         framework="${OUT}/system/framework"
         bpath="${framework}/core.jar:${framework}/conscrypt.jar:${framework}/okhttp.jar:${framework}/core-junit.jar:${framework}/bouncycastle.jar:${framework}/ext.jar"
@@ -171,6 +168,12 @@
     else
         true # defaults to using target BOOTCLASSPATH
     fi
+elif [ "$runtime" = "art" ]; then
+    if [ "$target_mode" = "no" ]; then
+        run_args="${run_args} --boot -Ximage:${ANDROID_HOST_OUT}/framework/core.art"
+    else
+        run_args="${run_args} --boot -Ximage:/data/art-test/core.art"
+    fi
 fi
 
 if [ "$dev_mode" = "yes" -a "$update_mode" = "yes" ]; then