android.test.ActivityInstrumentationTestCase2 Java Examples

The following examples show how to use android.test.ActivityInstrumentationTestCase2. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RobotiumWrapperRobot.java    From AndroidRipper with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Initialize Robotium
 * 
 * @param ActivityInstrumentationTestCase2
 */
public RobotiumWrapperRobot(ActivityInstrumentationTestCase2<?> test)
{
	testCase = test;
	solo = new Solo (testCase.getInstrumentation(), testCase.getActivity());
	
	//init widget lists
	this.theViews = new HashMap<Integer,View>();
	this.allViews = new ArrayList<View>();
}
 
Example #2
Source File: RobotiumWrapperRobot.java    From AndroidRipper with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void swapTab (final TabHost t, int num) {
	assertNotNull(t, "Cannon swap tab: the tab host does not exist");
	int count = t.getTabWidget().getTabCount();
	ActivityInstrumentationTestCase2.assertTrue("Cannot swap tab: tab index out of bound", num<=count);
	final int n = Math.min(count, Math.max(1,num))-1;
	Debug.info(this, "Swapping to tab " + num);
	click (t.getTabWidget().getChildAt(n));
}
 
Example #3
Source File: RobotiumWrapperRobot.java    From AndroidRipper with GNU Affero General Public License v3.0 2 votes vote down vote up
/**
 * assertNotNull proxy
 * 
 * @param v
 */
protected void assertNotNull (final View v)
{
	ActivityInstrumentationTestCase2.assertNotNull(v);
}
 
Example #4
Source File: RobotiumWrapperRobot.java    From AndroidRipper with GNU Affero General Public License v3.0 2 votes vote down vote up
/**
 * assertNotNull proxy
 * 
 * @param v
 */
protected void assertNotNull (final View v, String errorMessage)
{
	ActivityInstrumentationTestCase2.assertNotNull(errorMessage, v);
}