diff options
-rw-r--r-- | libartservice/tests/Android.bp | 8 | ||||
-rw-r--r-- | libartservice/tests/AndroidManifest.xml | 30 | ||||
-rw-r--r-- | libartservice/tests/src/com/android/server/art/ArtManagerLocalTests.java | 21 |
3 files changed, 51 insertions, 8 deletions
diff --git a/libartservice/tests/Android.bp b/libartservice/tests/Android.bp index dc110a1a61..1b18cc5d45 100644 --- a/libartservice/tests/Android.bp +++ b/libartservice/tests/Android.bp @@ -27,7 +27,7 @@ package { default_applicable_licenses: ["art_license"], } -java_test { +android_test { name: "ArtServiceTests", // Include all test java files. @@ -36,9 +36,15 @@ java_test { ], static_libs: [ + "androidx.test.ext.junit", + "androidx.test.ext.truth", "androidx.test.runner", + "mockito-target-minus-junit4", "service-art.impl", ], + sdk_version: "system_server_current", + min_sdk_version: "31", + test_suites: ["general-tests"], } diff --git a/libartservice/tests/AndroidManifest.xml b/libartservice/tests/AndroidManifest.xml new file mode 100644 index 0000000000..921bde92c1 --- /dev/null +++ b/libartservice/tests/AndroidManifest.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + ~ Copyright (C) 2022 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="com.android.server.art.tests"> + + <application android:label="ArtServiceTests"> + <uses-library android:name="android.test.runner" /> + </application> + + <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" + android:targetPackage="com.android.server.art.tests" + android:label="Tests for ART Serices" /> +</manifest> diff --git a/libartservice/tests/src/com/android/server/art/ArtManagerLocalTests.java b/libartservice/tests/src/com/android/server/art/ArtManagerLocalTests.java index 515849b148..b0323c4b5d 100644 --- a/libartservice/tests/src/com/android/server/art/ArtManagerLocalTests.java +++ b/libartservice/tests/src/com/android/server/art/ArtManagerLocalTests.java @@ -16,22 +16,29 @@ package com.android.server.art; -import static org.junit.Assert.assertTrue; +import static com.google.common.truth.Truth.assertThat; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; import com.android.server.art.ArtManagerLocal; -import junit.framework.TestCase; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; -public class ArtManagerLocalTests extends TestCase { +@SmallTest +@RunWith(MockitoJUnitRunner.class) +public class ArtManagerLocalTests { private ArtManagerLocal mArtManagerLocal; - public void setup() { + @Before + public void setUp() { mArtManagerLocal = new ArtManagerLocal(); } + @Test public void testScaffolding() { - assertTrue(true); + assertThat(true).isTrue(); } -}
\ No newline at end of file +} |