Verify `android.test.mock` under Ravenwood.
Even though developers are encouraged to use Mockito, existing tests
may still be using this old library for their mocking.
We'll circle back later to consider support for components such as
ContentProvider, Service, etc.
Clean up OWNERS.
Bug: 310268946
Test: atest android.test.mock.ravenwood.tests
Change-Id: Ie3f4ccea9cf6719d61cff277a627825868edc992
diff --git a/test-mock/Android.bp b/test-mock/Android.bp
index 22320fd..2ff7413 100644
--- a/test-mock/Android.bp
+++ b/test-mock/Android.bp
@@ -54,6 +54,29 @@
dist_group: "android",
}
+java_library {
+ name: "android.test.mock.ravenwood",
+ srcs: [":android-test-mock-sources"],
+ visibility: [
+ "//frameworks/base",
+ ],
+}
+
+android_ravenwood_test {
+ name: "android.test.mock.ravenwood.tests",
+ libs: [
+ "android.test.mock.ravenwood",
+ ],
+ static_libs: [
+ "androidx.annotation_annotation",
+ "androidx.test.rules",
+ ],
+ srcs: [
+ "tests/**/*.java",
+ ],
+ auto_gen_config: true,
+}
+
// Make the current.txt available for use by the cts/tests/signature tests.
// ========================================================================
filegroup {
diff --git a/test-mock/tests/src/android/test/mock/MockContextTest.java b/test-mock/tests/src/android/test/mock/MockContextTest.java
new file mode 100644
index 0000000..6e28267
--- /dev/null
+++ b/test-mock/tests/src/android/test/mock/MockContextTest.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+package android.test.mock;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public class MockContextTest {
+ @Test
+ public void testConstructor() {
+ new MockContext();
+ }
+}
diff --git a/test-mock/tests/src/android/test/mock/MockPackageManagerTest.java b/test-mock/tests/src/android/test/mock/MockPackageManagerTest.java
new file mode 100644
index 0000000..5b860f1
--- /dev/null
+++ b/test-mock/tests/src/android/test/mock/MockPackageManagerTest.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+package android.test.mock;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public class MockPackageManagerTest {
+ @Test
+ public void testConstructor() {
+ new MockPackageManager();
+ }
+}