Questions tagged [activityunittestcase]

26 questions
1
vote
0 answers

ActivityUnitTestCase throws NameNotFoundException with ActionBarActivity

There appears to be a long outstanding issue with ActivityUnitTestCase whereby the use of a package for the target activity other than that defined in the manifest leads to a NameNotFoundException…
joedev
  • 65
  • 5
1
vote
0 answers

Avoiding UI Limitations in ActivityUnitTestCase?

When attempting to build an example ActivityUnitTestCase around the Navigation Drawer example found on the Android developer site [link], getActionBar() is returning null during MainActivity.onCreate(). I have had similar problems with this test…
jneander
  • 1,150
  • 14
  • 34
1
vote
1 answer

ActivityUnitTestCase lifecycle testing

I was unit testing a simple app today. I have a method protected void onRestart() { disp.setText("The numbers you entered were"); super.onRestart(); } And in my test case i'm using public void testRestart(){ String dispText =…
Traxex1909
  • 2,650
  • 4
  • 20
  • 25
0
votes
0 answers

JUnit4 with Mockito for unit testing

public class DgiQtyAction extends DispatchAction { private final Logger mLog = Logger.getLogger(this.getClass()); public ActionForward fnDgiQty(ActionMapping mapping, ActionForm form, HttpServletRequest request,…
0
votes
0 answers

Can't launch Activity in ActivityUnitTestCase

I have been trying to launch a simple Activity from a ActivityUnitTestCase, without any success. I guess I'm missing something obvious, but I can't figure out what it is... I managed to run Activities from ActivityInstrumentationTestCase2, but not…
Gordak
  • 2,060
  • 22
  • 32
0
votes
0 answers

How to run Android Junit Test from inside my java application

I want to run my android junit test case from my java class. Can I do that using JUnitCore class run method or is there some other way possible.
Wanderer
  • 366
  • 2
  • 6
  • 18
0
votes
1 answer

Unable to Inject Mock Object - ActivityUnitTestCase

I've been trying to test a sample app using Mockito. My test case: public class CalcActivityTest extends ActivityUnitTestCase { private Intent in; private Button btnAdd,btnSub,btnMul,btnDiv,btnDef; private TextView res; private…
Traxex1909
  • 2,650
  • 4
  • 20
  • 25
0
votes
1 answer

Testing an outgoing intent

I've been trying to unit test a simple calculator app with ActivityUnitTestCase. The code for my calculator app protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_page); …
Traxex1909
  • 2,650
  • 4
  • 20
  • 25
0
votes
1 answer

How to let Android Test instrumentation testcases wait some times in order to get some result?

anyone can help me.I want to my testcases sleep to wait the textview text change ,but it seems the Thread.sleep() can not work ! backgroud : I use ActivityUnitTestCase to test one of my activity . below is the testcase, from log I can not get the…
-1
votes
2 answers

Can we run Instrumentationtestcases on android phone without it being connected to the PC?

I wrote some test cases for a standard browser app using instrumentationtestcase packages for an android phone. i am able to run the tests when the phone is connected to pc .. is there a way to include these test cases in the app in such a way that…
-1
votes
1 answer

Associating test cases with test methods when using [TestClass] rather [CodedUITest]

We are using Unit test project for UI automation using selenium web driver. I can execute test from visual studio Test >Test Explore > Select the Test and Click on Run. I am not able to Associate the Test case to the Test method From Unit Test…
1
2