Android Open Source - Cafe Cafe Test Runner






From Project

Back to project page Cafe.

License

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.

Java Source Code

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;
    }

}




Java Source Code List

com.baidu.cafe.CafeExceptionHandler.java
com.baidu.cafe.CafeListener.java
com.baidu.cafe.CafeServiceTestCase.java
com.baidu.cafe.CafeTestCase.java
com.baidu.cafe.CafeTestRunner.java
com.baidu.cafe.TearDownHelper.java
com.baidu.cafe.local.DESEncryption.java
com.baidu.cafe.local.FPSTracer.java
com.baidu.cafe.local.FileUtils.java
com.baidu.cafe.local.LocalLib.java
com.baidu.cafe.local.Log.java
com.baidu.cafe.local.NetworkUtils.java
com.baidu.cafe.local.SnapshotHelper.java
com.baidu.cafe.local.record.CafeWebViewClient.java
com.baidu.cafe.local.record.OutputEvent.java
com.baidu.cafe.local.record.ViewRecorderSDK.java
com.baidu.cafe.local.record.ViewRecorder.java
com.baidu.cafe.local.record.WebElementRecorder.java
com.baidu.cafe.local.traveler.APPTraveler.java
com.baidu.cafe.local.traveler.Logger.java
com.baidu.cafe.local.traveler.Operation.java
com.baidu.cafe.local.traveler.Util.java
com.baidu.cafe.local.traveler.ViewHelper.java
com.baidu.cafe.remote.ArmsBinder.java
com.baidu.cafe.remote.ArmsBootupReceiver.java
com.baidu.cafe.remote.Arms.java
com.baidu.cafe.remote.Armser.java
com.baidu.cafe.remote.BatteryState.java
com.baidu.cafe.remote.LockActivity.java
com.baidu.cafe.remote.Log.java
com.baidu.cafe.remote.MonkeyNetwork.java
com.baidu.cafe.remote.MyIntent.java
com.baidu.cafe.remote.SystemLib.java
com.baidu.cafe.remote.UILib.java
com.baidu.cafe.remote.ViewPropertyProvider.java
com.baidu.cafe.utils.CommandResult.java
com.baidu.cafe.utils.ReflectHelper.java
com.baidu.cafe.utils.ShellExecute.java
com.baidu.cafe.utils.Strings.java
com.baidu.cafe.utils.TreeNode.java