am 685fcf36: am c95812e6: Merge "Move out all framework-tests classes." into gingerbread

Merge commit '685fcf364b84d5ac911ae9cbbc4fec99f36cbd48'

* commit '685fcf364b84d5ac911ae9cbbc4fec99f36cbd48':
  Move out all framework-tests classes.
This commit is contained in:
Brett Chabot
2010-06-16 14:42:51 -07:00
committed by Android Git Automerger
38 changed files with 68 additions and 63 deletions

View File

@ -16,7 +16,6 @@
package android.text;
import android.text.PackedIntVector;
import junit.framework.TestCase;
/**

View File

@ -4,9 +4,11 @@ LOCAL_PATH:= $(call my-dir)
# ============================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(call all-subdir-java-files)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_MODULE := android.policy
include $(BUILD_JAVA_LIBRARY)
# additionally, build unit tests in a separate .apk
include $(call all-makefiles-under,$(LOCAL_PATH))

29
policy/tests/Android.mk Normal file
View File

@ -0,0 +1,29 @@
# Copyright 2010, 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.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
LOCAL_JAVA_LIBRARIES := android.policy android.test.runner
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := FrameworkPolicyTests
include $(BUILD_PACKAGE)

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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.policy.tests">
<application>
<uses-library android:name="android.test.runner" />
</application>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.android.frameworks.policy.tests"
android:label="Framework policy tests" />
</manifest>

View File

@ -55,8 +55,8 @@ public class LockPatternKeyguardViewTest extends AndroidTestCase {
boolean isLockPatternEnabled = true;
public boolean isPermanentlyLocked = false;
public MockLockPatternUtils() {
super(null);
public MockLockPatternUtils(Context context) {
super(context);
}
@Override
@ -149,7 +149,7 @@ public class LockPatternKeyguardViewTest extends AndroidTestCase {
@Override
View createUnlockScreenFor(UnlockMode unlockMode) {
final MockKeyguardScreen newView = new MockKeyguardScreen(getContext());
if (mInjectedUnlockScreens == null) mInjectedUnlockScreens = Lists.newArrayList();
if (mInjectedUnlockScreens == null) mInjectedUnlockScreens = Lists.newArrayList();
mInjectedUnlockScreens.add(newView);
return newView;
}
@ -197,7 +197,7 @@ public class LockPatternKeyguardViewTest extends AndroidTestCase {
protected void setUp() throws Exception {
super.setUp();
mUpdateMonitor = new MockUpdateMonitor(getContext());
mLockPatternUtils = new MockLockPatternUtils();
mLockPatternUtils = new MockLockPatternUtils(getContext());
mLPKV = new TestableLockPatternKeyguardView(getContext(), mUpdateMonitor,
mLockPatternUtils, new KeyguardWindowController() {

View File

@ -1 +0,0 @@
include $(call all-subdir-makefiles)

View File

@ -1,5 +0,0 @@
This package contains tests which need to access package-private members in the framework code.
To do this, the tests must be loaded in the same class loader as the classes which they are
testing. This package is loaded in the boot classpath.
Run these tests via AndroidTests -> FrameworkTests.

View File

@ -1,10 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_MODULE := framework-tests
LOCAL_JAVA_LIBRARIES := android.policy android.test.runner
include $(BUILD_JAVA_LIBRARY)

View File

@ -1,40 +0,0 @@
/*
* Copyright (C) 2007 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.test;
import com.android.internal.os.LoggingPrintStreamTest;
import junit.framework.TestSuite;
import com.android.internal.http.multipart.MultipartTest;
import com.android.internal.policy.impl.LockPatternKeyguardViewTest;
/**
* Tests that are loaded in the boot classpath along with the Android framework
* classes. This enables you to access package-private members in the framework
* classes; doing so is not possible when the test classes are loaded in an
* application classloader.
*/
public class FrameworkTests {
public static TestSuite suite() {
TestSuite suite = new TestSuite(FrameworkTests.class.getName());
suite.addTestSuite(MultipartTest.class);
suite.addTestSuite(LoggingPrintStreamTest.class);
suite.addTestSuite(LockPatternKeyguardViewTest.class);
return suite;
}
}