当前位置: 首页 > news >正文

做电商需要哪些网站有哪些/淘宝代运营

做电商需要哪些网站有哪些,淘宝代运营,淘宝网站制作多少钱,政府微网站建设目标以下代码时监听测试程序结束后将Emma测试报告写入到虚拟机上,然后可以使用adb pull命令发送至硬盘上,这里需要测试程序集成Emma jar包,并需要修改ant build文件。package com.example.instrumentation;import java.lang.reflect.InvocationTa…
以下代码时监听测试程序结束后将Emma测试报告写入到虚拟机上,然后可以使用adb pull命令发送至硬盘上,这里需要测试程序集成Emma jar包,并需要修改ant build文件。
package com.example.instrumentation;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import com.example.i2at.tc.TemperatureConverterActivity;
//import com.vladium.emma.rt.RT;

import android.app.Activity;
import android.app.Instrumentation;
import android.content.Intent;
import android.os.Bundle;
import android.os.Looper;
import android.util.Log;

public class EmmaInstrumentation extends Instrumentation implements FinishListener {

private static final String TAG = "EmmaInstrumentation";

private static final boolean LOGD = true;

private static final String DEFAULT_COVERAGE_FILE_PATH = "/mnt/sdcard/coverage.ec";

private final Bundle mResults = new Bundle();

private Intent mIntent;

private boolean mCoverage = true;

private String mCoverageFilePath;

/**
* Extends the AUT to provide the necessary behavior to invoke the
* {@link FinishListener} that may have been provided using
* {@link #setFinishListener(FinishListener)}.
*
* It's important to note that the original Activity has not been modified.
* Also, the Activity must be declared in the
* <code>AndroidManifest.xml</code> because it is started by an intent in
* {@link EmmaInstrumentation#onStart()}. This turns more difficult to use
* other methods like using template classes. This latter method could be
* viable, but all Activity methods should be re-written to invoke the
* template parameter class corresponding methods.
*
* @author diego
*
*/
public static class InstrumentedActivity extends
TemperatureConverterActivity {
private FinishListener mListener;

public void setFinishListener(FinishListener listener) {
mListener = listener;
}

@Override
public void finish() {
if (LOGD)
Log.d(TAG + ".InstrumentedActivity", "finish()");
super.finish();
if (mListener != null) {
mListener.onActivityFinished();
}
}

}

/**
* Constructor
*/
public EmmaInstrumentation() {

}

@Override
public void onCreate(Bundle arguments) {
if (LOGD)
Log.d(TAG, "onCreate(" + arguments + ")");
super.onCreate(arguments);

if (arguments != null) {
mCoverage = getBooleanArgument(arguments, "coverage");
mCoverageFilePath = arguments.getString("coverageFile");
}

mIntent = new Intent(getTargetContext(), InstrumentedActivity.class);
mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
start();
}

@Override
public void onStart() {
if (LOGD)
Log.d(TAG, "onStart()");
super.onStart();

Looper.prepare();
InstrumentedActivity activity = (InstrumentedActivity) startActivitySync(mIntent);
activity.setFinishListener(this);
}

private boolean getBooleanArgument(Bundle arguments, String tag) {
String tagString = arguments.getString(tag);
return tagString != null && Boolean.parseBoolean(tagString);
}

private void generateCoverageReport() {
if (LOGD)
Log.d(TAG, "generateCoverageReport()");

java.io.File coverageFile = new java.io.File(getCoverageFilePath());

// We may use this if we want to avoid refecltion and we include
// emma.jar
// RT.dumpCoverageData(coverageFile, false, false);

// Use reflection to call emma dump coverage method, to avoid
// always statically compiling against emma jar
try {
Class<?> emmaRTClass = Class.forName("com.vladium.emma.rt.RT");
Method dumpCoverageMethod = emmaRTClass.getMethod(
"dumpCoverageData", coverageFile.getClass(), boolean.class,
boolean.class);
dumpCoverageMethod.invoke(null, coverageFile, false, false);
} catch (ClassNotFoundException e) {
reportEmmaError("Is emma jar on classpath?", e);
} catch (SecurityException e) {
reportEmmaError(e);
} catch (NoSuchMethodException e) {
reportEmmaError(e);
} catch (IllegalArgumentException e) {
reportEmmaError(e);
} catch (IllegalAccessException e) {
reportEmmaError(e);
} catch (InvocationTargetException e) {
reportEmmaError(e);
}
}

private String getCoverageFilePath() {
if (mCoverageFilePath == null) {
return DEFAULT_COVERAGE_FILE_PATH;
} else {
return mCoverageFilePath;
}
}

private void reportEmmaError(Exception e) {
reportEmmaError("", e);
}

private void reportEmmaError(String hint, Exception e) {
String msg = "Failed to generate emma coverage. " + hint;
Log.e(TAG, msg, e);
mResults.putString(Instrumentation.REPORT_KEY_STREAMRESULT, "\nError: "
+ msg);
}

/* (non-Javadoc)
* @see com.example.instrumentation.FinishListener#onActivityFinished()
*/
@Override
public void onActivityFinished() {
if (LOGD)
Log.d(TAG, "onActivityFinished()");
if (mCoverage) {
generateCoverageReport();
}
finish(Activity.RESULT_OK, mResults);
}

}


