xref: /aosp_15_r20/external/mobile-data-download/javatests/Android.bp (revision 6fa6b5e213d87a73421ed761ee7d492115d5f98c)
1// Copyright (C) 2022 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
19
20//###########################################################
21// Robolectric test target for testing mdd test lib classes #
22//###########################################################
23android_app {
24    name: "MobileDataDownloadPlaceHolderApp",
25    manifest: "com/google/android/libraries/mobiledatadownload/internal/AndroidManifest.xml",
26    platform_apis: true,
27    libs: [
28        "android.test.runner.stubs.system",
29    ]
30}
31
32android_robolectric_test {
33
34    name: "MobileDataDownloadRoboTests",
35
36    srcs: [
37        "com/google/android/libraries/mobiledatadownload/internal/*.java",
38    ],
39
40    exclude_srcs: [
41        // Already compiled from mdd-robolectric-library
42        "com/google/android/libraries/mobiledatadownload/internal/MddTestUtil.java",
43        // Tests that are not yet ready to be included.
44        // TODO: (b/256877824) To be removed once the dependency for LabsFutures and ProtoParsers is resolved.
45        "com/google/android/libraries/mobiledatadownload/internal/MobileDataDownloadManagerTest.java", // Missing LabsFutures
46        "com/google/android/libraries/mobiledatadownload/internal/FileGroupManagerTest.java", // Missing LabsFutures
47        "com/google/android/libraries/mobiledatadownload/internal/util/ProtoConversionUtilTest.java", // Missing ProtoParsers
48        "com/google/android/libraries/mobiledatadownload/internal/MddIsolatedStructuresTest.java", //android.os.symlink and android.os.readlink do not work with robolectric
49        "com/google/android/libraries/mobiledatadownload/testing/FakeMobileDataDownload.java", // Missing GoogleLogger
50        "com/google/android/libraries/mobiledatadownload/testing/MddTestDependencies.java", // Missing BaseFileDownloaderModule
51        "com/google/android/libraries/mobiledatadownload/internal/ExpirationHandlerTest.java" // Test failed
52
53    ],
54
55    java_resource_dirs: ["config"],
56
57    libs: [
58        // This jar should not be included, android_robolectric_test soong tasks either ads
59        // "Robolectric_all-target" or "Robolectric_all-target_upstream" based on the "upstream"
60        // flag below.
61        "androidx.test.core",
62        "mobile_data_downloader_lib",
63        "mdd-robolectric-library",
64    ],
65
66    // use external/robolectric, rather than the outdated external/robolectric-shadows.
67    upstream: true,
68
69    instrumentation_for: "MobileDataDownloadPlaceHolderApp",
70
71    strict_mode: false,
72
73}
74