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 17java_defaults { 18 name: "NetworkStackIntegrationTestsJniDefaults", 19 defaults: ["libnetworkstackutilsjni_deps"], 20 jni_libs: [ 21 // For mockito extended 22 "libdexmakerjvmtiagent", 23 "libstaticjvmtiagent", 24 // For NetworkStackUtils included in NetworkStackBase 25 "libnetworkstackutilsjni", 26 ], 27 jni_uses_sdk_apis: true, 28 visibility: ["//visibility:private"], 29} 30 31java_defaults { 32 name: "NetworkStackIntegrationTestsDefaults", 33 srcs: ["src/**/*.java"], 34 static_libs: [ 35 "androidx.annotation_annotation", 36 "androidx.test.rules", 37 "mockito-target-extended-minus-junit4", 38 "net-tests-utils", 39 "testables", 40 ], 41 libs: [ 42 "android.test.runner", 43 "android.test.base", 44 "android.test.mock", 45 ], 46 jarjar_rules: ":NetworkStackJarJarRules", 47 visibility: ["//visibility:private"], 48} 49 50android_library { 51 name: "NetworkStackIntegrationTestsLib", 52 defaults: ["NetworkStackIntegrationTestsDefaults"], 53 min_sdk_version: "29", 54 static_libs: [ 55 "NetworkStackApiStableLib", 56 ], 57} 58 59// Network stack integration tests. 60android_test { 61 name: "NetworkStackIntegrationTests", 62 defaults: ["NetworkStackIntegrationTestsJniDefaults"], 63 static_libs: ["NetworkStackIntegrationTestsLib"], 64 certificate: "networkstack", 65 platform_apis: true, 66 test_suites: ["device-tests"], 67 min_sdk_version: "29", 68} 69 70// Network stack next integration tests. 71android_test { 72 name: "NetworkStackNextIntegrationTests", 73 defaults: [ 74 "NetworkStackIntegrationTestsDefaults", 75 "NetworkStackIntegrationTestsJniDefaults", 76 ], 77 static_libs: [ 78 "NetworkStackApiCurrentLib", 79 ], 80 certificate: "networkstack", 81 platform_apis: true, 82 test_suites: ["device-tests"], 83} 84 85// The static lib needs to be jarjared by each module so they do not conflict with each other 86// (e.g. wifi, system server, network stack need to use different package names when including it). 87// Apply NetworkStack jarjar rules to the tests as well so classes in NetworkStaticLibTests have the 88// same package names as in module code. 89android_library { 90 name: "NetworkStackStaticLibTestsLib", 91 platform_apis: true, 92 min_sdk_version: "29", 93 jarjar_rules: ":NetworkStackJarJarRules", 94 static_libs: ["NetworkStaticLibTestsLib"], 95} 96 97// Special version of the network stack tests that includes all tests necessary for code coverage 98// purposes. This is currently the union of NetworkStackTests and NetworkStackIntegrationTests. 99android_test { 100 name: "NetworkStackCoverageTests", 101 certificate: "networkstack", 102 platform_apis: true, 103 min_sdk_version: "29", 104 test_suites: ["device-tests", "mts"], 105 test_config: "AndroidTest_Coverage.xml", 106 defaults: ["NetworkStackIntegrationTestsJniDefaults"], 107 static_libs: [ 108 "NetworkStackTestsLib", 109 "NetworkStackIntegrationTestsLib", 110 "NetworkStackStaticLibTestsLib", 111 ], 112 compile_multilib: "both", 113 manifest: "AndroidManifest_coverage.xml", 114} 115