1//
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    default_team: "trendy_team_fwk_core_networking",
19    // See: http://go/android-license-faq
20    default_applicable_licenses: ["Android-Apache-2.0"],
21}
22
23android_test {
24    name: "FrameworksNetIntegrationTests",
25    defaults: [
26        "framework-connectivity-internal-test-defaults",
27        "NetworkStackApiShimSettingsForCurrentBranch",
28    ],
29    platform_apis: true,
30    certificate: "platform",
31    srcs: [
32        "src/**/*.kt",
33        "src/**/*.aidl",
34    ],
35    libs: [
36        "android.test.mock",
37        "ServiceConnectivityResources",
38    ],
39    static_libs: [
40        // It does not matter if NetworkStackApiStableLib or NetworkStackApiCurrentLib is used here,
41        // since the shims for the branch are already included via
42        // NetworkStackApiShimSettingsForCurrentBranch, and will be used in priority as they are
43        // first in the classpath.
44        // If the wrong shims are used for some reason, tests that use newer APIs fail.
45        // TODO: have NetworkStackApiStableLib link dynamically against the shims to remove this
46        // order-dependent setup.
47        "NetworkStackApiStableLib",
48        "androidx.test.ext.junit",
49        "compatibility-device-util-axt",
50        "frameworks-net-integration-testutils",
51        "kotlin-reflect",
52        "mockito-target-extended-minus-junit4",
53        "net-tests-utils",
54        "service-connectivity-pre-jarjar",
55        "service-connectivity-tiramisu-pre-jarjar",
56        "services.net",
57        "testables",
58    ],
59    test_suites: ["device-tests"],
60    use_embedded_native_libs: true,
61    jni_libs: [
62        // For mockito extended
63        "libdexmakerjvmtiagent",
64        "libstaticjvmtiagent",
65        // android_library does not include JNI libs: include NetworkStack dependencies here
66        "libnativehelper_compat_libc++",
67        "libnetworkstackutilsjni",
68        "libandroid_net_connectivity_com_android_net_module_util_jni",
69        "libservice-connectivity",
70    ],
71    jarjar_rules: ":connectivity-jarjar-rules",
72}
73
74// Utilities for testing framework code both in integration and unit tests.
75java_library {
76    name: "frameworks-net-integration-testutils",
77    defaults: ["framework-connectivity-test-defaults"],
78    srcs: [
79        "util/**/*.java",
80        "util/**/*.kt",
81    ],
82    static_libs: [
83        "androidx.annotation_annotation",
84        "androidx.test.rules",
85        "junit",
86        "net-tests-utils",
87    ],
88    libs: [
89        "service-connectivity-pre-jarjar",
90        "services.core",
91        "services.net",
92    ],
93    visibility: [
94        "//packages/modules/Connectivity/tests/integration",
95        "//packages/modules/Connectivity/tests/unit",
96    ],
97}
98