blob: f705e345715bbd5bae8cef1d0d0412810a09055e [file] [log] [blame]
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +00001//
2// Copyright (C) 2019 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18 // See: http://go/android-license-faq
Baligh Uddin2afd0982021-05-24 03:50:01 +000019 default_applicable_licenses: ["Android-Apache-2.0"],
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000020}
21
22android_test {
23 name: "FrameworksNetIntegrationTests",
Remi NGUYEN VAN02eee9a2023-01-30 19:19:48 +090024 defaults: [
25 "framework-connectivity-internal-test-defaults",
26 "NetworkStackApiShimSettingsForCurrentBranch",
27 ],
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000028 platform_apis: true,
29 certificate: "platform",
30 srcs: [
31 "src/**/*.kt",
32 "src/**/*.aidl",
33 ],
34 libs: [
35 "android.test.mock",
Remi NGUYEN VAN0a37e722021-08-04 19:19:49 +090036 "ServiceConnectivityResources",
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000037 ],
38 static_libs: [
Remi NGUYEN VAN02eee9a2023-01-30 19:19:48 +090039 // It does not matter if NetworkStackApiStableLib or NetworkStackApiCurrentLib is used here,
40 // since the shims for the branch are already included via
41 // NetworkStackApiShimSettingsForCurrentBranch, and will be used in priority as they are
42 // first in the classpath.
43 // If the wrong shims are used for some reason, tests that use newer APIs fail.
44 // TODO: have NetworkStackApiStableLib link dynamically against the shims to remove this
45 // order-dependent setup.
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000046 "NetworkStackApiStableLib",
47 "androidx.test.ext.junit",
Junyu Lai54e84ab2023-10-23 13:36:26 +080048 "compatibility-device-util-axt",
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000049 "frameworks-net-integration-testutils",
50 "kotlin-reflect",
51 "mockito-target-extended-minus-junit4",
52 "net-tests-utils",
Remi NGUYEN VANb240e2a2021-07-12 23:40:56 +000053 "service-connectivity-pre-jarjar",
Lorenzo Colitti3d521722022-02-04 01:39:01 +090054 "service-connectivity-tiramisu-pre-jarjar",
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000055 "services.net",
56 "testables",
57 ],
58 test_suites: ["device-tests"],
59 use_embedded_native_libs: true,
60 jni_libs: [
61 // For mockito extended
62 "libdexmakerjvmtiagent",
63 "libstaticjvmtiagent",
64 // android_library does not include JNI libs: include NetworkStack dependencies here
65 "libnativehelper_compat_libc++",
66 "libnetworkstackutilsjni",
Remi NGUYEN VAN6a20eed2022-01-31 11:21:08 +090067 "libandroid_net_connectivity_com_android_net_module_util_jni",
Patrick Rohrd8174362022-02-01 12:32:43 +010068 "libservice-connectivity",
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000069 ],
Remi NGUYEN VANb240e2a2021-07-12 23:40:56 +000070 jarjar_rules: ":connectivity-jarjar-rules",
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000071}
72
73// Utilities for testing framework code both in integration and unit tests.
74java_library {
75 name: "frameworks-net-integration-testutils",
76 defaults: ["framework-connectivity-test-defaults"],
77 srcs: ["util/**/*.java", "util/**/*.kt"],
78 static_libs: [
79 "androidx.annotation_annotation",
80 "androidx.test.rules",
81 "junit",
82 "net-tests-utils",
83 ],
84 libs: [
Remi NGUYEN VANe55a88d2022-04-20 15:59:16 +090085 "service-connectivity-pre-jarjar",
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000086 "services.core",
87 "services.net",
88 ],
Remi NGUYEN VANe55a88d2022-04-20 15:59:16 +090089 visibility: [
90 "//packages/modules/Connectivity/tests/integration",
91 "//packages/modules/Connectivity/tests/unit",
92 ],
Remi NGUYEN VAN678277c2021-05-11 13:37:06 +000093}