blob: 4e2009d2f103af0e0cb16381951542946b3c1035 [file] [log] [blame]
Makoto Onukifc007922021-08-16 12:02:39 -07001// Copyright (C) 2021 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
15package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Makoto Onuki68e48882021-09-02 14:59:48 -070019java_defaults {
20 name: "ComponentAliasTests_defaults",
Makoto Onukifc007922021-08-16 12:02:39 -070021 static_libs: [
22 "androidx.test.rules",
23 "compatibility-device-util-axt",
24 "mockito-target-extended-minus-junit4",
25 "truth-prebuilt",
26 "ub-uiautomator",
Makoto Onukifc007922021-08-16 12:02:39 -070027 ],
28 libs: ["android.test.base"],
29 srcs: [
30 "src/**/*.java",
31 ],
32 test_suites: [
33 "general-tests",
34 ],
35 platform_apis: true, // We use hidden APIs in the test.
36}
Makoto Onuki68e48882021-09-02 14:59:48 -070037
38// We build three APKs from the exact same source files, so these APKs contain the exact same tests.
39// And we run the tests on each APK, so that we can test various situations:
40// - When the alias is in the same package, target in the same package.
41// - When the alias is in the same package, target in another package.
42// - When the alias is in another package, which also contains the target.
43// - When the alias is in another package, and the target is in yet another package.
44// etc etc...
45
46android_test {
47 name: "ComponentAliasTests",
48 defaults: [
49 "ComponentAliasTests_defaults",
50 ],
51 package_name: "android.content.componentalias.tests",
52 manifest: "AndroidManifest.xml",
53 additional_manifests: [
54 "AndroidManifest_service_aliases.xml",
55 "AndroidManifest_service_targets.xml",
56 ],
57 test_config_template: "AndroidTest-template.xml",
58}
59
60android_test {
61 name: "ComponentAliasTests1",
62 defaults: [
63 "ComponentAliasTests_defaults",
64 ],
65 package_name: "android.content.componentalias.tests.sub1",
66 manifest: "AndroidManifest.xml",
67 additional_manifests: [
68 "AndroidManifest_service_aliases.xml",
69 "AndroidManifest_service_targets.xml",
70 ],
71 test_config_template: "AndroidTest-template.xml",
72}
73
74android_test {
75 name: "ComponentAliasTests2",
76 defaults: [
77 "ComponentAliasTests_defaults",
78 ],
79 package_name: "android.content.componentalias.tests.sub2",
80 manifest: "AndroidManifest.xml",
81 additional_manifests: [
82 "AndroidManifest_service_aliases.xml",
83 "AndroidManifest_service_targets.xml",
84 ],
85 test_config_template: "AndroidTest-template.xml",
86}