mirror of https://github.com/tasks/tasks
Merge branch 'master' into gtasks
commit
1e9cda7aaa
Binary file not shown.
|
After Width: | Height: | Size: 882 B |
@ -1,97 +1,102 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@drawable/pdv_body">
|
||||||
|
<ImageView
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:paddingTop="5dip"
|
||||||
android:background="@drawable/pdv_body">
|
android:paddingBottom="5dip"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
<ImageView
|
android:src="@drawable/pdv_logo" />
|
||||||
android:layout_width="fill_parent"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:paddingTop="5dip"
|
android:layout_height="wrap_content"
|
||||||
android:paddingBottom="5dip"
|
android:gravity="center"
|
||||||
android:scaleType="fitCenter"
|
android:paddingBottom="10dip"
|
||||||
android:src="@drawable/pdv_logo" />
|
android:textSize="16sp"
|
||||||
|
android:textColor="#ffffff"
|
||||||
<TextView
|
android:text="@string/producteev_PLA_body" />
|
||||||
android:layout_width="fill_parent"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/error"
|
||||||
android:gravity="center"
|
android:layout_width="fill_parent"
|
||||||
android:paddingBottom="10dip"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="16sp"
|
android:gravity="center_horizontal"
|
||||||
android:textColor="#ffffff"
|
android:paddingBottom="20dip"
|
||||||
android:text="@string/producteev_PLA_body" />
|
android:textColor="#ff0000"
|
||||||
|
android:textSize="16sp"
|
||||||
<TextView android:id="@+id/error"
|
android:textStyle="bold"
|
||||||
android:layout_width="fill_parent"
|
android:visibility="gone" />
|
||||||
android:layout_height="wrap_content"
|
<EditText
|
||||||
android:gravity="center_horizontal"
|
android:id="@+id/email"
|
||||||
android:paddingBottom="20dip"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#ff0000"
|
android:layout_width="fill_parent"
|
||||||
android:textSize="16sp"
|
android:hint="@string/producteev_PLA_email"
|
||||||
android:textStyle="bold"
|
android:contentDescription="E-Mail with which you registered to Producteev-service"
|
||||||
android:visibility="gone" />
|
android:inputType="textEmailAddress" />
|
||||||
|
<EditText
|
||||||
<EditText android:id="@+id/email"
|
android:id="@+id/password"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:hint="@string/producteev_PLA_email"
|
android:contentDescription="Password for your Producteev account"
|
||||||
android:contentDescription="E-Mail with which you registered to Producteev-service"
|
android:hint="@string/producteev_PLA_password"
|
||||||
android:inputType="textEmailAddress"/>
|
android:inputType="textPassword" />
|
||||||
|
<LinearLayout
|
||||||
<EditText android:id="@+id/password"
|
android:id="@+id/newUserLayout"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="Password for your Producteev account"
|
android:orientation="vertical"
|
||||||
android:hint="@string/producteev_PLA_password"
|
android:paddingTop="20dip"
|
||||||
android:inputType="textPassword"/>
|
android:visibility="gone">
|
||||||
|
<EditText
|
||||||
<LinearLayout android:id="@+id/newUserLayout"
|
android:id="@+id/firstName"
|
||||||
android:layout_width="fill_parent" android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:layout_width="fill_parent"
|
||||||
android:paddingTop="20dip"
|
android:hint="@string/producteev_PLA_firstName"
|
||||||
android:visibility="gone">
|
android:inputType="textPersonName" />
|
||||||
|
<EditText
|
||||||
<EditText android:id="@+id/firstName"
|
android:id="@+id/lastName"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:hint="@string/producteev_PLA_firstName"
|
android:hint="@string/producteev_PLA_lastName"
|
||||||
android:inputType="textPersonName"/>
|
android:inputType="textPersonName" />
|
||||||
|
<Spinner
|
||||||
<EditText android:id="@+id/lastName"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:id="@+id/timezoneList"
|
||||||
android:hint="@string/producteev_PLA_lastName"
|
android:contentDescription="@string/producteev_PLA_timezone"
|
||||||
android:inputType="textPersonName"/>
|
android:prompt="@string/producteev_PLA_timezone" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
<LinearLayout
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:orientation="horizontal"
|
||||||
android:layout_height="wrap_content"
|
android:paddingTop="5dip"
|
||||||
android:orientation="horizontal"
|
android:baselineAligned="false">
|
||||||
android:paddingTop="5dip"
|
<Button
|
||||||
android:baselineAligned="false">
|
android:id="@+id/signIn"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
<Button android:id="@+id/signIn" android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content" android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/producteev_PLA_signIn" />
|
android:text="@string/producteev_PLA_signIn" />
|
||||||
|
<Button
|
||||||
<Button android:id="@+id/createNew" android:layout_width="fill_parent"
|
android:id="@+id/createNew"
|
||||||
android:layout_height="wrap_content" android:layout_weight="1"
|
android:layout_width="fill_parent"
|
||||||
android:text="@string/producteev_PLA_createNew" />
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
</LinearLayout>
|
android:text="@string/producteev_PLA_createNew" />
|
||||||
|
</LinearLayout>
|
||||||
|
<TextView
|
||||||
<TextView android:id="@+id/terms"
|
android:id="@+id/terms"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingTop="10dip"
|
android:paddingTop="10dip"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textColor="#0000ff"
|
android:textColor="#0000ff"
|
||||||
android:linksClickable="true"
|
android:linksClickable="true"
|
||||||
android:text="@string/producteev_PLA_terms" />
|
android:text="@string/producteev_PLA_terms" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
@ -0,0 +1,246 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Zutubi Pty Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.zutubi.android.junitreport;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
import java.io.Writer;
|
||||||
|
|
||||||
|
import junit.framework.AssertionFailedError;
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import junit.framework.TestListener;
|
||||||
|
|
||||||
|
import org.xmlpull.v1.XmlSerializer;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.util.Xml;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom test listener that outputs test results to a single XML file. The file
|
||||||
|
* uses a similar format the to Ant JUnit task XML formatter, with a couple of
|
||||||
|
* caveats:
|
||||||
|
* <ul>
|
||||||
|
* <li>Multiple suites are all placed in a single file under a root
|
||||||
|
* <testsuites> element.</li>
|
||||||
|
* <li>Redundant information about the number of nested cases within a suite is
|
||||||
|
* omitted.</li>
|
||||||
|
* <li>Neither standard output nor system properties are included.</li>
|
||||||
|
* </ul>
|
||||||
|
* The differences mainly revolve around making this reporting as lightweight as
|
||||||
|
* possible. The report is streamed as the tests run, making it impossible to,
|
||||||
|
* e.g. include the case count in a <testsuite> element.
|
||||||
|
*/
|
||||||
|
public class JUnitReportListener implements TestListener {
|
||||||
|
private static final String LOG_TAG = "JUnitReportListener";
|
||||||
|
|
||||||
|
private static final String ENCODING_UTF_8 = "utf-8";
|
||||||
|
|
||||||
|
private static final String TAG_SUITES = "testsuites";
|
||||||
|
private static final String TAG_SUITE = "testsuite";
|
||||||
|
private static final String TAG_CASE = "testcase";
|
||||||
|
private static final String TAG_ERROR = "error";
|
||||||
|
private static final String TAG_FAILURE = "failure";
|
||||||
|
|
||||||
|
private static final String ATTRIBUTE_NAME = "name";
|
||||||
|
private static final String ATTRIBUTE_CLASS = "classname";
|
||||||
|
private static final String ATTRIBUTE_TYPE = "type";
|
||||||
|
private static final String ATTRIBUTE_MESSAGE = "message";
|
||||||
|
private static final String ATTRIBUTE_TIME = "time";
|
||||||
|
|
||||||
|
// With thanks to org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
|
||||||
|
// Trimmed some entries, added others for Android.
|
||||||
|
private static final String[] DEFAULT_TRACE_FILTERS = new String[] {
|
||||||
|
"junit.framework.TestCase", "junit.framework.TestResult",
|
||||||
|
"junit.framework.TestSuite",
|
||||||
|
"junit.framework.Assert.", // don't filter AssertionFailure
|
||||||
|
"java.lang.reflect.Method.invoke(", "sun.reflect.",
|
||||||
|
// JUnit 4 support:
|
||||||
|
"org.junit.", "junit.framework.JUnit4TestAdapter", " more",
|
||||||
|
// Added for Android
|
||||||
|
"android.test.", "android.app.Instrumentation",
|
||||||
|
"java.lang.reflect.Method.invokeNative",
|
||||||
|
};
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
private String mReportFilePath;
|
||||||
|
private boolean mFilterTraces;
|
||||||
|
private FileOutputStream mOutputStream;
|
||||||
|
private XmlSerializer mSerializer;
|
||||||
|
private String mCurrentSuite;
|
||||||
|
|
||||||
|
// simple time tracking
|
||||||
|
private boolean timeAlreadyWritten = false;
|
||||||
|
private long testStart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new listener.
|
||||||
|
*
|
||||||
|
* @param context context of the target application under test
|
||||||
|
* @param reportFilePath path of the report file to create (under the
|
||||||
|
* context using {@link Context#openFileOutput(String, int)}).
|
||||||
|
* @param filterTraces if true, stack traces will have common noise (e.g.
|
||||||
|
* framework methods) omitted for clarity
|
||||||
|
*/
|
||||||
|
public JUnitReportListener(Context context, String reportFilePath, boolean filterTraces) {
|
||||||
|
this.mContext = context;
|
||||||
|
this.mReportFilePath = reportFilePath;
|
||||||
|
this.mFilterTraces = filterTraces;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startTest(Test test) {
|
||||||
|
try {
|
||||||
|
openIfRequired(test);
|
||||||
|
|
||||||
|
if (test instanceof TestCase) {
|
||||||
|
TestCase testCase = (TestCase) test;
|
||||||
|
checkForNewSuite(testCase);
|
||||||
|
testStart = System.currentTimeMillis();
|
||||||
|
timeAlreadyWritten = false;
|
||||||
|
mSerializer.startTag("", TAG_CASE);
|
||||||
|
mSerializer.attribute("", ATTRIBUTE_CLASS, mCurrentSuite);
|
||||||
|
mSerializer.attribute("", ATTRIBUTE_NAME, testCase.getName());
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(LOG_TAG, safeMessage(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkForNewSuite(TestCase testCase) throws IOException {
|
||||||
|
String suiteName = testCase.getClass().getName();
|
||||||
|
if (mCurrentSuite == null || !mCurrentSuite.equals(suiteName)) {
|
||||||
|
if (mCurrentSuite != null) {
|
||||||
|
mSerializer.endTag("", TAG_SUITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
mSerializer.startTag("", TAG_SUITE);
|
||||||
|
mSerializer.attribute("", ATTRIBUTE_NAME, suiteName);
|
||||||
|
mCurrentSuite = suiteName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openIfRequired(Test test) throws IOException {
|
||||||
|
if (mOutputStream == null) {
|
||||||
|
mOutputStream = mContext.openFileOutput(mReportFilePath, 0);
|
||||||
|
mSerializer = Xml.newSerializer();
|
||||||
|
mSerializer.setOutput(mOutputStream, ENCODING_UTF_8);
|
||||||
|
mSerializer.startDocument(ENCODING_UTF_8, true);
|
||||||
|
mSerializer.startTag("", TAG_SUITES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addError(Test test, Throwable error) {
|
||||||
|
addProblem(TAG_ERROR, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addFailure(Test test, AssertionFailedError error) {
|
||||||
|
addProblem(TAG_FAILURE, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addProblem(String tag, Throwable error) {
|
||||||
|
try {
|
||||||
|
recordTestTime();
|
||||||
|
|
||||||
|
mSerializer.startTag("", tag);
|
||||||
|
mSerializer.attribute("", ATTRIBUTE_MESSAGE, safeMessage(error));
|
||||||
|
mSerializer.attribute("", ATTRIBUTE_TYPE, error.getClass().getName());
|
||||||
|
StringWriter w = new StringWriter();
|
||||||
|
error.printStackTrace(mFilterTraces ? new FilteringWriter(w) : new PrintWriter(w));
|
||||||
|
mSerializer.text(w.toString());
|
||||||
|
mSerializer.endTag("", tag);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(LOG_TAG, safeMessage(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void recordTestTime() throws IOException {
|
||||||
|
if(!timeAlreadyWritten) {
|
||||||
|
timeAlreadyWritten = true;
|
||||||
|
mSerializer.attribute("", ATTRIBUTE_TIME,
|
||||||
|
String.format("%.3f", (System.currentTimeMillis() - testStart) / 1000.));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void endTest(Test test) {
|
||||||
|
try {
|
||||||
|
if (test instanceof TestCase) {
|
||||||
|
recordTestTime();
|
||||||
|
mSerializer.endTag("", TAG_CASE);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(LOG_TAG, safeMessage(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Releases all resources associated with this listener. Must be called
|
||||||
|
* when the listener is finished with.
|
||||||
|
*/
|
||||||
|
public void close() {
|
||||||
|
if (mSerializer != null) {
|
||||||
|
try {
|
||||||
|
if (mCurrentSuite != null) {
|
||||||
|
mSerializer.endTag("", TAG_SUITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
mSerializer.endTag("", TAG_SUITES);
|
||||||
|
mSerializer.endDocument();
|
||||||
|
mSerializer = null;
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(LOG_TAG, safeMessage(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mOutputStream != null) {
|
||||||
|
try {
|
||||||
|
mOutputStream.close();
|
||||||
|
mOutputStream = null;
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(LOG_TAG, safeMessage(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String safeMessage(Throwable error) {
|
||||||
|
String message = error.getMessage();
|
||||||
|
return error.getClass().getName() + ": " + (message == null ? "<null>" : message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper around a print writer that filters out common noise from stack
|
||||||
|
* traces, making it easier to see the actual failure.
|
||||||
|
*/
|
||||||
|
private static class FilteringWriter extends PrintWriter {
|
||||||
|
public FilteringWriter(Writer out) {
|
||||||
|
super(out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void println(String s) {
|
||||||
|
for (String filtered : DEFAULT_TRACE_FILTERS) {
|
||||||
|
if (s.contains(filtered)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.println(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Zutubi Pty Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.zutubi.android.junitreport;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.test.AndroidTestRunner;
|
||||||
|
import android.test.InstrumentationTestRunner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom test runner that adds a {@link JUnitReportListener} to the underlying
|
||||||
|
* test runner in order to capture test results in an XML report. You may use
|
||||||
|
* this class in place of {@link InstrumentationTestRunner} in your test
|
||||||
|
* project's manifest, and/or specify it to your Ant build using the test.runner
|
||||||
|
* property.
|
||||||
|
* <p/>
|
||||||
|
* This runner behaves identically to the default, with the added side-effect of
|
||||||
|
* producing a JUnit XML report. The report format is similar to that produced
|
||||||
|
* by the Ant JUnit task's XML formatter, making it compatible with existing
|
||||||
|
* tools that can process that format. See {@link JUnitReportListener} for
|
||||||
|
* further details.
|
||||||
|
* <p/>
|
||||||
|
* This runner accepts the following arguments:
|
||||||
|
* <ul>
|
||||||
|
* <li>reportFilePath: path of the file to write the XML report to, in the
|
||||||
|
* target application's data area (default: junit-report.xml).</li>
|
||||||
|
* <li>filterTraces: if true, stack traces in test failure reports will be
|
||||||
|
* filtered to remove noise such as framework methods (default: true)</li>
|
||||||
|
* </ul>
|
||||||
|
* These arguments may be specified as follows:
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {@code adb shell am instrument -w -e reportFile my-report-file.xml}
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public class JUnitReportTestRunner extends InstrumentationTestRunner {
|
||||||
|
/**
|
||||||
|
* Path, relative to the target applications file root, at which to write the report file.
|
||||||
|
*/
|
||||||
|
private static final String ARG_REPORT_FILE_PATH = "reportFilePath";
|
||||||
|
/**
|
||||||
|
* If true, stack traces in the report will be filtered to remove common noise (e.g. framework
|
||||||
|
* methods).
|
||||||
|
*/
|
||||||
|
private static final String ARG_FILTER_TRACES = "filterTraces";
|
||||||
|
/**
|
||||||
|
* Default path of the report file.
|
||||||
|
*/
|
||||||
|
private static final String DEFAULT_REPORT_FILE = "junit-report.xml";
|
||||||
|
|
||||||
|
private JUnitReportListener mListener;
|
||||||
|
private String mReportFilePath;
|
||||||
|
private boolean mFilterTraces = true;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle arguments) {
|
||||||
|
if (arguments != null) {
|
||||||
|
mReportFilePath = arguments.getString(ARG_REPORT_FILE_PATH);
|
||||||
|
mFilterTraces = arguments.getBoolean(ARG_FILTER_TRACES, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mReportFilePath == null) {
|
||||||
|
mReportFilePath = DEFAULT_REPORT_FILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onCreate(arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected AndroidTestRunner getAndroidTestRunner() {
|
||||||
|
AndroidTestRunner runner = new AndroidTestRunner();
|
||||||
|
mListener = new JUnitReportListener(getTargetContext(), mReportFilePath, mFilterTraces);
|
||||||
|
runner.addTestListener(mListener);
|
||||||
|
return runner;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finish(int resultCode, Bundle results) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.finish(resultCode, results);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue