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.
14java_defaults {
15    name: "FrameworkMockingServicesTests-jni-defaults",
16    jni_libs: [
17        "libmockingservicestestjni",
18    ],
19}
20
21package {
22    // See: http://go/android-license-faq
23    // A large-scale-change added 'default_applicable_licenses' to import
24    // all of the 'license_kinds' from "frameworks_base_license"
25    // to get the below license kinds:
26    //   SPDX-license-identifier-Apache-2.0
27    default_applicable_licenses: ["frameworks_base_license"],
28}
29
30android_test {
31    name: "FrameworksMockingServicesTests",
32    defaults: [
33        "FrameworkMockingServicesTests-jni-defaults",
34        "modules-utils-testable-device-config-defaults",
35    ],
36
37    srcs: [
38        "src/**/*.java",
39        "src/**/*.kt",
40        ":framework-internal-display-sources",
41    ],
42
43    static_libs: [
44        "androidx.test.core",
45        "androidx.test.runner",
46        "androidx.test.espresso.core",
47        "androidx.test.espresso.contrib",
48        "androidx.test.ext.truth",
49        "flag-junit",
50        "frameworks-base-testutils",
51        "hamcrest-library",
52        "kotlin-test",
53        "mockingservicestests-utils-mockito",
54        "mockito-target-extended-minus-junit4",
55        "platform-compat-test-rules",
56        "platform-test-annotations",
57        "PlatformProperties",
58        "service-blobstore",
59        "service-jobscheduler",
60        "service-permission.impl",
61        "service-sdksandbox.impl",
62        "services.backup",
63        "services.companion",
64        "services.core",
65        "services.devicepolicy",
66        "services.net",
67        "services.usage",
68        "services.wallpapereffectsgeneration",
69        "servicestests-core-utils",
70        "servicestests-utils-mockito-extended",
71        "testables",
72        "truth",
73        // TODO: remove once Android migrates to JUnit 4.12, which provides assertThrows
74        "testng",
75        "compatibility-device-util-axt",
76        "flag-junit",
77        "am_flags_lib",
78        "device_policy_aconfig_flags_lib",
79    ],
80
81    libs: [
82        "android.test.mock",
83        "android.test.base",
84        "android.test.runner",
85        "servicestests-core-utils",
86    ],
87
88    java_resources: [
89        ":apex.test",
90        ":test.rebootless_apex_v1",
91        ":test.rebootless_apex_v2",
92    ],
93
94    jni_libs: [
95        "libpsi",
96    ],
97
98    certificate: "platform",
99    platform_apis: true,
100    test_suites: [
101        "device-tests",
102        "automotive-tests",
103    ],
104
105    optimize: {
106        enabled: false,
107    },
108}
109
110java_library {
111    name: "mockingservicestests-utils-mockito",
112    srcs: [
113        "utils-mockito/**/*.kt",
114    ],
115    static_libs: [
116        "junit",
117        "mockito-target-extended-minus-junit4",
118    ],
119    libs: [
120        "android.test.runner",
121    ],
122}
123
124android_ravenwood_test {
125    name: "FrameworksMockingServicesTestsRavenwood",
126    libs: [
127        "android.test.mock",
128    ],
129    static_libs: [
130        "androidx.annotation_annotation",
131        "androidx.test.rules",
132        "services.core",
133    ],
134    srcs: [
135        "src/com/android/server/am/BroadcastRecordTest.java",
136    ],
137    auto_gen_config: true,
138}
139