xref: /aosp_15_r20/external/mobile-data-download/javatests/Android.bp (revision 6fa6b5e213d87a73421ed761ee7d492115d5f98c)
1*6fa6b5e2SAndroid Build Coastguard Worker// Copyright (C) 2022 The Android Open Source Project
2*6fa6b5e2SAndroid Build Coastguard Worker//
3*6fa6b5e2SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*6fa6b5e2SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*6fa6b5e2SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*6fa6b5e2SAndroid Build Coastguard Worker//
7*6fa6b5e2SAndroid Build Coastguard Worker//      http://www.apache.org/licenses/LICENSE-2.0
8*6fa6b5e2SAndroid Build Coastguard Worker//
9*6fa6b5e2SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*6fa6b5e2SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*6fa6b5e2SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*6fa6b5e2SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*6fa6b5e2SAndroid Build Coastguard Worker// limitations under the License.
14*6fa6b5e2SAndroid Build Coastguard Worker
15*6fa6b5e2SAndroid Build Coastguard Workerpackage {
16*6fa6b5e2SAndroid Build Coastguard Worker    default_applicable_licenses: ["Android-Apache-2.0"],
17*6fa6b5e2SAndroid Build Coastguard Worker}
18*6fa6b5e2SAndroid Build Coastguard Worker
19*6fa6b5e2SAndroid Build Coastguard Worker
20*6fa6b5e2SAndroid Build Coastguard Worker//###########################################################
21*6fa6b5e2SAndroid Build Coastguard Worker// Robolectric test target for testing mdd test lib classes #
22*6fa6b5e2SAndroid Build Coastguard Worker//###########################################################
23*6fa6b5e2SAndroid Build Coastguard Workerandroid_app {
24*6fa6b5e2SAndroid Build Coastguard Worker    name: "MobileDataDownloadPlaceHolderApp",
25*6fa6b5e2SAndroid Build Coastguard Worker    manifest: "com/google/android/libraries/mobiledatadownload/internal/AndroidManifest.xml",
26*6fa6b5e2SAndroid Build Coastguard Worker    platform_apis: true,
27*6fa6b5e2SAndroid Build Coastguard Worker    libs: [
28*6fa6b5e2SAndroid Build Coastguard Worker        "android.test.runner.stubs.system",
29*6fa6b5e2SAndroid Build Coastguard Worker    ]
30*6fa6b5e2SAndroid Build Coastguard Worker}
31*6fa6b5e2SAndroid Build Coastguard Worker
32*6fa6b5e2SAndroid Build Coastguard Workerandroid_robolectric_test {
33*6fa6b5e2SAndroid Build Coastguard Worker
34*6fa6b5e2SAndroid Build Coastguard Worker    name: "MobileDataDownloadRoboTests",
35*6fa6b5e2SAndroid Build Coastguard Worker
36*6fa6b5e2SAndroid Build Coastguard Worker    srcs: [
37*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/internal/*.java",
38*6fa6b5e2SAndroid Build Coastguard Worker    ],
39*6fa6b5e2SAndroid Build Coastguard Worker
40*6fa6b5e2SAndroid Build Coastguard Worker    exclude_srcs: [
41*6fa6b5e2SAndroid Build Coastguard Worker        // Already compiled from mdd-robolectric-library
42*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/internal/MddTestUtil.java",
43*6fa6b5e2SAndroid Build Coastguard Worker        // Tests that are not yet ready to be included.
44*6fa6b5e2SAndroid Build Coastguard Worker        // TODO: (b/256877824) To be removed once the dependency for LabsFutures and ProtoParsers is resolved.
45*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/internal/MobileDataDownloadManagerTest.java", // Missing LabsFutures
46*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/internal/FileGroupManagerTest.java", // Missing LabsFutures
47*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/internal/util/ProtoConversionUtilTest.java", // Missing ProtoParsers
48*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/internal/MddIsolatedStructuresTest.java", //android.os.symlink and android.os.readlink do not work with robolectric
49*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/testing/FakeMobileDataDownload.java", // Missing GoogleLogger
50*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/testing/MddTestDependencies.java", // Missing BaseFileDownloaderModule
51*6fa6b5e2SAndroid Build Coastguard Worker        "com/google/android/libraries/mobiledatadownload/internal/ExpirationHandlerTest.java" // Test failed
52*6fa6b5e2SAndroid Build Coastguard Worker
53*6fa6b5e2SAndroid Build Coastguard Worker    ],
54*6fa6b5e2SAndroid Build Coastguard Worker
55*6fa6b5e2SAndroid Build Coastguard Worker    java_resource_dirs: ["config"],
56*6fa6b5e2SAndroid Build Coastguard Worker
57*6fa6b5e2SAndroid Build Coastguard Worker    libs: [
58*6fa6b5e2SAndroid Build Coastguard Worker        // This jar should not be included, android_robolectric_test soong tasks either ads
59*6fa6b5e2SAndroid Build Coastguard Worker        // "Robolectric_all-target" or "Robolectric_all-target_upstream" based on the "upstream"
60*6fa6b5e2SAndroid Build Coastguard Worker        // flag below.
61*6fa6b5e2SAndroid Build Coastguard Worker        "androidx.test.core",
62*6fa6b5e2SAndroid Build Coastguard Worker        "mobile_data_downloader_lib",
63*6fa6b5e2SAndroid Build Coastguard Worker        "mdd-robolectric-library",
64*6fa6b5e2SAndroid Build Coastguard Worker    ],
65*6fa6b5e2SAndroid Build Coastguard Worker
66*6fa6b5e2SAndroid Build Coastguard Worker    // use external/robolectric, rather than the outdated external/robolectric-shadows.
67*6fa6b5e2SAndroid Build Coastguard Worker    upstream: true,
68*6fa6b5e2SAndroid Build Coastguard Worker
69*6fa6b5e2SAndroid Build Coastguard Worker    instrumentation_for: "MobileDataDownloadPlaceHolderApp",
70*6fa6b5e2SAndroid Build Coastguard Worker
71*6fa6b5e2SAndroid Build Coastguard Worker    strict_mode: false,
72*6fa6b5e2SAndroid Build Coastguard Worker
73*6fa6b5e2SAndroid Build Coastguard Worker}
74