[android-developers] Re: Testing with ActivityInstrumentationTestCase
Provide the intent to startActivity().
On Monday, 21 May 2012 16:23:25 UTC-4, Marco@worldcorp wrote:
Hi all--
i am trying to write some tests for my Android Application
I have couple of tests which extends ActivityInstrumentationTestCase2
and runs just fine.
I wanted then to test one of my Activities in isolation..
so i wrote a test which extends ActivityUnitTestCase
THis is my test
@MediumTest
public void testPrecondition() {
Bundle savedInstanceState = new Bundle();
savedInstanceState. putSerializable( BudgetDbAdapter.TRIP_ID, tripId);
savedInstanceState. putSerializable( BudgetDbAdapter.TRIP_AMOUNT,
tripAmount);
startActivity(null, savedInstanceState, null);
Assert.assertNotNull(getActivity());
}
But i cannot manage to run it.
Whenever i run my test project as Android JUnit Test, all the test
extending ActivityInstrumentationTestCase2 ran, while the one
extending ActivityUnitTestCase doesn't.
Could anyone explain me how can i run a test which extends
ActivityUnitTest?
Is it supposed to run in the emulator?
w/kindest regards
marco
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home