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        "frameworks-base-testutils",
50        "hamcrest-library",
51        "kotlin-test",
52        "mockingservicestests-utils-mockito",
53        "mockito-target-extended-minus-junit4",
54        "platform-compat-test-rules",
55        "platform-test-annotations",
56        "service-blobstore",
57        "service-jobscheduler",
58        "service-permission.impl",
59        "service-sdksandbox.impl",
60        "services.backup",
61        "services.companion",
62        "services.core",
63        "services.devicepolicy",
64        "services.net",
65        "services.usage",
66        "services.wallpapereffectsgeneration",
67        "servicestests-core-utils",
68        "servicestests-utils-mockito-extended",
69        "testables",
70        "truth-prebuilt",
71        // TODO: remove once Android migrates to JUnit 4.12, which provides assertThrows
72        "testng",
73        "compatibility-device-util-axt",
74    ],
75
76    libs: [
77        "android.test.mock",
78        "android.test.base",
79        "android.test.runner",
80        "servicestests-core-utils",
81    ],
82
83    java_resources: [
84        ":apex.test",
85        ":test.rebootless_apex_v1",
86        ":test.rebootless_apex_v2",
87    ],
88
89    jni_libs: [
90        "libpsi",
91    ],
92
93    certificate: "platform",
94    platform_apis: true,
95    test_suites: [
96        "device-tests",
97        "automotive-tests",
98    ],
99
100    optimize: {
101        enabled: false,
102    },
103}
104
105java_library {
106    name: "mockingservicestests-utils-mockito",
107    srcs: [
108        "utils-mockito/**/*.kt",
109    ],
110    static_libs: [
111        "junit",
112        "mockito-target-extended-minus-junit4",
113    ],
114    libs: [
115        "android.test.runner",
116    ],
117}
118
119filegroup {
120    name: "extended-mockito-rule-sources",
121    srcs: [
122        "src/com/android/server/ExtendedMockitoRule.java",
123        "src/com/android/server/Visitor.java",
124    ],
125    visibility: [
126        "//frameworks/base/services/tests/displayservicetests",
127    ],
128}
129