From 7aba54b2edcb94f43c991c555b23fc1de364835e Mon Sep 17 00:00:00 2001 From: Jack Wang Date: Thu, 20 Aug 2009 19:20:54 -0700 Subject: [PATCH] Fix bug 1546445: Correct spelling errors in API - InstrumentationTestCase.injectInsrumentation - AndroidTestRunner.setInstrumentaiton --- api/current.xml | 26 +++++++++++++++++++ .../android/test/InstrumentationTestCase.java | 16 +++++++++++- .../test/InstrumentationTestSuite.java | 2 +- .../android/test/AndroidTestRunner.java | 13 ++++++++-- .../test/InstrumentationTestRunner.java | 2 +- 5 files changed, 54 insertions(+), 5 deletions(-) diff --git a/api/current.xml b/api/current.xml index 3c76361a9f386..4dc4ae460f8a1 100644 --- a/api/current.xml +++ b/api/current.xml @@ -118540,6 +118540,19 @@ > + + + + + + + + diff --git a/core/java/android/test/InstrumentationTestCase.java b/core/java/android/test/InstrumentationTestCase.java index 2145d7cc7891c..22d95d16b2e7b 100644 --- a/core/java/android/test/InstrumentationTestCase.java +++ b/core/java/android/test/InstrumentationTestCase.java @@ -43,10 +43,24 @@ public class InstrumentationTestCase extends TestCase { * * @param instrumentation the instrumentation to use with this instance */ - public void injectInsrumentation(Instrumentation instrumentation) { + public void injectInstrumentation(Instrumentation instrumentation) { mInstrumentation = instrumentation; } + /** + * Injects instrumentation into this test case. This method is + * called by the test runner during test setup. + * + * @param instrumentation the instrumentation to use with this instance + * + * @deprecated Incorrect spelling, + * use {@link #injectInstrumentation(android.app.Instrumentation) instead. + */ + @Deprecated + public void injectInsrumentation(Instrumentation instrumentation) { + injectInstrumentation(instrumentation); + } + /** * Inheritors can access the instrumentation using this. * @return instrumentation diff --git a/core/java/android/test/InstrumentationTestSuite.java b/core/java/android/test/InstrumentationTestSuite.java index 2ab949e02f2ff..7a78ffbb226d4 100644 --- a/core/java/android/test/InstrumentationTestSuite.java +++ b/core/java/android/test/InstrumentationTestSuite.java @@ -65,7 +65,7 @@ public class InstrumentationTestSuite extends TestSuite { public void runTest(Test test, TestResult result) { if (test instanceof InstrumentationTestCase) { - ((InstrumentationTestCase) test).injectInsrumentation(mInstrumentation); + ((InstrumentationTestCase) test).injectInstrumentation(mInstrumentation); } // run the test as usual diff --git a/test-runner/android/test/AndroidTestRunner.java b/test-runner/android/test/AndroidTestRunner.java index 0d4e1e967bcde..358b7e9192000 100644 --- a/test-runner/android/test/AndroidTestRunner.java +++ b/test-runner/android/test/AndroidTestRunner.java @@ -180,14 +180,23 @@ public class AndroidTestRunner extends BaseTestRunner { private void setInstrumentationIfInstrumentationTestCase( Test test, Instrumentation instrumentation) { if (InstrumentationTestCase.class.isAssignableFrom(test.getClass())) { - ((InstrumentationTestCase) test).injectInsrumentation(instrumentation); + ((InstrumentationTestCase) test).injectInstrumentation(instrumentation); } } - public void setInstrumentaiton(Instrumentation instrumentation) { + public void setInstrumentation(Instrumentation instrumentation) { mInstrumentation = instrumentation; } + /** + * @deprecated Incorrect spelling, + * use {@link #setInstrumentation(android.app.Instrumentation)} instead. + */ + @Deprecated + public void setInstrumentaiton(Instrumentation instrumentation) { + setInstrumentation(instrumentation); + } + @Override protected Class loadSuiteClass(String suiteClassName) throws ClassNotFoundException { return mContext.getClassLoader().loadClass(suiteClassName); diff --git a/test-runner/android/test/InstrumentationTestRunner.java b/test-runner/android/test/InstrumentationTestRunner.java index 6658fb0732130..23f0ed40a8b34 100644 --- a/test-runner/android/test/InstrumentationTestRunner.java +++ b/test-runner/android/test/InstrumentationTestRunner.java @@ -329,7 +329,7 @@ public class InstrumentationTestRunner extends Instrumentation implements TestSu mTestRunner = getAndroidTestRunner(); mTestRunner.setContext(getTargetContext()); - mTestRunner.setInstrumentaiton(this); + mTestRunner.setInstrumentation(this); mTestRunner.setSkipExecution(logOnly); mTestRunner.setTest(testSuiteBuilder.build()); mTestCount = mTestRunner.getTestCases().size();