am 06100c10: am 48cd1128: Merge "Remove Profile Annotations Experiment" into froyo
* commit '06100c103db258ec8b46f2c815c32d337d45367e':
Remove Profile Annotations Experiment
diff --git a/libs/annotation/src/android/annotation/cts/Profile.java b/libs/annotation/src/android/annotation/cts/Profile.java
deleted file mode 100644
index 35769ad..0000000
--- a/libs/annotation/src/android/annotation/cts/Profile.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.
- */
-
-package android.annotation.cts;
-
-/**
- * Profile of the device being tested. Certain tests are applicable only to certain device profiles
- * when annotated with the {@link SupportedProfiles} annotation and this enum.
- */
-public enum Profile {
- ALL,
- HANDHELD,
- STB,
-}
diff --git a/libs/annotation/src/android/annotation/cts/SupportedProfiles.java b/libs/annotation/src/android/annotation/cts/SupportedProfiles.java
deleted file mode 100644
index 24a9e21..0000000
--- a/libs/annotation/src/android/annotation/cts/SupportedProfiles.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-
-package android.annotation.cts;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation for specifying what device profiles are supported by the test. The device's profile
- * must match one of the profiles specified by the annotation. Not having the annotation means the
- * test should be executed for all devices.
- * <p>
- * Examples:
- * <pre>
- * @SupportedProfiles(Profile.HANDHELD)
- * @SupportedProfiles({Profile.HANDHELD, Profile.STB})
- * </pre>
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface SupportedProfiles {
- Profile[] value();
-}
diff --git a/tests/core/runner/src/android/test/InstrumentationCtsTestRunner.java b/tests/core/runner/src/android/test/InstrumentationCtsTestRunner.java
index fbd89ad..b5f1919 100644
--- a/tests/core/runner/src/android/test/InstrumentationCtsTestRunner.java
+++ b/tests/core/runner/src/android/test/InstrumentationCtsTestRunner.java
@@ -22,9 +22,7 @@
import dalvik.annotation.BrokenTest;
import dalvik.annotation.SideEffect;
-import android.annotation.cts.Profile;
import android.annotation.cts.RequiredFeatures;
-import android.annotation.cts.SupportedProfiles;
import android.app.Instrumentation;
import android.app.KeyguardManager;
import android.content.Context;
@@ -67,15 +65,10 @@
*/
private static final String TAG = "InstrumentationCtsTestRunner";
- private static final String ARGUMENT_PROFILE = "profile";
-
private static final String REPORT_VALUE_ID = "InstrumentationCtsTestRunner";
private static final int REPORT_VALUE_RESULT_OMITTED = -3;
- /** Profile of the device being tested or null to run all tests regardless of profile. */
- private Profile mProfile;
-
/**
* True if (and only if) we are running in single-test mode (as opposed to
* batch mode).
@@ -102,15 +95,6 @@
if (arguments != null) {
String classArg = arguments.getString(ARGUMENT_TEST_CLASS);
mSingleTest = classArg != null && classArg.contains("#");
-
- String profileArg = arguments.getString(ARGUMENT_PROFILE);
- if (profileArg != null) {
- mProfile = Profile.valueOf(profileArg.toUpperCase());
- } else {
- mProfile = Profile.ALL;
- }
- } else {
- mProfile = Profile.ALL;
}
// attempt to disable keyguard, if current test has permission to do so
@@ -250,7 +234,6 @@
Predicates.not(new HasAnnotation(BrokenTest.class));
builderRequirements.add(brokenTestPredicate);
- builderRequirements.add(getProfilePredicate(mProfile));
builderRequirements.add(getFeaturePredicate());
if (!mSingleTest) {
@@ -283,47 +266,6 @@
sendStatus(REPORT_VALUE_RESULT_OMITTED, bundle);
}
- private Predicate<TestMethod> getProfilePredicate(final Profile specifiedProfile) {
- return new Predicate<TestMethod>() {
- public boolean apply(TestMethod t) {
- if (isValidTest(t)) {
- // InstrumentationTestRunner will run the test and send back results.
- return true;
- } else {
- // InstrumentationTestRunner WON'T run the test, so send back omitted status.
- sendOmittedStatus(t);
- return false;
- }
- }
-
- private boolean isValidTest(TestMethod t) {
- Set<Profile> profiles = new HashSet<Profile>();
- add(profiles, t.getAnnotation(SupportedProfiles.class));
- add(profiles, t.getEnclosingClass().getAnnotation(SupportedProfiles.class));
-
- /*
- * Run the test if any of the following conditions are met:
- *
- * 1. No profile for the device was specified. This means run all tests.
- * 2. Specified profile is the ALL profile. This also means run all tests.
- * 3. The test does not require a specific type of profile.
- * 4. The test specifies that all profiles are supported by the test.
- * 5. The test requires a profile which matches the specified profile.
- */
- return specifiedProfile == null
- || specifiedProfile == Profile.ALL
- || profiles.isEmpty()
- || profiles.contains(Profile.ALL)
- || profiles.contains(specifiedProfile);
- }
-
- private void add(Set<Profile> profiles, SupportedProfiles annotation) {
- if (annotation != null) {
- Collections.addAll(profiles, annotation.value());
- }
- }
- };
- }
private Predicate<TestMethod> getFeaturePredicate() {
return new Predicate<TestMethod>() {
diff --git a/tests/tests/app/src/android/app/cts/ProfileFeaturesTest.java b/tests/tests/app/src/android/app/cts/ProfileFeaturesTest.java
deleted file mode 100644
index 328300f..0000000
--- a/tests/tests/app/src/android/app/cts/ProfileFeaturesTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-
-package android.app.cts;
-
-import android.annotation.cts.Profile;
-import android.annotation.cts.RequiredFeatures;
-import android.annotation.cts.SupportedProfiles;
-import android.content.pm.PackageManager;
-import android.test.AndroidTestCase;
-
-/**
- * Test for checking that devices with different profiles report the correct combination of
- * features mandated by the CDD.
- * <p>
- * It is also currently a demonstration of the {@link SupportedProfiles} and
- * {@link RequiredFeatures} annotations.
- */
-public class ProfileFeaturesTest extends AndroidTestCase {
-
- @SupportedProfiles(Profile.HANDHELD)
- public void testHandheldFeatures() {
- // TODO: Add tests to check that this handheld reports a correct combination of features.
- }
-
- @SupportedProfiles(Profile.STB)
- public void testStbFeatures() {
- // TODO: Add tests to check that the STB reports a correct combination of features.
- }
-
- @RequiredFeatures(PackageManager.FEATURE_TELEPHONY_CDMA)
- public void testRequiredFeatures() {
- // This is just a demonstration and compilation test of the RequiredFeatures annotation
- // that can be removed later when the annotation starts being used.
- }
-}
diff --git a/tools/host/src/com/android/cts/CTSCommand.java b/tools/host/src/com/android/cts/CTSCommand.java
index 88604ff..7755f5c 100644
--- a/tools/host/src/com/android/cts/CTSCommand.java
+++ b/tools/host/src/com/android/cts/CTSCommand.java
@@ -45,5 +45,4 @@
static final String OPTION_SESSION = "--session";
static final String OPTION_CFG = "--config";
static final String OPTION_DERIVED_PLAN = "--derivedplan";
- static final String OPTION_PROFILE = "--profile";
}
diff --git a/tools/host/src/com/android/cts/CommandParser.java b/tools/host/src/com/android/cts/CommandParser.java
index 4c65317..74c3280 100644
--- a/tools/host/src/com/android/cts/CommandParser.java
+++ b/tools/host/src/com/android/cts/CommandParser.java
@@ -54,8 +54,7 @@
private static Set<String> sOptionsSet = new HashSet<String>(Arrays.asList(
CTSCommand.OPTION_CFG, CTSCommand.OPTION_PACKAGE, CTSCommand.OPTION_PLAN,
CTSCommand.OPTION_DEVICE, CTSCommand.OPTION_RESULT, CTSCommand.OPTION_E,
- CTSCommand.OPTION_SESSION, CTSCommand.OPTION_TEST, CTSCommand.OPTION_DERIVED_PLAN,
- CTSCommand.OPTION_PROFILE));
+ CTSCommand.OPTION_SESSION, CTSCommand.OPTION_TEST, CTSCommand.OPTION_DERIVED_PLAN));
private static HashMap<String, String> sOptionMap = new HashMap<String, String>();
static {
final String[] keys = new String[] {
@@ -72,8 +71,7 @@
CTSCommand.OPTION_SESSION,
CTSCommand.OPTION_T,
CTSCommand.OPTION_TEST,
- CTSCommand.OPTION_DERIVED_PLAN,
- CTSCommand.OPTION_PROFILE};
+ CTSCommand.OPTION_DERIVED_PLAN};
final String[] values = new String[] {
CTSCommand.OPTION_CFG,
@@ -89,8 +87,7 @@
CTSCommand.OPTION_SESSION,
CTSCommand.OPTION_TEST,
CTSCommand.OPTION_TEST,
- CTSCommand.OPTION_DERIVED_PLAN,
- CTSCommand.OPTION_PROFILE};
+ CTSCommand.OPTION_DERIVED_PLAN};
for (int i = 0; i < keys.length; i++) {
sOptionMap.put(keys[i], values[i]);
diff --git a/tools/host/src/com/android/cts/ConsoleUi.java b/tools/host/src/com/android/cts/ConsoleUi.java
index 7ebf01a..c9b0e1d 100644
--- a/tools/host/src/com/android/cts/ConsoleUi.java
+++ b/tools/host/src/com/android/cts/ConsoleUi.java
@@ -21,8 +21,6 @@
import org.xml.sax.SAXException;
-import android.annotation.cts.Profile;
-
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
@@ -256,27 +254,25 @@
final String testStr = CTSCommand.OPTION_T + "/" + CTSCommand.OPTION_TEST;
final String deviceStr = CTSCommand.OPTION_D + "/" + CTSCommand.OPTION_DEVICE;
final String pkgStr = CTSCommand.OPTION_P + "/" + CTSCommand.OPTION_PACKAGE;
- final String profileOptionStr = "[" + CTSCommand.OPTION_PROFILE + " profile_name]";
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
- + cmdStr + " test_plan_name " + profileOptionStr
- + ": run a test plan");
+ + cmdStr + " test_plan_name: run a test plan");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
- + cmdStr + " test_plan_name " + deviceStr + " device_ID " + profileOptionStr
+ + cmdStr + " test_plan_name " + deviceStr + " device_ID"
+ ": run a test plan using the specified device");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
- + cmdStr + " test_plan_name " + testStr + " test_name " + profileOptionStr
+ + cmdStr + " test_plan_name " + testStr + " test_name"
+ ": run a specific test");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
- + cmdStr + " test_plan_name " + pkgStr + " java_package_name " + profileOptionStr
+ + cmdStr + " test_plan_name " + pkgStr + " java_package_name"
+ ": run a specific java package");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
+ cmdStr + " test_plan_name " + testStr + " test_name "
- + deviceStr + " device_ID " + profileOptionStr
+ + deviceStr + " device_ID"
+ ": run a specific test using the specified device");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
+ cmdStr + " test_plan_name " + pkgStr + " java_package_name "
- + deviceStr + " device_ID " + profileOptionStr
+ + deviceStr + " device_ID"
+ ": run a specific java package using the specified device");
}
@@ -364,7 +360,7 @@
private void processStartPackageCommand(CommandParser cp) {
try {
String pathName = cp.getValue(CTSCommand.OPTION_PACKAGE);
- mHost.startZippedPackage(pathName, getProfile(cp));
+ mHost.startZippedPackage(pathName);
} catch (DeviceDisconnectedException e) {
Log.e("Device " + e.getMessage() + " disconnected", e);
} catch (Exception e) {
@@ -394,9 +390,6 @@
} else if (isValidCommandOption(cp, CTSCommand.START,
CTSCommand.OPTION_P)) {
return true;
- } else if (isValidCommandOption(cp, CTSCommand.START,
- CTSCommand.OPTION_PROFILE)) {
- return true;
} else {
return false;
}
@@ -442,8 +435,6 @@
return;
}
- Profile profile = getProfile(cp);
-
String testPlanPath = null;
String deviceId = null;
String testName = null;
@@ -485,7 +476,7 @@
if ((testName == null) || (testName.length() == 0)) {
String mode = chooseMode(sessionList);
if (CREATE_SESSION.equals(mode)) {
- ts = TestHost.createSession(testPlanName, profile);
+ ts = TestHost.createSession(testPlanName);
}
}
if (ts == null) {
@@ -523,7 +514,7 @@
}
if (ts == null) {
- ts = TestHost.createSession(testPlanName, profile);
+ ts = TestHost.createSession(testPlanName);
}
mHost.startSession(ts, deviceId, testName, javaPkgName, actionType);
@@ -550,15 +541,6 @@
}
}
- private Profile getProfile(CommandParser cp) {
- String profileOption = cp.getValue(CTSCommand.OPTION_PROFILE);
- if (profileOption != null) {
- return Profile.valueOf(profileOption.toUpperCase());
- } else {
- return Profile.ALL;
- }
- }
-
/**
* Choose test session among the available test session list.
*
@@ -1201,8 +1183,8 @@
CUIOutputStream.println("There aren't any test results!");
} else {
CUIOutputStream.println("List of all results: ");
- CUIOutputStream.println("Session\t\tTest result\t\t\t\tStart time\t\tEnd time\t"
- + "\tProfile\tTest plan name\t");
+ CUIOutputStream.println("Session\t\tTest result\t\t\t\t\tStart time\t\tEnd time\t"
+ + "\tTest plan name\t");
CUIOutputStream.println("\t\tPass\tFail\tTimeout\tOmitted\tNotExecuted");
for (TestSession session : sessions) {
@@ -1230,7 +1212,6 @@
CUIOutputStream.println(Long.toString(session.getId()) + "\t\t"
+ resStr + "\t\t" + startTimeStr
+ "\t" + endTimeStr
- + "\t" + log.getProfile().name()
+ "\t" + log.getTestPlanName());
}
diff --git a/tools/host/src/com/android/cts/HostSideOnlyPackage.java b/tools/host/src/com/android/cts/HostSideOnlyPackage.java
index 144be06..0dab280 100644
--- a/tools/host/src/com/android/cts/HostSideOnlyPackage.java
+++ b/tools/host/src/com/android/cts/HostSideOnlyPackage.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.io.IOException;
/**
@@ -49,12 +47,12 @@
/** {@inheritDoc} */
@Override
- protected void runImpl(final String javaPkgName, Profile profile)
+ protected void runImpl(final String javaPkgName)
throws IOException, DeviceDisconnectedException, ADBServerNeedRestartException {
try {
if (!mTestStop) {
Log.d("run in individual mode...");
- runInIndividualMode(javaPkgName, profile);
+ runInIndividualMode(javaPkgName);
}
} catch (DeviceDisconnectedException e) {
cleanUp();
@@ -64,12 +62,12 @@
/** {@inheritDoc} */
@Override
- protected void runTestImpl(final Test test, Profile profile) throws DeviceDisconnectedException,
+ protected void runTestImpl(final Test test) throws DeviceDisconnectedException,
ADBServerNeedRestartException {
try {
if (!mTestStop) {
mCurrentTestSuite = test.getTestSuite();
- mCurrentTestSuite.run(mDevice, test, profile);
+ mCurrentTestSuite.run(mDevice, test);
}
} catch (DeviceDisconnectedException e) {
cleanUp();
diff --git a/tools/host/src/com/android/cts/HostSideOnlyTest.java b/tools/host/src/com/android/cts/HostSideOnlyTest.java
index 5318834..187fc53 100644
--- a/tools/host/src/com/android/cts/HostSideOnlyTest.java
+++ b/tools/host/src/com/android/cts/HostSideOnlyTest.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.io.IOException;
import junit.framework.TestResult;
@@ -79,7 +77,7 @@
/** {@inheritDoc} */
@Override
- protected void runImpl(Profile profile) {
+ protected void runImpl() {
mHostSideTestRunner = new HostSideTestRunner(this);
mHostSideTestRunner.start();
}
diff --git a/tools/host/src/com/android/cts/ReferenceAppTestPackage.java b/tools/host/src/com/android/cts/ReferenceAppTestPackage.java
index d48708f..0b6aa50 100644
--- a/tools/host/src/com/android/cts/ReferenceAppTestPackage.java
+++ b/tools/host/src/com/android/cts/ReferenceAppTestPackage.java
@@ -23,8 +23,6 @@
import com.android.ddmlib.log.LogReceiver.ILogListener;
import com.android.ddmlib.log.LogReceiver.LogEntry;
-import android.annotation.cts.Profile;
-
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
diff --git a/tools/host/src/com/android/cts/SignatureCheckPackage.java b/tools/host/src/com/android/cts/SignatureCheckPackage.java
index 8692c9d..ddc06a0 100644
--- a/tools/host/src/com/android/cts/SignatureCheckPackage.java
+++ b/tools/host/src/com/android/cts/SignatureCheckPackage.java
@@ -18,8 +18,6 @@
import com.android.ddmlib.MultiLineReceiver;
-import android.annotation.cts.Profile;
-
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/tools/host/src/com/android/cts/Test.java b/tools/host/src/com/android/cts/Test.java
index 00411a0..2cd119b 100644
--- a/tools/host/src/com/android/cts/Test.java
+++ b/tools/host/src/com/android/cts/Test.java
@@ -18,8 +18,6 @@
import com.android.cts.TestSession.ResultObserver;
-import android.annotation.cts.Profile;
-
import java.util.TimerTask;
/**
@@ -318,9 +316,8 @@
* Run the test over device given.
*
* @param device the device to run the test.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, Profile profile) throws DeviceDisconnectedException,
+ public void run(final TestDevice device) throws DeviceDisconnectedException,
ADBServerNeedRestartException {
if ((getName() == null) || (getName().length() == 0)) {
@@ -345,7 +342,7 @@
String testFullName = getFullName();
print(testFullName + "...");
- runImpl(profile);
+ runImpl();
synchronized (mTimeOutTimer) {
if (!mTestStop) {
@@ -372,8 +369,8 @@
/**
* Implementation of running test.
*/
- protected void runImpl(Profile profile) throws DeviceDisconnectedException {
- mDevice.runTest(this, profile);
+ protected void runImpl() throws DeviceDisconnectedException {
+ mDevice.runTest(this);
}
/**
diff --git a/tools/host/src/com/android/cts/TestCase.java b/tools/host/src/com/android/cts/TestCase.java
index bc4f14b..799dc15 100644
--- a/tools/host/src/com/android/cts/TestCase.java
+++ b/tools/host/src/com/android/cts/TestCase.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -192,16 +190,15 @@
* Run the test case over device given.
*
* @param device The device to run the test case over.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, Profile profile) throws DeviceDisconnectedException,
+ public void run(final TestDevice device) throws DeviceDisconnectedException,
ADBServerNeedRestartException {
mTestStop = false;
Iterator<Test> tests = getTests().iterator();
while (tests.hasNext() && (!mTestStop)) {
mCurrentTest = tests.next();
if (mCurrentTest.getResult().isNotExecuted()) {
- mCurrentTest.run(device, profile);
+ mCurrentTest.run(device);
}
}
}
@@ -211,13 +208,12 @@
*
* @param device The device to run the test over.
* @param test The specific test to be run.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, final Test test, Profile profile)
+ public void run(final TestDevice device, final Test test)
throws DeviceDisconnectedException, ADBServerNeedRestartException {
mTestStop = false;
mCurrentTest = test;
- mCurrentTest.run(device, profile);
+ mCurrentTest.run(device);
}
/** {@inheritDoc} */
diff --git a/tools/host/src/com/android/cts/TestDevice.java b/tools/host/src/com/android/cts/TestDevice.java
index d434389..83a5763 100644
--- a/tools/host/src/com/android/cts/TestDevice.java
+++ b/tools/host/src/com/android/cts/TestDevice.java
@@ -32,8 +32,6 @@
import com.android.ddmlib.log.LogReceiver;
import com.android.ddmlib.log.LogReceiver.ILogListener;
-import android.annotation.cts.Profile;
-
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -857,7 +855,7 @@
*
* @param test The test to be run.
*/
- public void runTest(Test test, Profile profile) throws DeviceDisconnectedException {
+ public void runTest(Test test) throws DeviceDisconnectedException {
final String appNameSpace = test.getAppNameSpace();
String runner = test.getInstrumentationRunner();
@@ -870,7 +868,7 @@
final String testName = test.getFullName().replaceAll("\\$", "\\\\\\$");
final String commandStr = "am instrument -w -r -e class " + testName
- + " -e profile " + profile + " " + appNameSpace + "/" + runner;
+ + " " + appNameSpace + "/" + runner;
Log.d(commandStr);
executeShellCommand(commandStr, new IndividualModeResultParser(test));
}
@@ -882,7 +880,7 @@
* @param javaPkgName The java package name. If null, run the whole test package;
* else, run the specified java package contained in the test package
*/
- public void runInBatchMode(TestPackage testPackage, final String javaPkgName, Profile profile)
+ public void runInBatchMode(TestPackage testPackage, final String javaPkgName)
throws DeviceDisconnectedException {
String appNameSpace = testPackage.getAppNameSpace();
String runner = testPackage.getInstrumentationRunner();
@@ -895,8 +893,7 @@
name = javaPkgName;
}
- String cmdHeader = "am instrument -w -r -e package " + name
- + " -e profile " + profile + " ";
+ String cmdHeader = "am instrument -w -r -e package " + name + " ";
final String commandStr = cmdHeader + appNameSpace + "/" + runner;
Log.d(commandStr);
diff --git a/tools/host/src/com/android/cts/TestHost.java b/tools/host/src/com/android/cts/TestHost.java
index c721e4b..e18bc79 100644
--- a/tools/host/src/com/android/cts/TestHost.java
+++ b/tools/host/src/com/android/cts/TestHost.java
@@ -22,8 +22,6 @@
import org.xml.sax.SAXException;
-import android.annotation.cts.Profile;
-
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
@@ -137,9 +135,8 @@
* Start zipped package.
*
* @param pathName The path name of the zipped package.
- * @param profile The profile of the device being tested.
*/
- public void startZippedPackage(final String pathName, Profile profile)
+ public void startZippedPackage(final String pathName)
throws FileNotFoundException,
IOException,
ParserConfigurationException,
@@ -171,7 +168,7 @@
// step 3: start the plan
TestSession ts = startSession(TEMP_PLAN_NAME, getFirstAvailableDevice().getSerialNumber(),
- null, profile);
+ null);
// step 4: copy the resulting zip file
String resultName = pathName.substring(0, pathName.lastIndexOf("."))
@@ -512,12 +509,12 @@
* @param testPlanName the name of the specified test plan
* @return a {@link TestSession}
*/
- static public TestSession createSession(final String testPlanName, Profile profile)
+ static public TestSession createSession(final String testPlanName)
throws IOException, TestNotFoundException, SAXException,
ParserConfigurationException, TestPlanNotFoundException, NoSuchAlgorithmException {
String testPlanPath = sConfig.getPlanRepository().getPlanPath(testPlanName);
- TestSession ts = TestSessionBuilder.getInstance().build(testPlanPath, profile);
+ TestSession ts = TestSessionBuilder.getInstance().build(testPlanPath);
sSessions.add(ts);
return ts;
@@ -642,14 +639,14 @@
* @param javaPkgName The specific java package name to be run.
*/
public TestSession startSession(final String testPlanName,
- String deviceId, final String javaPkgName, Profile profile)
+ String deviceId, final String javaPkgName)
throws IOException, DeviceNotAvailableException,
TestNotFoundException, SAXException, ParserConfigurationException,
TestPlanNotFoundException, IllegalTestNameException,
DeviceDisconnectedException, NoSuchAlgorithmException,
InvalidNameSpaceException, InvalidApkPathException {
- TestSession ts = createSession(testPlanName, profile);
+ TestSession ts = createSession(testPlanName);
if ((javaPkgName != null) && (javaPkgName.length() != 0)) {
runTest(ts, deviceId, null, javaPkgName, ActionType.RUN_SINGLE_JAVA_PACKAGE);
} else {
diff --git a/tools/host/src/com/android/cts/TestPackage.java b/tools/host/src/com/android/cts/TestPackage.java
index f98628b..8647ade 100644
--- a/tools/host/src/com/android/cts/TestPackage.java
+++ b/tools/host/src/com/android/cts/TestPackage.java
@@ -18,8 +18,6 @@
import com.android.cts.TestSession.TestSessionThread;
-import android.annotation.cts.Profile;
-
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
@@ -852,9 +850,8 @@
*
* @param javaPkgName The java package name. If null, run the whole package;
* else, run the specified java package contained in this package
- * @param profile The profile of the device being tested.
*/
- private void runInBatchMode(final String javaPkgName, Profile profile)
+ private void runInBatchMode(final String javaPkgName)
throws DeviceDisconnectedException {
mTimeOutTimer = new HostTimer(new TimeOutTask(this),
HostConfig.Ints.batchStartTimeoutMs.value());
@@ -862,10 +859,10 @@
mProgressObserver = new ProgressObserver();
if ((javaPkgName != null) && (javaPkgName.length() > 0)) {
- runInBatchModeImpl(javaPkgName, profile);
+ runInBatchModeImpl(javaPkgName);
} else {
for (String pkgName : getPackageNames()) {
- runInBatchModeImpl(pkgName, profile);
+ runInBatchModeImpl(pkgName);
}
}
}
@@ -874,11 +871,10 @@
* Implementation of running in batch mode.
*
* @param javaPkgName The java package name.
- * @param profile The profile of the device being tested.
*/
- private void runInBatchModeImpl(String javaPkgName, Profile profile)
+ private void runInBatchModeImpl(String javaPkgName)
throws DeviceDisconnectedException {
- mDevice.runInBatchMode(this, javaPkgName, profile);
+ mDevice.runInBatchMode(this, javaPkgName);
synchronized (mTimeOutTimer) {
if (!mTestStop) {
@@ -906,12 +902,12 @@
* @param javaPkgName The java package name.
* @param profile The profile of the device being tested.
*/
- protected void runInIndividualMode(final String javaPkgName, Profile profile) throws IOException,
+ protected void runInIndividualMode(final String javaPkgName) throws IOException,
DeviceDisconnectedException, ADBServerNeedRestartException {
Iterator<TestSuite> suites = getTestSuites().iterator();
while (suites.hasNext() && (!mTestStop)) {
mCurrentTestSuite = suites.next();
- mCurrentTestSuite.run(mDevice, javaPkgName, profile);
+ mCurrentTestSuite.run(mDevice, javaPkgName);
}
}
@@ -1000,7 +996,7 @@
}
setup(device, javaPkgName);
- runImpl(javaPkgName, sessionLog.getProfile());
+ runImpl(javaPkgName);
}
/**
@@ -1009,7 +1005,7 @@
* @param javaPkgName The JAVA package name.
* @param profile The profile of the device being tested.
*/
- protected void runImpl(final String javaPkgName, Profile profile) throws IOException,
+ protected void runImpl(final String javaPkgName) throws IOException,
DeviceDisconnectedException, ADBServerNeedRestartException, InvalidApkPathException,
InvalidNameSpaceException {
try {
@@ -1026,15 +1022,15 @@
if (supportsBatchMode()) {
mIsInBatchMode = true;
Log.d("run in batch mode...");
- runInBatchMode(javaPkgName, profile);
+ runInBatchMode(javaPkgName);
if (!isAllTestsRun()) {
mIsInBatchMode = false;
Log.d("run in individual mode");
- runInIndividualMode(javaPkgName, profile);
+ runInIndividualMode(javaPkgName);
}
} else {
Log.d("run in individual mode...");
- runInIndividualMode(javaPkgName, profile);
+ runInIndividualMode(javaPkgName);
}
}
@@ -1100,7 +1096,7 @@
* @param test The specific test to be run.
* @param profile The profile of the device being tested.
*/
- public void runTest(final TestDevice device, final Test test, Profile profile)
+ public void runTest(final TestDevice device, final Test test)
throws DeviceDisconnectedException, ADBServerNeedRestartException,
InvalidApkPathException, InvalidNameSpaceException {
@@ -1115,7 +1111,7 @@
println("Test package: " + getAppPackageName());
setTestDevice(device);
- runTestImpl(test, profile);
+ runTestImpl(test);
}
/**
@@ -1124,7 +1120,7 @@
* @param test The test to be run.
* @param profile The profile of the device being tested.
*/
- protected void runTestImpl(final Test test, Profile profile) throws DeviceDisconnectedException,
+ protected void runTestImpl(final Test test) throws DeviceDisconnectedException,
ADBServerNeedRestartException, InvalidApkPathException,
InvalidNameSpaceException {
try {
@@ -1135,7 +1131,7 @@
if (!mTestStop) {
Log.d("install " + getAppPackageName() + " succeed!");
mCurrentTestSuite = test.getTestSuite();
- mCurrentTestSuite.run(mDevice, test, profile);
+ mCurrentTestSuite.run(mDevice, test);
}
if (!mTestStop) {
diff --git a/tools/host/src/com/android/cts/TestSession.java b/tools/host/src/com/android/cts/TestSession.java
index 1179512..fedd756 100644
--- a/tools/host/src/com/android/cts/TestSession.java
+++ b/tools/host/src/com/android/cts/TestSession.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.io.IOException;
import java.util.Collection;
@@ -398,7 +396,7 @@
if (mTest != null) {
TestPackage pkg = mTest.getTestPackage();
pkg.setSessionThread(this);
- pkg.runTest(mDevice, mTest, mSessionLog.getProfile());
+ pkg.runTest(mDevice, mTest);
} else if (mTestPackage != null) {
mTestPackage.setSessionThread(this);
mTestPackage.run(mDevice, mJavaPackageName, mSessionLog);
diff --git a/tools/host/src/com/android/cts/TestSessionBuilder.java b/tools/host/src/com/android/cts/TestSessionBuilder.java
index 6ea996d..de937a6 100644
--- a/tools/host/src/com/android/cts/TestSessionBuilder.java
+++ b/tools/host/src/com/android/cts/TestSessionBuilder.java
@@ -20,8 +20,6 @@
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
-import android.annotation.cts.Profile;
-
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -103,7 +101,7 @@
* @param config TestPlan XML configuration file.
* @return TestSession.
*/
- public TestSession build(final String config, Profile profile) throws SAXException, IOException,
+ public TestSession build(final String config) throws SAXException, IOException,
TestPlanNotFoundException, TestNotFoundException, NoSuchAlgorithmException {
File file = new File(config);
if (!file.exists()) {
@@ -135,7 +133,7 @@
planName = planFileName;
}
- TestSessionLog sessionLog = new TestSessionLog(packages, planName, profile);
+ TestSessionLog sessionLog = new TestSessionLog(packages, planName);
TestSession ts = new TestSession(sessionLog, numOfRequiredDevices);
return ts;
}
diff --git a/tools/host/src/com/android/cts/TestSessionLog.java b/tools/host/src/com/android/cts/TestSessionLog.java
index 22da746..43d7907 100644
--- a/tools/host/src/com/android/cts/TestSessionLog.java
+++ b/tools/host/src/com/android/cts/TestSessionLog.java
@@ -22,8 +22,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.ProcessingInstruction;
-import android.annotation.cts.Profile;
-
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
@@ -48,12 +46,11 @@
private static final String ATTRIBUTE_KNOWN_FAILURE = "KnownFailure";
public static final String CTS_RESULT_FILE_NAME = "testResult.xml";
- private static final String CTS_RESULT_FILE_VERSION = "1.8";
+ private static final String CTS_RESULT_FILE_VERSION = "1.9";
static final String ATTRIBUTE_STARTTIME = "starttime";
static final String ATTRIBUTE_ENDTIME = "endtime";
static final String ATTRIBUTE_TESTPLAN = "testPlan";
- static final String ATTRIBUTE_PROFILE = "profile";
static final String ATTRIBUTE_RESOLUTION = "resolution";
static final String ATTRIBUTE_SUBSCRIBER_ID = "subscriberId";
static final String ATTRIBUTE_DEVICE_ID = "deviceID";
@@ -111,17 +108,14 @@
private String mResultPath;
private String mResultDir;
private String mTestPlanName;
- private Profile mProfile;
private ArrayList<DeviceParameterCollector> mDeviceParameterBase;
- public TestSessionLog(final Collection<TestPackage> packages, final String testPlanName,
- final Profile profile) {
+ public TestSessionLog(final Collection<TestPackage> packages, final String testPlanName) {
mTestPackages = packages;
mDeviceParameterBase = new ArrayList<TestDevice.DeviceParameterCollector>();
mTestPlanName = testPlanName;
- mProfile = profile;
mSessionStartTime = new Date();
mSessionEndTime = new Date();
@@ -137,15 +131,6 @@
}
/**
- * Get the profile.
- *
- * @return The profile
- */
- public Profile getProfile() {
- return mProfile;
- }
-
- /**
* Get all result of this session.
*
* @return All the tests with a result code of this session.
@@ -300,7 +285,6 @@
setAttribute(doc, root, ATTRIBUTE_STARTTIME, HostUtils.dateToString(mSessionStartTime));
setAttribute(doc, root, ATTRIBUTE_ENDTIME, HostUtils.dateToString(mSessionEndTime));
setAttribute(doc, root, ATTRIBUTE_TESTPLAN, mTestPlanName);
- setAttribute(doc, root, ATTRIBUTE_PROFILE, mProfile.name());
// set device information
for (int i = 0; i < mDeviceParameterBase.size(); i ++) {
diff --git a/tools/host/src/com/android/cts/TestSessionLogBuilder.java b/tools/host/src/com/android/cts/TestSessionLogBuilder.java
index 68bab03..4f0be8d 100644
--- a/tools/host/src/com/android/cts/TestSessionLogBuilder.java
+++ b/tools/host/src/com/android/cts/TestSessionLogBuilder.java
@@ -15,23 +15,22 @@
*/
package com.android.cts;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
import java.io.File;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import android.annotation.cts.Profile;
-
/**
* Builder of test session from the test result XML file.
*/
@@ -92,10 +91,7 @@
String start = getStringAttributeValue(resultNode, TestSessionLog.ATTRIBUTE_STARTTIME);
String end = getStringAttributeValue(resultNode, TestSessionLog.ATTRIBUTE_ENDTIME);
String planFilePath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
- String profileOption = getStringAttributeValue(resultNode,
- TestSessionLog.ATTRIBUTE_PROFILE);
- Profile profile = Profile.valueOf(profileOption);
- TestSession sessionFromPlan = TestSessionBuilder.getInstance().build(planFilePath, profile);
+ TestSession sessionFromPlan = TestSessionBuilder.getInstance().build(planFilePath);
NodeList pkgList = resultNode.getChildNodes();
for (int i = 0; i < pkgList.getLength(); i++) {
@@ -129,7 +125,7 @@
}
}
- TestSessionLog log = new TestSessionLog(pkgsFromPlan, planName, profile);
+ TestSessionLog log = new TestSessionLog(pkgsFromPlan, planName);
try {
log.setStartTime(HostUtils.dateFromString(start).getTime());
log.setEndTime(HostUtils.dateFromString(end).getTime());
diff --git a/tools/host/src/com/android/cts/TestSuite.java b/tools/host/src/com/android/cts/TestSuite.java
index f1efc60..136fc3f 100644
--- a/tools/host/src/com/android/cts/TestSuite.java
+++ b/tools/host/src/com/android/cts/TestSuite.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
@@ -269,9 +267,8 @@
*
* @param device The device to run the test over.
* @param javaPkgName The java package name.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, final String javaPkgName, Profile profile)
+ public void run(final TestDevice device, final String javaPkgName)
throws IOException, DeviceDisconnectedException, ADBServerNeedRestartException {
Iterator<TestSuite> subSuites = getSubSuites().iterator();
Iterator<TestCase> testCases = getTestCases().iterator();
@@ -282,7 +279,7 @@
while (subSuites.hasNext() && (!mTestStop)) {
mCurrentSubSuite = subSuites.next();
- mCurrentSubSuite.run(device, javaPkgName, profile);
+ mCurrentSubSuite.run(device, javaPkgName);
}
while (testCases.hasNext() && (!mTestStop)) {
@@ -290,7 +287,7 @@
String fullName = mFullName + "." + mCurrentTestCase.getName();
if ((javaPkgName == null) || (javaPkgName.length() == 0)
|| fullName.startsWith(javaPkgName)) {
- mCurrentTestCase.run(device, profile);
+ mCurrentTestCase.run(device);
}
}
}
@@ -300,16 +297,15 @@
*
* @param device The device to run the test over.
* @param test The specific test to be run.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, final Test test, Profile profile)
+ public void run(final TestDevice device, final Test test)
throws DeviceDisconnectedException, ADBServerNeedRestartException {
mTestStop = false;
mCurrentTestCase = null;
mCurrentSubSuite = null;
mCurrentTestCase = test.getTestCase();
- mCurrentTestCase.run(device, test, profile);
+ mCurrentTestCase.run(device, test);
}
/** {@inheritDoc} */
diff --git a/tools/host/src/res/cts_result.xsd b/tools/host/src/res/cts_result.xsd
index a0672b5..7edd2ca 100644
--- a/tools/host/src/res/cts_result.xsd
+++ b/tools/host/src/res/cts_result.xsd
@@ -16,8 +16,8 @@
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://compatibility.android.com/cts_result/1.8"
- xmlns="http://compatibility.android.com/cts_result/1.8"
+ targetNamespace="http://compatibility.android.com/cts_result/1.9"
+ xmlns="http://compatibility.android.com/cts_result/1.9"
elementFormDefault="qualified">
<xs:element name="TestResult">
@@ -32,7 +32,6 @@
<xs:attribute name="endtime" type="xs:string"/>
<xs:attribute name="testPlan" type="xs:string"/>
<xs:attribute name="version" type="xs:string"/>
- <xs:attribute name="profile" type="xs:string"/>
</xs:complexType>
</xs:element>