diff options
author | Neal Nguyen <tommyn@google.com> | 2010-01-07 10:14:05 -0800 |
---|---|---|
committer | Neal Nguyen <tommyn@google.com> | 2010-01-27 13:36:38 -0800 |
commit | 22e31e5b609136d5bf7d77b1dccd6b042b83ebdf (patch) | |
tree | d42bca2b4b406fa1fda149365985a25e2692b2dc | |
parent | 9ecaf8b8da6a556be6143b74b9e77cf4e08ff1e8 (diff) | |
download | frameworks_base-22e31e5b609136d5bf7d77b1dccd6b042b83ebdf.zip frameworks_base-22e31e5b609136d5bf7d77b1dccd6b042b83ebdf.tar.gz frameworks_base-22e31e5b609136d5bf7d77b1dccd6b042b83ebdf.tar.bz2 |
Moving framework core tests closer to their source files.
Phase 2 of test case cleanup; distributing CoreTests files closer to their respective sources under frameworks.
-rw-r--r-- | core/tests/coretests/Android.mk | 14 | ||||
-rw-r--r-- | core/tests/coretests/AndroidManifest.xml | 56 | ||||
-rw-r--r-- | core/tests/coretests/src/android/bluetooth/AtParserTest.java (renamed from tests/CoreTests/android/core/AtParserTest.java) | 2 | ||||
-rw-r--r-- | core/tests/coretests/src/android/content/ObserverNodeTest.java (renamed from tests/CoreTests/android/content/ObserverNodeTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/content/SyncStorageEngineTest.java (renamed from tests/CoreTests/android/content/SyncStorageEngineTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/database/MatrixCursorTest.java (renamed from tests/CoreTests/android/database/MatrixCursorTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/database/sqlite/AbstractJDBCDriverTest.java (renamed from tests/CoreTests/android/core/AbstractJDBCDriverTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/database/sqlite/SQLiteJDBCDriverTest.java (renamed from tests/CoreTests/android/core/SQLiteJDBCDriverTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/pim/RecurrenceSetTest.java (renamed from tests/CoreTests/android/core/RecurrenceSetTest.java) | 2 | ||||
-rw-r--r-- | core/tests/coretests/src/android/util/DayOfMonthCursorTest.java (renamed from tests/CoreTests/android/util/DayOfMonthCursorTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/util/FloatMathTest.java (renamed from tests/CoreTests/android/util/FloatMathTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/util/MonthDisplayHelperTest.java (renamed from tests/CoreTests/android/util/MonthDisplayHelperTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/util/StateSetTest.java (renamed from tests/CoreTests/android/util/StateSetTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/view/FocusFinderTest.java (renamed from tests/CoreTests/android/view/FocusFinderTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/view/ViewGroupAttributesTest.java (renamed from tests/CoreTests/android/view/ViewGroupAttributesTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/android/webkit/UrlInterceptRegistryTest.java (renamed from tests/CoreTests/android/webkit/UrlInterceptRegistryTest.java) | 0 | ||||
-rw-r--r-- | core/tests/coretests/src/com/android/internal/util/PredicatesTest.java (renamed from tests/CoreTests/com/android/internal/util/PredicatesTest.java) | 0 | ||||
-rw-r--r-- | location/tests/locationtests/Android.mk | 14 | ||||
-rw-r--r-- | location/tests/locationtests/AndroidManifest.xml | 35 | ||||
-rw-r--r-- | location/tests/locationtests/src/android/location/LocationTest.java (renamed from tests/CoreTests/android/location/LocationTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/TelephonyTest/src/com/android/telephonytest/TelephonyUnitTestRunner.java | 48 | ||||
-rw-r--r-- | telephony/tests/telephonytests/Android.mk (renamed from telephony/tests/TelephonyTest/Android.mk) | 2 | ||||
-rw-r--r-- | telephony/tests/telephonytests/AndroidManifest.xml (renamed from telephony/tests/TelephonyTest/AndroidManifest.xml) | 8 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java (renamed from tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/android/telephony/PhoneNumberWatcherTest.java (renamed from tests/CoreTests/com/android/internal/telephony/PhoneNumberWatcherTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/ATResponseParserTest.java (renamed from tests/CoreTests/com/android/internal/telephony/ATResponseParserTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/AdnRecordTest.java (renamed from tests/CoreTests/com/android/internal/telephony/AdnRecordTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/GsmAlphabetTest.java (renamed from tests/CoreTests/com/android/internal/telephony/GsmAlphabetTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/SMSDispatcherTest.java (renamed from tests/CoreTests/com/android/internal/telephony/SMSDispatcherTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/SimPhoneBookTest.java (renamed from tests/CoreTests/com/android/internal/telephony/SimPhoneBookTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/SimSmsTest.java (renamed from tests/CoreTests/com/android/internal/telephony/SimSmsTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/SimUtilsTest.java (renamed from tests/CoreTests/com/android/internal/telephony/SimUtilsTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java (renamed from tests/CoreTests/com/android/internal/telephony/TelephonyUtilsTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/TestPhoneNotifier.java (renamed from tests/CoreTests/com/android/internal/telephony/TestPhoneNotifier.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/GSMPhoneTest.java (renamed from tests/CoreTests/com/android/internal/telephony/gsm/GSMPhoneTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/GSMTestHandler.java (renamed from tests/CoreTests/com/android/internal/telephony/gsm/GSMTestHandler.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/telephonytest/unit/CallerInfoUnitTest.java (renamed from telephony/tests/TelephonyTest/src/com/android/telephonytest/unit/CallerInfoUnitTest.java) | 0 | ||||
-rw-r--r-- | telephony/tests/telephonytests/src/com/android/telephonytest/unit/PhoneNumberUtilsUnitTest.java (renamed from telephony/tests/TelephonyTest/src/com/android/telephonytest/unit/PhoneNumberUtilsUnitTest.java) | 0 | ||||
-rw-r--r-- | tests/CoreTests/android/core/CoreTests.java | 65 | ||||
-rw-r--r-- | tests/CoreTests/android/core/JavaTests.java | 86 | ||||
-rw-r--r-- | tests/CoreTests/android/location/LocationManagerProximityTest.java | 282 | ||||
-rw-r--r-- | tests/CoreTests/com/android/internal/telephony/TelephonyTests.java | 54 |
42 files changed, 126 insertions, 542 deletions
diff --git a/core/tests/coretests/Android.mk b/core/tests/coretests/Android.mk new file mode 100644 index 0000000..77c176f --- /dev/null +++ b/core/tests/coretests/Android.mk @@ -0,0 +1,14 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +# We only want this apk build for tests. +LOCAL_MODULE_TAGS := tests + +# Include all test java files. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_JAVA_LIBRARIES := android.test.runner +LOCAL_PACKAGE_NAME := FrameworksCoreTests + +include $(BUILD_PACKAGE) + diff --git a/core/tests/coretests/AndroidManifest.xml b/core/tests/coretests/AndroidManifest.xml new file mode 100644 index 0000000..674bda7 --- /dev/null +++ b/core/tests/coretests/AndroidManifest.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2008 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.frameworks.coretests"> + <uses-permission android:name="android.permission.RECEIVE_SMS"/> + <uses-permission android:name="android.permission.INTERNET" /> + <uses-permission android:name="android.permission.READ_CONTACTS" /> + <uses-permission android:name="android.permission.WRITE_CONTACTS" /> + <uses-permission android:name="android.permission.WAKE_LOCK" /> + <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /> + <uses-permission android:name="android.permission.WRITE_APN_SETTINGS" /> + <uses-permission android:name="android.permission.BROADCAST_STICKY" /> + + <!-- location test permissions --> + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> + <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/> + <uses-permission android:name="android.permission.WRITE_SETTINGS"/> + <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> + + <application> + <uses-library android:name="android.test.runner" /> + <activity android:name="StubTestBrowserActivity" android:label="Stubbed Test Browser"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.FOR_TESTS_ONLY"/> + </intent-filter> + </activity> + + <activity android:name="android.test.TestBrowserTests" android:label="Test Browser Tests"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.UNIT_TEST"/> + </intent-filter> + </activity> + </application> + + <instrumentation + android:name="android.test.InstrumentationTestRunner" + android:targetPackage="com.android.frameworks.coretests" + android:label="Frameworks Core Tests" /> +</manifest> diff --git a/tests/CoreTests/android/core/AtParserTest.java b/core/tests/coretests/src/android/bluetooth/AtParserTest.java index 09cb6e9..c5aa52b 100644 --- a/tests/CoreTests/android/core/AtParserTest.java +++ b/core/tests/coretests/src/android/bluetooth/AtParserTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.core; +package android.bluetooth; import android.bluetooth.AtCommandHandler; import android.bluetooth.AtCommandResult; diff --git a/tests/CoreTests/android/content/ObserverNodeTest.java b/core/tests/coretests/src/android/content/ObserverNodeTest.java index 68cc75b..68cc75b 100644 --- a/tests/CoreTests/android/content/ObserverNodeTest.java +++ b/core/tests/coretests/src/android/content/ObserverNodeTest.java diff --git a/tests/CoreTests/android/content/SyncStorageEngineTest.java b/core/tests/coretests/src/android/content/SyncStorageEngineTest.java index 533338e..533338e 100644 --- a/tests/CoreTests/android/content/SyncStorageEngineTest.java +++ b/core/tests/coretests/src/android/content/SyncStorageEngineTest.java diff --git a/tests/CoreTests/android/database/MatrixCursorTest.java b/core/tests/coretests/src/android/database/MatrixCursorTest.java index cddc6c4..cddc6c4 100644 --- a/tests/CoreTests/android/database/MatrixCursorTest.java +++ b/core/tests/coretests/src/android/database/MatrixCursorTest.java diff --git a/tests/CoreTests/android/core/AbstractJDBCDriverTest.java b/core/tests/coretests/src/android/database/sqlite/AbstractJDBCDriverTest.java index e381a5e..e381a5e 100644 --- a/tests/CoreTests/android/core/AbstractJDBCDriverTest.java +++ b/core/tests/coretests/src/android/database/sqlite/AbstractJDBCDriverTest.java diff --git a/tests/CoreTests/android/core/SQLiteJDBCDriverTest.java b/core/tests/coretests/src/android/database/sqlite/SQLiteJDBCDriverTest.java index eec82aa..eec82aa 100644 --- a/tests/CoreTests/android/core/SQLiteJDBCDriverTest.java +++ b/core/tests/coretests/src/android/database/sqlite/SQLiteJDBCDriverTest.java diff --git a/tests/CoreTests/android/core/RecurrenceSetTest.java b/core/tests/coretests/src/android/pim/RecurrenceSetTest.java index cee324c..64cd6c4 100644 --- a/tests/CoreTests/android/core/RecurrenceSetTest.java +++ b/core/tests/coretests/src/android/pim/RecurrenceSetTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.core; +package android.pim; import android.content.ContentValues; import android.pim.ICalendar; diff --git a/tests/CoreTests/android/util/DayOfMonthCursorTest.java b/core/tests/coretests/src/android/util/DayOfMonthCursorTest.java index 4c5ad76..4c5ad76 100644 --- a/tests/CoreTests/android/util/DayOfMonthCursorTest.java +++ b/core/tests/coretests/src/android/util/DayOfMonthCursorTest.java diff --git a/tests/CoreTests/android/util/FloatMathTest.java b/core/tests/coretests/src/android/util/FloatMathTest.java index f479e2b..f479e2b 100644 --- a/tests/CoreTests/android/util/FloatMathTest.java +++ b/core/tests/coretests/src/android/util/FloatMathTest.java diff --git a/tests/CoreTests/android/util/MonthDisplayHelperTest.java b/core/tests/coretests/src/android/util/MonthDisplayHelperTest.java index 5207ad9..5207ad9 100644 --- a/tests/CoreTests/android/util/MonthDisplayHelperTest.java +++ b/core/tests/coretests/src/android/util/MonthDisplayHelperTest.java diff --git a/tests/CoreTests/android/util/StateSetTest.java b/core/tests/coretests/src/android/util/StateSetTest.java index e481ce04..e481ce04 100644 --- a/tests/CoreTests/android/util/StateSetTest.java +++ b/core/tests/coretests/src/android/util/StateSetTest.java diff --git a/tests/CoreTests/android/view/FocusFinderTest.java b/core/tests/coretests/src/android/view/FocusFinderTest.java index 7ac8dfc..7ac8dfc 100644 --- a/tests/CoreTests/android/view/FocusFinderTest.java +++ b/core/tests/coretests/src/android/view/FocusFinderTest.java diff --git a/tests/CoreTests/android/view/ViewGroupAttributesTest.java b/core/tests/coretests/src/android/view/ViewGroupAttributesTest.java index b4ef0e7..b4ef0e7 100644 --- a/tests/CoreTests/android/view/ViewGroupAttributesTest.java +++ b/core/tests/coretests/src/android/view/ViewGroupAttributesTest.java diff --git a/tests/CoreTests/android/webkit/UrlInterceptRegistryTest.java b/core/tests/coretests/src/android/webkit/UrlInterceptRegistryTest.java index 7504449..7504449 100644 --- a/tests/CoreTests/android/webkit/UrlInterceptRegistryTest.java +++ b/core/tests/coretests/src/android/webkit/UrlInterceptRegistryTest.java diff --git a/tests/CoreTests/com/android/internal/util/PredicatesTest.java b/core/tests/coretests/src/com/android/internal/util/PredicatesTest.java index c46ff05..c46ff05 100644 --- a/tests/CoreTests/com/android/internal/util/PredicatesTest.java +++ b/core/tests/coretests/src/com/android/internal/util/PredicatesTest.java diff --git a/location/tests/locationtests/Android.mk b/location/tests/locationtests/Android.mk new file mode 100644 index 0000000..902cd96 --- /dev/null +++ b/location/tests/locationtests/Android.mk @@ -0,0 +1,14 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +# We only want this apk build for tests. +LOCAL_MODULE_TAGS := tests + +# Include all test java files. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_JAVA_LIBRARIES := android.test.runner +LOCAL_PACKAGE_NAME := FrameworksLocationTests + +include $(BUILD_PACKAGE) + diff --git a/location/tests/locationtests/AndroidManifest.xml b/location/tests/locationtests/AndroidManifest.xml new file mode 100644 index 0000000..1d9df0f --- /dev/null +++ b/location/tests/locationtests/AndroidManifest.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2008 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.frameworks.locationtests"> + + <!-- location test permissions --> + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> + <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/> + <uses-permission android:name="android.permission.WRITE_SETTINGS"/> + <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> + + <application> + <uses-library android:name="android.test.runner" /> + </application> + + <instrumentation + android:name="android.test.InstrumentationTestRunner" + android:targetPackage="com.android.frameworks.locationtests" + android:label="Frameworks Location Tests" /> +</manifest> diff --git a/tests/CoreTests/android/location/LocationTest.java b/location/tests/locationtests/src/android/location/LocationTest.java index 847ac7a..847ac7a 100644 --- a/tests/CoreTests/android/location/LocationTest.java +++ b/location/tests/locationtests/src/android/location/LocationTest.java diff --git a/telephony/tests/TelephonyTest/src/com/android/telephonytest/TelephonyUnitTestRunner.java b/telephony/tests/TelephonyTest/src/com/android/telephonytest/TelephonyUnitTestRunner.java deleted file mode 100644 index 9e1af31..0000000 --- a/telephony/tests/TelephonyTest/src/com/android/telephonytest/TelephonyUnitTestRunner.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2009 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.telephonytest; - -import junit.framework.TestSuite; - -import android.test.InstrumentationTestRunner; -import android.test.InstrumentationTestSuite; - -/** - * Instrumentation Test Runner for all Telephony unit tests. - * - * Running all tests: - * - * runtest telephony-unit - * or - * adb shell am instrument -w com.android.telephonytest/.TelephonyUnitTestRunner - */ - -public class TelephonyUnitTestRunner extends InstrumentationTestRunner { - - @Override - public TestSuite getAllTests() { - TestSuite suite = new InstrumentationTestSuite(this); - suite.addTestSuite(com.android.telephonytest.unit.CallerInfoUnitTest.class); - suite.addTestSuite(com.android.telephonytest.unit.PhoneNumberUtilsUnitTest.class); - return suite; - } - - @Override - public ClassLoader getLoader() { - return TelephonyUnitTestRunner.class.getClassLoader(); - } -} diff --git a/telephony/tests/TelephonyTest/Android.mk b/telephony/tests/telephonytests/Android.mk index 1ef8448..45e265a 100644 --- a/telephony/tests/TelephonyTest/Android.mk +++ b/telephony/tests/telephonytests/Android.mk @@ -7,6 +7,6 @@ LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_JAVA_LIBRARIES := android.test.runner -LOCAL_PACKAGE_NAME := telephonytest +LOCAL_PACKAGE_NAME := FrameworksTelephonyTests include $(BUILD_PACKAGE) diff --git a/telephony/tests/TelephonyTest/AndroidManifest.xml b/telephony/tests/telephonytests/AndroidManifest.xml index b2a481b..70aeebc 100644 --- a/telephony/tests/TelephonyTest/AndroidManifest.xml +++ b/telephony/tests/telephonytests/AndroidManifest.xml @@ -16,7 +16,7 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.telephonytest"> + package="com.android.frameworks.telephonytests"> <application> <uses-library android:name="android.test.runner" /> @@ -28,9 +28,9 @@ </intent-filter> </activity> </application> - <instrumentation android:name=".TelephonyUnitTestRunner" - android:targetPackage="com.android.telephonytest" - android:label="Telephony unit tests InstrumentationRunner"> + <instrumentation android:name="android.test.InstrumentationTestRunner" + android:targetPackage="com.android.frameworks.telephonytests" + android:label="Frameworks Telephony Tests"> </instrumentation> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> </manifest> diff --git a/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java b/telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java index aa2981b..aa2981b 100644 --- a/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java +++ b/telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/PhoneNumberWatcherTest.java b/telephony/tests/telephonytests/src/android/telephony/PhoneNumberWatcherTest.java index 88eaecd..88eaecd 100644 --- a/tests/CoreTests/com/android/internal/telephony/PhoneNumberWatcherTest.java +++ b/telephony/tests/telephonytests/src/android/telephony/PhoneNumberWatcherTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/ATResponseParserTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/ATResponseParserTest.java index 81727e4..81727e4 100644 --- a/tests/CoreTests/com/android/internal/telephony/ATResponseParserTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/ATResponseParserTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/AdnRecordTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/AdnRecordTest.java index 8a4a285..8a4a285 100644 --- a/tests/CoreTests/com/android/internal/telephony/AdnRecordTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/AdnRecordTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/GsmAlphabetTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/GsmAlphabetTest.java index 3a9c511..3a9c511 100644 --- a/tests/CoreTests/com/android/internal/telephony/GsmAlphabetTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/GsmAlphabetTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/SMSDispatcherTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/SMSDispatcherTest.java index 8a66614..8a66614 100644 --- a/tests/CoreTests/com/android/internal/telephony/SMSDispatcherTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/SMSDispatcherTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/SimPhoneBookTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/SimPhoneBookTest.java index 609e768..609e768 100644 --- a/tests/CoreTests/com/android/internal/telephony/SimPhoneBookTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/SimPhoneBookTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/SimSmsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/SimSmsTest.java index 1609680..1609680 100644 --- a/tests/CoreTests/com/android/internal/telephony/SimSmsTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/SimSmsTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/SimUtilsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/SimUtilsTest.java index db38ede..db38ede 100644 --- a/tests/CoreTests/com/android/internal/telephony/SimUtilsTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/SimUtilsTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/TelephonyUtilsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java index bf0c88b..bf0c88b 100644 --- a/tests/CoreTests/com/android/internal/telephony/TelephonyUtilsTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/TestPhoneNotifier.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/TestPhoneNotifier.java index 427795b..427795b 100644 --- a/tests/CoreTests/com/android/internal/telephony/TestPhoneNotifier.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/TestPhoneNotifier.java diff --git a/tests/CoreTests/com/android/internal/telephony/gsm/GSMPhoneTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/GSMPhoneTest.java index b96743a..b96743a 100644 --- a/tests/CoreTests/com/android/internal/telephony/gsm/GSMPhoneTest.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/GSMPhoneTest.java diff --git a/tests/CoreTests/com/android/internal/telephony/gsm/GSMTestHandler.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/GSMTestHandler.java index fb8a5d9..fb8a5d9 100644 --- a/tests/CoreTests/com/android/internal/telephony/gsm/GSMTestHandler.java +++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/gsm/GSMTestHandler.java diff --git a/telephony/tests/TelephonyTest/src/com/android/telephonytest/unit/CallerInfoUnitTest.java b/telephony/tests/telephonytests/src/com/android/telephonytest/unit/CallerInfoUnitTest.java index 0f24f15..0f24f15 100644 --- a/telephony/tests/TelephonyTest/src/com/android/telephonytest/unit/CallerInfoUnitTest.java +++ b/telephony/tests/telephonytests/src/com/android/telephonytest/unit/CallerInfoUnitTest.java diff --git a/telephony/tests/TelephonyTest/src/com/android/telephonytest/unit/PhoneNumberUtilsUnitTest.java b/telephony/tests/telephonytests/src/com/android/telephonytest/unit/PhoneNumberUtilsUnitTest.java index 2d3c548..2d3c548 100644 --- a/telephony/tests/TelephonyTest/src/com/android/telephonytest/unit/PhoneNumberUtilsUnitTest.java +++ b/telephony/tests/telephonytests/src/com/android/telephonytest/unit/PhoneNumberUtilsUnitTest.java diff --git a/tests/CoreTests/android/core/CoreTests.java b/tests/CoreTests/android/core/CoreTests.java deleted file mode 100644 index 442fe0f..0000000 --- a/tests/CoreTests/android/core/CoreTests.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2008 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 android.core; - -import com.android.internal.telephony.TelephonyTests; - -import junit.framework.TestSuite; - -import android.graphics.ColorStateListTest; -import android.location.LocationManagerProximityTest; -import android.location.LocationTest; -import android.test.AndroidTestRunnerTest; -import android.test.InstrumentationTestRunnerTest; -import android.util.*; -import android.view.FocusFinderTest; -import android.view.ViewGroupAttributesTest; -import android.webkit.*; - -public class CoreTests extends TestSuite { - - /** - * To run these tests: - * $ mmm java/tests && adb sync - * $ adb shell am instrument -w \ - * -e class android.core.CoreTests \ - * android.core/android.test.InstrumentationTestRunner - */ - public static TestSuite suite() { - TestSuite suite = new TestSuite(CoreTests.class.getName()); - - // Re-enable StateListDrawableTest when we are running in the - // framework-test directory which allows access to package private - // access for MockView - // suite.addTestSuite(StateListDrawableTest.class); - suite.addTestSuite(DayOfMonthCursorTest.class); - suite.addTestSuite(MonthDisplayHelperTest.class); - suite.addTestSuite(StateSetTest.class); - suite.addTestSuite(ColorStateListTest.class); - suite.addTestSuite(FocusFinderTest.class); - suite.addTestSuite(ViewGroupAttributesTest.class); - suite.addTest(TelephonyTests.suite()); - suite.addTestSuite(FloatMathTest.class); - suite.addTest(JavaTests.suite()); - suite.addTestSuite(LocationTest.class); - suite.addTestSuite(LocationManagerProximityTest.class); - suite.addTestSuite(AndroidTestRunnerTest.class); - suite.addTestSuite(InstrumentationTestRunnerTest.class); - - return suite; - } -} diff --git a/tests/CoreTests/android/core/JavaTests.java b/tests/CoreTests/android/core/JavaTests.java deleted file mode 100644 index bd8cbf0..0000000 --- a/tests/CoreTests/android/core/JavaTests.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2008 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 android.core; - -import junit.framework.TestSuite; - -public class JavaTests { - public static TestSuite suite() { - TestSuite suite = new TestSuite(JavaTests.class.getName()); - - //Disabling until bug http://b/issue?id=1200337 is resolved - //suite.addTestSuite(RequestAPITest.class); - suite.addTestSuite(MathTest.class); - suite.addTestSuite(StrictMathTest.class); - suite.addTestSuite(HashMapPerfTest.class); - suite.addTestSuite(TreeMapTest.class); - suite.addTestSuite(FloatDoubleTest.class); - suite.addTestSuite(Sha1Test.class); - suite.addTestSuite(NIOTest.class); - suite.addTestSuite(ReflectArrayTest.class); - //Commenting out until we find a better way to exclude from continuous testing. - //suite.addTestSuite(URLTest.class); - suite.addTestSuite(URITest.class); - suite.addTestSuite(RegexTest.class); - suite.addTestSuite(HashMapTest.class); - suite.addTestSuite(ArrayListTest.class); - suite.addTestSuite(BooleanTest.class); - suite.addTestSuite(StringTest.class); - suite.addTestSuite(BufferedReaderTest.class); - suite.addTestSuite(CharArrayReaderTest.class); - suite.addTestSuite(PushbackReaderTest.class); - suite.addTestSuite(StringReaderTest.class); - suite.addTestSuite(StreamTokenizerTest.class); - suite.addTestSuite(ByteArrayInputStreamTest.class); - suite.addTestSuite(DataInputStreamTest.class); - suite.addTestSuite(BufferedInputStreamTest.class); - suite.addTestSuite(PushbackInputStreamTest.class); - suite.addTestSuite(ByteArrayOutputStreamTest.class); - suite.addTestSuite(DataOutputStreamTest.class); - suite.addTestSuite(BufferedOutputStreamTest.class); - suite.addTestSuite(CharArrayWriterTest.class); - suite.addTestSuite(StringWriterTest.class); - suite.addTestSuite(PrintWriterTest.class); - suite.addTestSuite(BufferedWriterTest.class); - suite.addTestSuite(ClassTest.class); - //To be unccommented when Bug #799327 is fixed. - //suite.addTestSuite(ClassLoaderTest.class); - suite.addTestSuite(LineNumberReaderTest.class); - suite.addTestSuite(InputStreamReaderTest.class); - suite.addTestSuite(OutputStreamWriterTest.class); - suite.addTestSuite(EnumTest.class); - suite.addTestSuite(ParseIntTest.class); - suite.addTestSuite(PipedStreamTest.class); - suite.addTestSuite(LocaleTest.class); - //Commenting out until we find a better way to exclude from continuous testing. - //suite.addTestSuite(InetAddrTest.class); - suite.addTestSuite(SocketTest.class); - suite.addTestSuite(ChecksumTest.class); - suite.addTestSuite(DeflateTest.class); - suite.addTestSuite(ZipStreamTest.class); - suite.addTestSuite(GZIPStreamTest.class); - suite.addTestSuite(ZipFileTest.class); - suite.addTestSuite(FileTest.class); - suite.addTestSuite(SQLiteJDBCDriverTest.class); - suite.addTestSuite(AtParserTest.class); - suite.addTestSuite(DatagramTest.class); - suite.addTestSuite(CryptoTest.class); - suite.addTestSuite(MiscRegressionTest.class); - - return suite; - } -} diff --git a/tests/CoreTests/android/location/LocationManagerProximityTest.java b/tests/CoreTests/android/location/LocationManagerProximityTest.java deleted file mode 100644 index e82d878..0000000 --- a/tests/CoreTests/android/location/LocationManagerProximityTest.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (C) 2008 Google Inc. - * - * 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 android.location; - -import android.app.PendingIntent; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.location.Criteria; -import android.location.Location; -import android.location.LocationManager; -import android.provider.Settings; -import android.test.AndroidTestCase; -import android.test.suitebuilder.annotation.MediumTest; -import android.test.suitebuilder.annotation.Suppress; -import android.util.Log; - -/** - * Tests for LocationManager.addProximityAlert - * - * TODO: add tests for more scenarios - * - * To run: - * adb shell am instrument -e class android.location.LocationManagerProximityTest \ - * -w android.core/android.test.InstrumentationTestRunner - * - * This test requires that the "Allow mock locations" setting be enabled. - * To ensure reliable results, all location providers should be disabled. - * - */ -@Suppress -@MediumTest -public class LocationManagerProximityTest extends AndroidTestCase { - - private static final int UPDATE_LOCATION_WAIT_TIME = 1000; - private static final int PROXIMITY_WAIT_TIME = 2000; - - private LocationManager mLocationManager; - private PendingIntent mPendingIntent; - private TestIntentReceiver mIntentReceiver; - - private static final String LOG_TAG = "LocationProximityTest"; - - private static final String PROVIDER_NAME = "test"; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - // test that mock locations are allowed so a more descriptive error message can be logged - if (Settings.Secure.getInt(getContext().getContentResolver(), - Settings.Secure.ALLOW_MOCK_LOCATION, 0) == 0) { - fail("Mock locations are currently disabled in Settings - this test requires " + - "mock locations"); - } - - mLocationManager = (LocationManager) getContext(). - getSystemService(Context.LOCATION_SERVICE); - if (mLocationManager.getProvider(PROVIDER_NAME) != null) { - mLocationManager.removeTestProvider(PROVIDER_NAME); - } - - mLocationManager.addTestProvider(PROVIDER_NAME, true, //requiresNetwork, - false, // requiresSatellite, - true, // requiresCell, - false, // hasMonetaryCost, - false, // supportsAltitude, - false, // supportsSpeed, s - false, // upportsBearing, - Criteria.POWER_MEDIUM, // powerRequirement - Criteria.ACCURACY_FINE); // accuracy - mLocationManager.setTestProviderEnabled(PROVIDER_NAME, true); - } - - @Override - protected void tearDown() throws Exception { - mLocationManager.removeTestProvider(PROVIDER_NAME); - - if (mPendingIntent != null) { - mLocationManager.removeProximityAlert(mPendingIntent); - } - if (mIntentReceiver != null) { - getContext().unregisterReceiver(mIntentReceiver); - } - } - - /** - * Tests basic proximity alert when entering proximity - */ - public void testEnterProximity() throws Exception { - doTestEnterProximity(10000); - } - - /** - * Tests proximity alert when entering proximity, with no expiration - */ - public void testEnterProximity_noexpire() throws Exception { - doTestEnterProximity(-1); - } - - /** - * Helper variant for testing enter proximity scenario - * TODO: add additional parameters as more scenarios are added - * - * @param expiration - expiry of proximity alert - */ - private void doTestEnterProximity(long expiration) throws Exception { - // update location to outside proximity range - synchronousSendLocation(30, 30); - registerProximityListener(0, 0, 1000, expiration); - sendLocation(0, 0); - waitForAlert(); - assertProximityType(true); - } - - /** - * Tests basic proximity alert when exiting proximity - */ - public void testExitProximity() throws Exception { - // first do enter proximity scenario - doTestEnterProximity(-1); - - // now update to trigger exit proximity proximity - mIntentReceiver.clearReceivedIntents(); - sendLocation(20, 20); - waitForAlert(); - assertProximityType(false); - } - - /** - * Registers the proximity intent receiver - */ - private void registerProximityListener(double latitude, double longitude, - float radius, long expiration) { - String intentKey = "testProximity"; - Intent proximityIntent = new Intent(intentKey); - mPendingIntent = PendingIntent.getBroadcast(getContext(), 0, - proximityIntent, PendingIntent.FLAG_CANCEL_CURRENT); - mIntentReceiver = new TestIntentReceiver(intentKey); - - mLocationManager.addProximityAlert(latitude, longitude, radius, - expiration, mPendingIntent); - - getContext().registerReceiver(mIntentReceiver, - mIntentReceiver.getFilter()); - - } - - /** - * Blocks until proximity intent notification is received - * @throws InterruptedException - */ - private void waitForAlert() throws InterruptedException { - Log.d(LOG_TAG, "Waiting for proximity update"); - synchronized (mIntentReceiver) { - mIntentReceiver.wait(PROXIMITY_WAIT_TIME); - } - - assertNotNull("Did not receive proximity alert", - mIntentReceiver.getLastReceivedIntent()); - } - - /** - * Asserts that the received intent had the enter proximity property set as - * expected - * @param expectedEnterProximity - true if enter proximity expected, false if - * exit expected - */ - private void assertProximityType(boolean expectedEnterProximity) - throws Exception { - boolean proximityTest = mIntentReceiver.getLastReceivedIntent(). - getBooleanExtra(LocationManager.KEY_PROXIMITY_ENTERING, - !expectedEnterProximity); - assertEquals("proximity alert not set to expected enter proximity value", - expectedEnterProximity, proximityTest); - } - - /** - * Synchronous variant of sendLocation - */ - private void synchronousSendLocation(final double latitude, - final double longitude) - throws InterruptedException { - sendLocation(latitude, longitude, this); - // wait for location to be set - synchronized (this) { - wait(UPDATE_LOCATION_WAIT_TIME); - } - } - - /** - * Asynchronously update the mock location provider without notification - */ - private void sendLocation(final double latitude, final double longitude) { - sendLocation(latitude, longitude, null); - } - - /** - * Asynchronously update the mock location provider with given latitude and - * longitude - * - * @param latitude - update location - * @param longitude - update location - * @param observer - optionally, object to notify when update is sent.If - * null, no update will be sent - */ - private void sendLocation(final double latitude, final double longitude, - final Object observer) { - Thread locationUpdater = new Thread() { - @Override - public void run() { - Location loc = new Location(PROVIDER_NAME); - loc.setLatitude(latitude); - loc.setLongitude(longitude); - - loc.setTime(java.lang.System.currentTimeMillis()); - Log.d(LOG_TAG, "Sending update for " + PROVIDER_NAME); - mLocationManager.setTestProviderLocation(PROVIDER_NAME, loc); - if (observer != null) { - synchronized (observer) { - observer.notify(); - } - } - } - }; - locationUpdater.start(); - - } - - /** - * Helper class that receives a proximity intent and notifies the main class - * when received - */ - private static class TestIntentReceiver extends BroadcastReceiver { - - private String mExpectedAction; - private Intent mLastReceivedIntent; - - public TestIntentReceiver(String expectedAction) { - mExpectedAction = expectedAction; - mLastReceivedIntent = null; - } - - public IntentFilter getFilter() { - IntentFilter filter = new IntentFilter(mExpectedAction); - return filter; - } - - @Override - public void onReceive(Context context, Intent intent) { - if (intent != null && mExpectedAction.equals(intent.getAction())) { - Log.d(LOG_TAG, "Intent Received: " + intent.toString()); - mLastReceivedIntent = intent; - synchronized (this) { - notify(); - } - } - } - - public Intent getLastReceivedIntent() { - return mLastReceivedIntent; - } - - public void clearReceivedIntents() { - mLastReceivedIntent = null; - } - } -} diff --git a/tests/CoreTests/com/android/internal/telephony/TelephonyTests.java b/tests/CoreTests/com/android/internal/telephony/TelephonyTests.java deleted file mode 100644 index fdfafe1..0000000 --- a/tests/CoreTests/com/android/internal/telephony/TelephonyTests.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2006 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.internal.telephony; - -import com.android.internal.telephony.AdnRecordTest; -import com.android.internal.telephony.gsm.GSMPhoneTest; -import com.android.internal.telephony.GsmAlphabetTest; -import com.android.internal.telephony.SMSDispatcherTest; -import com.android.internal.telephony.SimPhoneBookTest; -import com.android.internal.telephony.SimSmsTest; -import com.android.internal.telephony.SimUtilsTest; - -import junit.framework.TestSuite; - -/** - * To run these tests: - * $ mmm java/tests && adb sync - * $ adb shell am instrument -w \ - * -e class com.android.internal.telephony.TelephonyTests \ - * android.core/android.test.InstrumentationTestRunner - */ -public class TelephonyTests { - public static TestSuite suite() { - TestSuite suite = new TestSuite(TelephonyTests.class.getName()); - - suite.addTestSuite(PhoneNumberWatcherTest.class); - suite.addTestSuite(ATResponseParserTest.class); - suite.addTestSuite(PhoneNumberUtilsTest.class); - suite.addTestSuite(SMSDispatcherTest.class); - //suite.addTestSuite(GSMPhoneTest.class); - suite.addTestSuite(AdnRecordTest.class); - suite.addTestSuite(GsmAlphabetTest.class); - suite.addTestSuite(SimUtilsTest.class); - suite.addTestSuite(SimPhoneBookTest.class); - suite.addTestSuite(SimSmsTest.class); - suite.addTestSuite(TelephonyUtilsTest.class); - - return suite; - } -} |