Add jvmti redefinition tests.
This imports a subset of the jvmti run-tests from the art project.
Imported tests are:
* 902-hello-transformation
* 914-hello-obsolescence
* 915-obsolete-2
* 917-fields-transformation
* 919-obsolete-fields
* 926-multi-obsolescence
* 930-hello-retransform
* 932-transform-saves
* 940-recursive-obsolete
* 942-private-recursive
* 944-transform-classloaders
* 945-obsolete-native
* 947-reflect-method
* 951-threaded-obsolete
* 981-dedup-original-dex
* 982-ok-no-retransform
* 984-obsolete-invoke
Bug: 32072923
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest902HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest914HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest915HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest917HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest919HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest926HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest930HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest932HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest940HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest942HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest944HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest945HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest947HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest951HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest981HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest982HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest984HostTestCases
Change-Id: I005858a8a2c53057af2650c00287a630b10627f3
(cherry picked from commit fce0a5c2bb1c31e3298e889c96e175f3096740aa)
Merged-In: I1e6bb37ede7f4cf0d390cc7e8ac3d7b1863a3797
diff --git a/hostsidetests/jvmti/run-tests/test-942/Android.mk b/hostsidetests/jvmti/run-tests/test-942/Android.mk
new file mode 100644
index 0000000..d2605b7
--- /dev/null
+++ b/hostsidetests/jvmti/run-tests/test-942/Android.mk
@@ -0,0 +1,26 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := CtsJvmtiRunTest942HostTestCases
+LOCAL_STATIC_JAVA_LIBRARIES := CtsJvmtiHostTestBase
+LOCAL_MODULE_TAGS := tests
+LOCAL_COMPATIBILITY_SUITE := cts
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/jvmti/run-tests/test-942/AndroidTest.xml b/hostsidetests/jvmti/run-tests/test-942/AndroidTest.xml
new file mode 100644
index 0000000..61949d0
--- /dev/null
+++ b/hostsidetests/jvmti/run-tests/test-942/AndroidTest.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Config for CTS JVMTI test cases">
+ <target_preparer class="android.jvmti.cts.JvmtiPreparer">
+ <option name="cleanup-apks" value="true" />
+ <option name="test-file-name" value="CtsJvmtiRunTest942DeviceApp.apk" />
+ <option name="package-name" value="android.jvmti.cts.run_test_942" />
+ </target_preparer>
+ <test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
+ <option name="jar" value="CtsJvmtiRunTest942HostTestCases.jar" />
+ </test>
+</configuration>
diff --git a/hostsidetests/jvmti/run-tests/test-942/app/Android.mk b/hostsidetests/jvmti/run-tests/test-942/app/Android.mk
new file mode 100644
index 0000000..82d3b6a
--- /dev/null
+++ b/hostsidetests/jvmti/run-tests/test-942/app/Android.mk
@@ -0,0 +1,33 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+LOCAL_DEX_PREOPT := false
+LOCAL_PROGUARD_ENABLED := disabled
+LOCAL_SRC_FILES :=
+LOCAL_COMPATIBILITY_SUITE := cts
+LOCAL_STATIC_JAVA_LIBRARIES := CtsJvmtiDeviceRunTestAppBase
+LOCAL_JNI_SHARED_LIBRARIES := libctsjvmtiagent
+LOCAL_MULTILIB := both
+LOCAL_SDK_VERSION := current
+
+# TODO: Refactor. This is the only thing every changing.
+LOCAL_PACKAGE_NAME := CtsJvmtiRunTest942DeviceApp
+
+include $(BUILD_PACKAGE)
diff --git a/hostsidetests/jvmti/run-tests/test-942/app/AndroidManifest.xml b/hostsidetests/jvmti/run-tests/test-942/app/AndroidManifest.xml
new file mode 100644
index 0000000..c40171f
--- /dev/null
+++ b/hostsidetests/jvmti/run-tests/test-942/app/AndroidManifest.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="android.jvmti.cts.run_test_942">
+
+ <application android:debuggable="true">
+ <uses-library android:name="android.test.runner" />
+ <meta-data android:name="android.jvmti.cts.run_test_nr" android:value="942" />
+ <activity android:name="android.jvmti.JvmtiActivity" >
+ </activity>
+ </application>
+
+ <!-- self-instrumenting test package. -->
+ <instrumentation
+ android:name="android.support.test.runner.AndroidJUnitRunner"
+ android:label="CTS tests for JVMTI"
+ android:targetPackage="android.jvmti.cts.run_test_942" >
+ </instrumentation>
+</manifest>
+