• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

development


Commit MetaInfo

Revisão6dc9883c6e6b3f131cfb1e82485ce814603603b4 (tree)
Hora2009-03-25 12:54:44
AutorBrett Chabot <>
CommiterThe Android Open Source Project

Mensagem de Log

Automated import from //branches/master/...@141783,141783

Mudança Sumário

Diff

--- a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/launch/junit/AndroidJUnitLaunchConfigDelegate.java
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/launch/junit/AndroidJUnitLaunchConfigDelegate.java
@@ -32,23 +32,21 @@ import org.eclipse.core.runtime.CoreException;
3232 import org.eclipse.core.runtime.IProgressMonitor;
3333 import org.eclipse.debug.core.ILaunchConfiguration;
3434 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
35-import org.eclipse.jdt.core.IJavaProject;
3635 import org.eclipse.jdt.internal.junit.launcher.JUnitLaunchConfigurationConstants;
3736 import org.eclipse.jdt.internal.junit.launcher.TestKindRegistry;
3837
3938 /**
40- * Run configuration that can execute JUnit tests on an Android platform
39+ * Run configuration that can execute JUnit tests on an Android platform.
4140 * <p/>
42- * Will deploy apps on target Android platform by reusing functionality from ADT
43- * LaunchConfigDelegate, and then run JUnits tests by reusing functionality from JDT
41+ * Will deploy apps on target Android platform by reusing functionality from ADT
42+ * LaunchConfigDelegate, and then run JUnits tests by reusing functionality from JDT
4443 * JUnitLaunchConfigDelegate.
4544 */
46-@SuppressWarnings("restriction") //$NON-NLS-1$
45+@SuppressWarnings("restriction")
4746 public class AndroidJUnitLaunchConfigDelegate extends LaunchConfigDelegate {
4847
49- /** Launch config attribute that stores instrumentation runner */
48+ /** Launch config attribute that stores instrumentation runner. */
5049 static final String ATTR_INSTR_NAME = AdtPlugin.PLUGIN_ID + ".instrumentation"; //$NON-NLS-1$
51- static final String INSTRUMENTATION_OK = null;
5250 private static final String EMPTY_STRING = ""; //$NON-NLS-1$
5351
5452 @Override
@@ -58,7 +56,7 @@ public class AndroidJUnitLaunchConfigDelegate extends LaunchConfigDelegate {
5856 IFile applicationPackage, AndroidManifestParser manifestParser) {
5957
6058 String testPackage = manifestParser.getPackage();
61- String runner = getRunnerFromConfig(configuration);
59+ String runner = getRunner(project, configuration, manifestParser);
6260 if (runner == null) {
6361 AdtPlugin.displayError("Android Launch",
6462 "An instrumention test runner is not specified!");
@@ -72,14 +70,51 @@ public class AndroidJUnitLaunchConfigDelegate extends LaunchConfigDelegate {
7270 manifestParser.getDebuggable(), manifestParser.getApiLevelRequirement(),
7371 junitLaunch, config, androidLaunch, monitor);
7472 }
75-
76- private String getRunnerFromConfig(ILaunchConfiguration configuration) {
77- String runner = EMPTY_STRING;
73+
74+ /**
75+ * Gets a instrumentation runner for the launch.
76+ * <p/>
77+ * If a runner is stored in the given <code>configuration</code>, will return that.
78+ * Otherwise, will try to find the first valid runner for the project.
79+ * If a runner can still not be found, will return <code>null</code>.
80+ *
81+ * @param project the {@link IProject} for the app
82+ * @param configuration the {@link ILaunchConfiguration} for the launch
83+ * @param manifestParser the {@link AndroidManifestParser} for the project
84+ *
85+ * @return <code>null</code> if no instrumentation runner can be found, otherwise return
86+ * the fully qualified runner name.
87+ */
88+ private String getRunner(IProject project, ILaunchConfiguration configuration,
89+ AndroidManifestParser manifestParser) {
7890 try {
79- runner = configuration.getAttribute(ATTR_INSTR_NAME, EMPTY_STRING);
91+ String runner = getRunnerFromConfig(configuration);
92+ if (runner != null) {
93+ return runner;
94+ }
95+ final InstrumentationRunnerValidator instrFinder = new InstrumentationRunnerValidator(
96+ BaseProjectHelper.getJavaProject(project), manifestParser);
97+ runner = instrFinder.getValidInstrumentationTestRunner();
98+ if (runner != null) {
99+ AdtPlugin.printErrorToConsole(project,
100+ String.format("Warning: No instrumentation runner found for the launch, " +
101+ "using %1$s", runner));
102+ return runner;
103+ }
104+ AdtPlugin.printErrorToConsole(project,
105+ String.format("ERROR: Application does not specify a %1$s instrumentation or does not declare uses-library %2$s",
106+ AndroidConstants.CLASS_INSTRUMENTATION_RUNNER,
107+ AndroidConstants.LIBRARY_TEST_RUNNER));
108+ return null;
80109 } catch (CoreException e) {
81- AdtPlugin.log(e, "Error when retrieving instrumentation info from launch config"); //$NON-NLS-1$
110+ AdtPlugin.log(e, "Error when retrieving instrumentation info"); //$NON-NLS-1$
82111 }
112+ return null;
113+
114+ }
115+
116+ private String getRunnerFromConfig(ILaunchConfiguration configuration) throws CoreException {
117+ String runner = configuration.getAttribute(ATTR_INSTR_NAME, EMPTY_STRING);
83118 if (runner.length() < 1) {
84119 return null;
85120 }
@@ -87,31 +122,6 @@ public class AndroidJUnitLaunchConfigDelegate extends LaunchConfigDelegate {
87122 }
88123
89124 /**
90- * Helper method to return the set of instrumentations for the Android project
91- *
92- * @param project the {@link IProject} to get instrumentations for
93- * @return null if error occurred parsing instrumentations, otherwise returns array of
94- * instrumentation class names
95- */
96- static String[] getInstrumentationsForProject(IProject project) {
97- if (project != null) {
98- try {
99- // parse the manifest for the list of instrumentations
100- AndroidManifestParser manifestParser = AndroidManifestParser.parse(
101- BaseProjectHelper.getJavaProject(project), null /* errorListener */,
102- true /* gatherData */, false /* markErrors */);
103- if (manifestParser != null) {
104- return manifestParser.getInstrumentations();
105- }
106- } catch (CoreException e) {
107- AdtPlugin.log(e, "%s: Error parsing AndroidManifest.xml", //$NON-NLS-1$
108- project.getName());
109- }
110- }
111- return null;
112- }
113-
114- /**
115125 * Helper method to set JUnit-related attributes expected by JDT JUnit runner
116126 *
117127 * @param config the launch configuration to modify
@@ -121,56 +131,4 @@ public class AndroidJUnitLaunchConfigDelegate extends LaunchConfigDelegate {
121131 config.setAttribute(JUnitLaunchConfigurationConstants.ATTR_TEST_RUNNER_KIND,
122132 TestKindRegistry.JUNIT3_TEST_KIND_ID);
123133 }
124-
125- /**
126- * Helper method to determine if specified instrumentation can be used as a test runner
127- *
128- * @param project the {@link IJavaProject} to validate
129- * @param instrumentation the instrumentation class name to validate
130- * @return <code>INSTRUMENTATION_OK</code> if valid, otherwise returns error message
131- */
132- static String validateInstrumentationRunner(IJavaProject project, String instrumentation) {
133- AndroidManifestParser manifestParser;
134- try {
135- manifestParser = AndroidManifestParser.parse(
136- project, null /* errorListener */,
137- true /* gatherData */, false /* markErrors */);
138- // check if this instrumentation is the standard test runner
139- if (!instrumentation.equals(AndroidConstants.CLASS_INSTRUMENTATION_RUNNER)) {
140- // check if it extends the standard test runner
141- String result = BaseProjectHelper.testClassForManifest(project,
142- instrumentation, AndroidConstants.CLASS_INSTRUMENTATION_RUNNER, true);
143- if (result != BaseProjectHelper.TEST_CLASS_OK) {
144- return String.format("The instrumentation runner must be of type %s",
145- AndroidConstants.CLASS_INSTRUMENTATION_RUNNER);
146- }
147- }
148- if (!hasTestRunnerLibrary(manifestParser)) {
149- return String.format("%s does not not use the %s library",
150- project.getProject().getName(), AndroidConstants.LIBRARY_TEST_RUNNER);
151- }
152- } catch (CoreException e) {
153- String err = String.format("Error parsing AndroidManifest for %s",
154- project.getProject().getName());
155- AdtPlugin.log(e, err);
156- return err;
157- }
158- return INSTRUMENTATION_OK;
159- }
160-
161- /**
162- * Helper method to determine if given manifest has a <code>AndroidConstants.LIBRARY_TEST_RUNNER
163- * </code> library reference
164- *
165- * @param manifestParser the {@link AndroidManifestParser} to search
166- * @return true if test runner library found, false otherwise
167- */
168- static boolean hasTestRunnerLibrary(AndroidManifestParser manifestParser) {
169- for (String lib : manifestParser.getUsesLibraries()) {
170- if (lib.equals(AndroidConstants.LIBRARY_TEST_RUNNER)) {
171- return true;
172- }
173- }
174- return false;
175- }
176134 }
--- a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/launch/junit/AndroidJUnitLaunchConfigurationTab.java
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/launch/junit/AndroidJUnitLaunchConfigurationTab.java
@@ -118,7 +118,9 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
118118 private Image mTabIcon = null;
119119 private Combo mInstrumentationCombo;
120120 private static final String EMPTY_STRING = ""; //$NON-NLS-1$
121+ private static final String TAG = "AndroidJUnitLaunchConfigurationTab"; //$NON-NLS-1$
121122 private String[] mInstrumentations = null;
123+ private InstrumentationRunnerValidator mInstrValidator = null;
122124 private ProjectChooserHelper mProjectChooserHelper;
123125
124126 /* (non-Javadoc)
@@ -349,7 +351,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
349351 break;
350352 }
351353 }
352- }
354+ }
353355 } catch (CoreException ce) {
354356 // ignore
355357 }
@@ -454,7 +456,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
454456 mapResources(config);
455457 } catch (CoreException e) {
456458 // TODO: does the real error need to be extracted out of CoreException
457- AdtPlugin.log(e, "Error occurred saving configuration");
459+ AdtPlugin.log(e, "Error occurred saving configuration"); //$NON-NLS-1$
458460 }
459461 AndroidJUnitLaunchConfigDelegate.setJUnitDefaults(config);
460462
@@ -486,7 +488,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
486488 public Image getImage() {
487489 // reuse icon from the Android App Launch config tab
488490 if (mTabIcon == null) {
489- mTabIcon= AdtPlugin.getImageLoader().loadImage(MainLaunchConfigTab.LAUNCH_TAB_IMAGE,
491+ mTabIcon = AdtPlugin.getImageLoader().loadImage(MainLaunchConfigTab.LAUNCH_TAB_IMAGE,
490492 null);
491493 }
492494 return mTabIcon;
@@ -514,7 +516,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
514516 setErrorMessage(e.getMessage());
515517 return;
516518 } catch (InvocationTargetException e) {
517- AdtPlugin.log(e.getTargetException(), "Error finding test types");
519+ AdtPlugin.log(e.getTargetException(), "Error finding test types"); //$NON-NLS-1$
518520 return;
519521 } finally {
520522 mTestRadioButton.setSelection(radioSetting[0]);
@@ -675,10 +677,10 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
675677 return;
676678 }
677679 } catch (CoreException e) {
678- AdtPlugin.log(e, "validatePage failed");
680+ AdtPlugin.log(e, "validatePage failed"); //$NON-NLS-1$
679681 }
680682
681- validateInstrumentation(javaProject);
683+ validateInstrumentation();
682684 }
683685
684686 private void validateJavaProject(IJavaProject javaProject) {
@@ -688,19 +690,14 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
688690 }
689691 }
690692
691- private void validateInstrumentation(IJavaProject javaProject) {
692- if (mInstrumentations == null || mInstrumentations.length < 1) {
693- setErrorMessage("Specified project has no defined instrumentations");
694- return;
695- }
693+ private void validateInstrumentation() {
696694 String instrumentation = getSelectedInstrumentation();
697695 if (instrumentation == null) {
698- setErrorMessage("Instrumentation not specified");
696+ setErrorMessage("Instrumentation runner not specified");
699697 return;
700698 }
701- String result = AndroidJUnitLaunchConfigDelegate.validateInstrumentationRunner(
702- javaProject, instrumentation);
703- if (result != AndroidJUnitLaunchConfigDelegate.INSTRUMENTATION_OK) {
699+ String result = mInstrValidator.validateInstrumentationRunner(instrumentation);
700+ if (result != InstrumentationRunnerValidator.INSTRUMENTATION_OK) {
704701 setErrorMessage(result);
705702 return;
706703 }
@@ -949,14 +946,15 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
949946
950947 /**
951948 * Loads the UI with the instrumentations of the specified project, and stores the
952- * activities in <code>mActivities</code>.
953- * <p/>
954- * First activity is selected by default if present.
949+ * instrumentations in <code>mInstrumentations</code>.
955950 *
956951 * @param project the {@link IProject} to load the instrumentations from.
957952 */
958953 private void loadInstrumentations(IProject project) {
959- mInstrumentations = AndroidJUnitLaunchConfigDelegate.getInstrumentationsForProject(project);
954+ try {
955+ mInstrValidator = new InstrumentationRunnerValidator(project);
956+ mInstrumentations = (mInstrValidator == null ? null :
957+ mInstrValidator.getInstrumentations());
960958 if (mInstrumentations != null) {
961959 mInstrumentationCombo.removeAll();
962960 for (String instrumentation : mInstrumentations) {
@@ -966,9 +964,13 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
966964 // config object.
967965 return;
968966 }
969-
967+ } catch (CoreException e) {
968+ AdtPlugin.logAndPrintError(e, TAG, "ERROR: Failed to get instrumentations for %1$s",
969+ project.getName());
970+ }
970971 // if we reach this point, either project is null, or we got an exception during
971972 // the parsing. In either case, we empty the instrumentation list.
973+ mInstrValidator = null;
972974 mInstrumentations = null;
973975 mInstrumentationCombo.removeAll();
974976 }
--- a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/launch/junit/AndroidJUnitLaunchShortcut.java
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/launch/junit/AndroidJUnitLaunchShortcut.java
@@ -16,10 +16,6 @@
1616
1717 package com.android.ide.eclipse.adt.launch.junit;
1818
19-import com.android.ide.eclipse.adt.AdtPlugin;
20-import com.android.ide.eclipse.common.AndroidConstants;
21-
22-import org.eclipse.core.resources.IProject;
2319 import org.eclipse.core.runtime.CoreException;
2420 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
2521 import org.eclipse.jdt.core.IJavaElement;
@@ -43,33 +39,18 @@ public class AndroidJUnitLaunchShortcut extends JUnitLaunchShortcut {
4339 protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IJavaElement element)
4440 throws CoreException {
4541 ILaunchConfigurationWorkingCopy config = super.createLaunchConfiguration(element);
46- IProject project = element.getResource().getProject();
47- String[] instrumentations =
48- AndroidJUnitLaunchConfigDelegate.getInstrumentationsForProject(project);
49- boolean runnerFound = false;
50- if (instrumentations != null) {
51- // just pick the first valid runner
52- for (String instr : instrumentations) {
53- if (AndroidJUnitLaunchConfigDelegate.validateInstrumentationRunner(
54- element.getJavaProject(), instr) ==
55- AndroidJUnitLaunchConfigDelegate.INSTRUMENTATION_OK) {
56-
57- config.setAttribute(AndroidJUnitLaunchConfigDelegate.ATTR_INSTR_NAME,
58- instr);
59- runnerFound = true;
60- break;
61- }
62- }
63- }
64- if (!runnerFound) {
65- // TODO: put this in a string properties
66- String msg = String.format("ERROR: Application does not specify a %s instrumentation or does not declare uses-library %s",
67- AndroidConstants.CLASS_INSTRUMENTATION_RUNNER,
68- AndroidConstants.LIBRARY_TEST_RUNNER);
69- AdtPlugin.printErrorToConsole(project, msg);
42+ // just get first valid instrumentation runner
43+ String instrumentation = new InstrumentationRunnerValidator(element.getJavaProject()).
44+ getValidInstrumentationTestRunner();
45+ if (instrumentation != null) {
46+ config.setAttribute(AndroidJUnitLaunchConfigDelegate.ATTR_INSTR_NAME,
47+ instrumentation);
7048 }
71- AndroidJUnitLaunchConfigDelegate.setJUnitDefaults(config);
49+ // if a valid runner is not found, rely on launch delegate to log error.
50+ // This method is called without explicit user action to launch Android JUnit, so avoid
51+ // logging an error here.
7252
53+ AndroidJUnitLaunchConfigDelegate.setJUnitDefaults(config);
7354 return config;
7455 }
7556 }
--- /dev/null
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/launch/junit/InstrumentationRunnerValidator.java
@@ -0,0 +1,145 @@
1+/*
2+ * Copyright (C) 2009 The Android Open Source Project
3+ *
4+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.eclipse.org/org/documents/epl-v10.php
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package com.android.ide.eclipse.adt.launch.junit;
17+
18+import com.android.ide.eclipse.adt.AdtPlugin;
19+import com.android.ide.eclipse.common.AndroidConstants;
20+import com.android.ide.eclipse.common.project.AndroidManifestParser;
21+import com.android.ide.eclipse.common.project.BaseProjectHelper;
22+
23+import org.eclipse.core.resources.IProject;
24+import org.eclipse.core.runtime.CoreException;
25+import org.eclipse.jdt.core.IJavaProject;
26+
27+/**
28+ * Provides validation for Android instrumentation test runner
29+ */
30+class InstrumentationRunnerValidator {
31+ private final IJavaProject mJavaProject;
32+ private String[] mInstrumentations = null;
33+ private boolean mHasRunnerLibrary = false;
34+
35+ static final String INSTRUMENTATION_OK = null;
36+
37+ /**
38+ * Initializes the InstrumentationRunnerValidator.
39+ *
40+ * @param javaProject the {@link IJavaProject} for the Android project to validate
41+ */
42+ InstrumentationRunnerValidator(IJavaProject javaProject) {
43+ mJavaProject = javaProject;
44+ try {
45+ AndroidManifestParser manifestParser = AndroidManifestParser.parse(javaProject,
46+ null /* errorListener */, true /* gatherData */, false /* markErrors */);
47+ init(manifestParser);
48+ } catch (CoreException e) {
49+ AdtPlugin.printErrorToConsole(javaProject.getProject(), "ERROR: Failed to parse %1$s",
50+ AndroidConstants.FN_ANDROID_MANIFEST);
51+ }
52+ }
53+
54+ /**
55+ * Initializes the InstrumentationRunnerValidator.
56+ *
57+ * @param project the {@link IProject} for the Android project to validate
58+ * @throws CoreException if a fatal error occurred in initialization
59+ */
60+ InstrumentationRunnerValidator(IProject project) throws CoreException {
61+ this(BaseProjectHelper.getJavaProject(project));
62+ }
63+
64+ /**
65+ * Initializes the InstrumentationRunnerValidator with an existing {@link AndroidManifestParser}
66+ *
67+ * @param javaProject the {@link IJavaProject} for the Android project to validate
68+ * @param manifestParser the {@link AndroidManifestParser} for the Android project
69+ */
70+ InstrumentationRunnerValidator(IJavaProject javaProject, AndroidManifestParser manifestParser) {
71+ mJavaProject = javaProject;
72+ init(manifestParser);
73+ }
74+
75+ private void init(AndroidManifestParser manifestParser) {
76+ mInstrumentations = manifestParser.getInstrumentations();
77+ mHasRunnerLibrary = hasTestRunnerLibrary(manifestParser);
78+ }
79+
80+ /**
81+ * Helper method to determine if given manifest has a <code>AndroidConstants.LIBRARY_TEST_RUNNER
82+ * </code> library reference
83+ *
84+ * @param manifestParser the {@link AndroidManifestParser} to search
85+ * @return true if test runner library found, false otherwise
86+ */
87+ private boolean hasTestRunnerLibrary(AndroidManifestParser manifestParser) {
88+ for (String lib : manifestParser.getUsesLibraries()) {
89+ if (lib.equals(AndroidConstants.LIBRARY_TEST_RUNNER)) {
90+ return true;
91+ }
92+ }
93+ return false;
94+ }
95+
96+ /**
97+ * Return the set of instrumentations for the Android project.
98+ *
99+ * @return <code>null</code if error occurred parsing instrumentations, otherwise returns array
100+ * of instrumentation class names
101+ */
102+ String[] getInstrumentations() {
103+ return mInstrumentations;
104+ }
105+
106+ /**
107+ * Helper method to get the first instrumentation that can be used as a test runner.
108+ *
109+ * @return fully qualified instrumentation class name. <code>null</code> if no valid
110+ * instrumentation can be found.
111+ */
112+ String getValidInstrumentationTestRunner() {
113+ for (String instrumentation : getInstrumentations()) {
114+ if (validateInstrumentationRunner(instrumentation) == INSTRUMENTATION_OK) {
115+ return instrumentation;
116+ }
117+ }
118+ return null;
119+ }
120+
121+ /**
122+ * Helper method to determine if specified instrumentation can be used as a test runner
123+ *
124+ * @param instrumentation the instrumentation class name to validate. Assumes this
125+ * instrumentation is one of {@link #getInstrumentations()}
126+ * @return <code>INSTRUMENTATION_OK</code> if valid, otherwise returns error message
127+ */
128+ String validateInstrumentationRunner(String instrumentation) {
129+ if (!mHasRunnerLibrary) {
130+ return String.format("The application does not declare uses-library %1$s",
131+ AndroidConstants.LIBRARY_TEST_RUNNER);
132+ }
133+ // check if this instrumentation is the standard test runner
134+ if (!instrumentation.equals(AndroidConstants.CLASS_INSTRUMENTATION_RUNNER)) {
135+ // check if it extends the standard test runner
136+ String result = BaseProjectHelper.testClassForManifest(mJavaProject,
137+ instrumentation, AndroidConstants.CLASS_INSTRUMENTATION_RUNNER, true);
138+ if (result != BaseProjectHelper.TEST_CLASS_OK) {
139+ return String.format("The instrumentation runner must be of type %s",
140+ AndroidConstants.CLASS_INSTRUMENTATION_RUNNER);
141+ }
142+ }
143+ return INSTRUMENTATION_OK;
144+ }
145+}