diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-05-07 22:16:27 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-05-07 22:16:27 +0000 |
commit | ff58470d3125be215634c314c2233dd19f64bae0 (patch) | |
tree | bd145569b168b6703a7310f477c2dba15fd39c25 | |
parent | 0b3036c43977dbb465bcb12573fb59807ac36630 (diff) | |
parent | 36085adcd4ba069b60987db72952e99b5509eeef (diff) | |
download | platform_packages_apps_Car_Dialer-ff58470d3125be215634c314c2233dd19f64bae0.tar.gz platform_packages_apps_Car_Dialer-ff58470d3125be215634c314c2233dd19f64bae0.tar.bz2 platform_packages_apps_Car_Dialer-ff58470d3125be215634c314c2233dd19f64bae0.zip |
Merge "Set up JUnit4 unit test for Dialer" into rvc-dev am: 36085adcd4
Change-Id: Idbee21490cdf357da388214a696a366760682d44
-rw-r--r-- | tests/unittests/Android.bp | 16 | ||||
-rw-r--r-- | tests/unittests/AndroidManifest.xml | 30 | ||||
-rw-r--r-- | tests/unittests/readme.md | 6 | ||||
-rw-r--r-- | tests/unittests/src/com/android/car/dialer/livedata/CallStateLiveDataUnitTest.java | 36 |
4 files changed, 88 insertions, 0 deletions
diff --git a/tests/unittests/Android.bp b/tests/unittests/Android.bp new file mode 100644 index 00000000..793fc8c5 --- /dev/null +++ b/tests/unittests/Android.bp @@ -0,0 +1,16 @@ +//############################################################ +// Car Dialer unit test target. # +//############################################################ +android_test { + name: "CarDialerUnitTests", + + srcs: ["src/**/*.java"], + + java_resource_dirs: ["config"], + + static_libs: [ + "androidx.test.ext.junit", + ], + + instrumentation_for: "CarDialerAppForTesting", +} diff --git a/tests/unittests/AndroidManifest.xml b/tests/unittests/AndroidManifest.xml new file mode 100644 index 00000000..70ceaa9a --- /dev/null +++ b/tests/unittests/AndroidManifest.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<manifest + xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.car.dialer"> + + <application android:testOnly="true" + android:debuggable="true"> + <uses-library android:name="android.test.runner" /> + </application> + + <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" + android:targetPackage="com.android.car.dialer.tests.unittests" + android:label="Car Dialer Unit Tests" /> +</manifest> diff --git a/tests/unittests/readme.md b/tests/unittests/readme.md new file mode 100644 index 00000000..46a64608 --- /dev/null +++ b/tests/unittests/readme.md @@ -0,0 +1,6 @@ +Unit test suite for CarDialerApp using Robolectric. + +``` +$ mma +$ atest CarDialerUnitTests +```
\ No newline at end of file diff --git a/tests/unittests/src/com/android/car/dialer/livedata/CallStateLiveDataUnitTest.java b/tests/unittests/src/com/android/car/dialer/livedata/CallStateLiveDataUnitTest.java new file mode 100644 index 00000000..9488040c --- /dev/null +++ b/tests/unittests/src/com/android/car/dialer/livedata/CallStateLiveDataUnitTest.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.car.dialer.livedata; + +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(AndroidJUnit4.class) +public class CallStateLiveDataUnitTest { + + @Before + public void setup() { + } + + @Test + public void testOnActiveRegistry() { + } +} + |