类android.test.ActivityInstrumentationTestCase2源码实例Demo

下面列出了怎么用android.test.ActivityInstrumentationTestCase2的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: AndroidRipper   文件: RobotiumWrapperRobot.java
/**
 * 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>();
}
 
源代码2 项目: AndroidRipper   文件: RobotiumWrapperRobot.java
@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));
}
 
源代码3 项目: AndroidRipper   文件: RobotiumWrapperRobot.java
/**
 * assertNotNull proxy
 * 
 * @param v
 */
protected void assertNotNull (final View v)
{
	ActivityInstrumentationTestCase2.assertNotNull(v);
}
 
源代码4 项目: AndroidRipper   文件: RobotiumWrapperRobot.java
/**
 * assertNotNull proxy
 * 
 * @param v
 */
protected void assertNotNull (final View v, String errorMessage)
{
	ActivityInstrumentationTestCase2.assertNotNull(errorMessage, v);
}