My guess is its not possible to do this. An InstrTestNested instance can only exist inside an instance of InstrTestCase, thus pretty sure the InstrumentationTestRunner cannot instantiate the nested class. Maybe if you made the nested class static it might work, but then I don't see the point.
Brett. On Thu, Jun 18, 2009 at 1:46 AM, dev<[email protected]> wrote: > > Hi all, > > Can I have a nested testcase ? Like > > ********************************************************************* > public class InstrTestCase extends InstrumentationTestCase > { > > public class InstrTestNested extends InstrumentationTestCase > > > public void testMyTest2() > { > > Log.d(MY_TAG,"test My test2"); > > } > } > ********************************************************************* > > And execute the test by > adb shell am instrument -w -e class > com.InstrTest.InstrTestCase.InstrTestNested com.InstrTest/ > android.test.InstrumentationTestRunner > > I am getting class not found error > > INSTRUMENTATION_RESULT: shortMsg=Exception thrown in onCreate() of > ComponentInfo{com.InstrTest/android.test.InstrumentationTestRunner}: > java.lang.RuntimeException: Could not find test class. Class: > com.InstrTest.InstrTestCase.InstrTestNested > INSTRUMENTATION_RESULT: longMsg=java.lang.RuntimeException: Exception > thrown in onCreate() of ComponentInfo{com.InstrTest/ > android.test.InstrumentationTestRunner}: java.lang.RuntimeException: > Could not find test class. Class: > com.InstrTest.InstrTestCase.InstrTestNested > INSTRUMENTATION_CODE: 0 > > I am using android.test.InstrumentationTestRunner itself. > Am I missing something or default runner does not support the above. > > Regards, > dev > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