定义finish接口
package com.example.instrumentation;

/**
* Listen for an Activity to finish and invokes {@link #onActivityFinished()} when this happens.
*
* @author diego
*
*/
public interface FinishListener {

/**
* Invoked when the Activity finishes.
*/
void onActivityFinished();

}


修改ant build.xml文件
 <!-- It only instruments class files, not any external libs -->
<emma enabled="true">
<instr verbosity="${verbosity}"
mode="overwrite"
instrpath="${out.absolute.dir}/classes"
outdir="${out.absolute.dir}/classes">
<!-- DTM: 2011-12-23: added filter for R -->
<filter excludes="*.R" />
<filter excludes="*.R$*" />
</instr>
<!-- TODO: exclusion filters on R*.class and allowing custom exclusion from
user defined file -->
</emma>


https://wiki.jenkins-ci.org/display/JENKINS/Building+an+Android+app+and+test+project
http://dtmilano.blogspot.com/search/label/android
http://www.jmfq.cn/news/5058613.html

相关文章:

  • 淘宝联盟网站推广怎么做/云搜索神器
  • 网站建设考试重点/中国免费广告网
  • 做平台的网站/营业推广的方式
  • 门户网站群建设/雅虎搜索引擎入口
  • 湘潭做网站 活动磐石网络/百度上怎么做推广
  • 网站热销榜怎么做/中国女排联赛排名
  • 做儿童方面的网站/上海网站搜索引擎优化
  • 北京网络职业技术学院官网/seo网站优化收藏
  • 临平网站建设/网络营销策略包括
  • 帮助做问卷调查的网站/免费推广seo
  • 端午节网页设计模板/衡阳seo优化
  • 哈尔滨政务性网站制作公司/百度指数怎样使用
  • b2c购物网站怎么做/东莞seo推广公司
  • 宁波品牌网站设计特点/搜索引擎优化结果
  • 慈溪网站制作哪家最好/seo项目优化案例分析文档
  • 网站qq客服怎么做/seo排名关键词点击
  • 网站开发有哪些方向/推广app有哪些
  • 完整的网站开发/百度扫一扫识别图片在线
  • wordpress 作品/seo建站技术
  • dw cs4怎么做网站/北京seo服务商
  • 任县网站建设设计/可以访问违规网站的浏览器
  • 重庆网站seo营销模板/鞋子软文推广300字
  • 有没有专门做橱窗的案例网站/app推广方式有哪些
  • 代码演示插件wordpress/360搜索优化
  • 怎样做网站关键词优化/谷歌seo 优化
  • 网站优化要多少钱/百度关键词竞价
  • asp官网/企业seo培训
  • 做k线图网站/常熟网络推广
  • wordpress comment_count/网络优化培训
  • 做网站用的编程工具/房产网站建设