Back to project page Cafe.
The source code is released under:
Apache License
If you think the Android project Cafe listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.baidu.cafe; /*from ww w.jav a 2 s .c om*/ import android.os.Bundle; import android.test.AndroidTestRunner; import com.baidu.cafe.utils.ReflectHelper; import com.zutubi.android.junitreport.JUnitReportTestRunner; /** * @author luxiaoyu01@baidu.com * @date 2012-6-25 * @version * @todo */ public class CafeTestRunner extends JUnitReportTestRunner { public static Bundle mArguments = null; @Override public void onCreate(Bundle arguments) { mArguments = arguments; super.onCreate(arguments); } @Override protected AndroidTestRunner getAndroidTestRunner() { AndroidTestRunner runner = makeAndroidTestRunner(); try { String superClassName = "com.zutubi.android.junitreport.JUnitReportTestRunner"; String mReportFile = (String) ReflectHelper.getField(this, superClassName, "mReportFile"); String mReportDir = (String) ReflectHelper.getField(this, superClassName, "mReportDir"); boolean mFilterTraces = (Boolean) ReflectHelper.getField(this, superClassName, "mFilterTraces"); boolean mMultiFile = (Boolean) ReflectHelper.getField(this, superClassName, "mMultiFile"); CafeListener listener = new CafeListener(getContext(), getTargetContext(), mReportFile, mReportDir, mFilterTraces, mMultiFile, this); ReflectHelper.setField(this, superClassName, "mListener", listener); runner.addTestListener(listener); } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (NoSuchFieldException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return runner; } }