1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// TODO: once b/80095087 is fixed, rewrite this back to android_test
16java_library {
17    name: "libiorap-java-test-lib",
18    srcs: ["src/**/*.kt"],
19    static_libs: [
20        // Non-test dependencies
21        // library under test
22        "services.startop.iorap",
23        // need the system_server code to be on the classpath,
24        "services.core",
25        // Test Dependencies
26        // test android dependencies
27        "platform-test-annotations",
28        "androidx.test.rules",
29        // test framework dependencies
30        "mockito-target-inline-minus-junit4",
31        // "mockito-target-minus-junit4",
32        // Mockito also requires JNI (see Android.mk)
33        // and android:debuggable=true (see AndroidManifest.xml)
34        "truth-prebuilt",
35    ],
36    // sdk_version: "current",
37    // certificate: "platform",
38    libs: [
39        "android.test.base",
40        "android.test.runner",
41    ],
42    // test_suites: ["device-tests"],
43}
44
45android_test {
46    name: "libiorap-java-tests",
47    dxflags: ["--multi-dex"],
48    test_suites: ["device-tests"],
49    static_libs: ["libiorap-java-test-lib"],
50    compile_multilib: "both",
51    jni_libs: [
52        "libdexmakerjvmtiagent",
53        "libstaticjvmtiagent",
54        "libmultiplejvmtiagentsinterferenceagent",
55    ],
56    libs: [
57        "android.test.base",
58        "android.test.runner",
59    ],
60    // Use private APIs
61    certificate: "platform",
62    platform_apis: true,
63}
64