Keep automatically created accounts for unit tests
This commit is contained in:
parent
05ed87cea6
commit
32eb7bbfe9
4 changed files with 32 additions and 12 deletions
|
@ -4,6 +4,7 @@ import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.lang.Override;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
@ -29,6 +30,7 @@ public class MainActivity extends Activity {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e("liblinphone_tester", "Cannot install rc files",e);
|
Log.e("liblinphone_tester", "Cannot install rc files",e);
|
||||||
}
|
}
|
||||||
|
Tester.keepAccounts(true);
|
||||||
TesterList suitesTest = new TesterList();
|
TesterList suitesTest = new TesterList();
|
||||||
suitesTest.run(new String[]{"tester", "--list-suites"});
|
suitesTest.run(new String[]{"tester", "--list-suites"});
|
||||||
LinearLayout layout = ((LinearLayout)findViewById(R.id.suites_list));
|
LinearLayout layout = ((LinearLayout)findViewById(R.id.suites_list));
|
||||||
|
@ -39,6 +41,13 @@ public class MainActivity extends Activity {
|
||||||
addButton(layout, str, str);
|
addButton(layout, str, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy(){
|
||||||
|
Tester.clearAccounts();
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
private void addButton(LinearLayout layout, String text, String data) {
|
private void addButton(LinearLayout layout, String text, String data) {
|
||||||
Button button = new Button(this);
|
Button button = new Button(this);
|
||||||
button.setText(text);
|
button.setText(text);
|
||||||
|
|
|
@ -5,6 +5,8 @@ import android.os.Bundle;
|
||||||
|
|
||||||
import com.zutubi.android.junitreport.JUnitReportTestRunner;
|
import com.zutubi.android.junitreport.JUnitReportTestRunner;
|
||||||
|
|
||||||
|
import java.lang.Override;
|
||||||
|
|
||||||
|
|
||||||
public class TestRunner extends JUnitReportTestRunner {
|
public class TestRunner extends JUnitReportTestRunner {
|
||||||
String mSuite = null;
|
String mSuite = null;
|
||||||
|
@ -14,10 +16,17 @@ public class TestRunner extends JUnitReportTestRunner {
|
||||||
public void onCreate(Bundle arguments) {
|
public void onCreate(Bundle arguments) {
|
||||||
mSuite = arguments.getString("suite");
|
mSuite = arguments.getString("suite");
|
||||||
mTest = arguments.getString("test");
|
mTest = arguments.getString("test");
|
||||||
|
Tester.keepAccounts(true);
|
||||||
|
|
||||||
super.onCreate(arguments);
|
super.onCreate(arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
Tester.clearAccounts();
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TestSuite getAllTests () {
|
public TestSuite getAllTests () {
|
||||||
TestSuite suite = new TestSuite("Tests");
|
TestSuite suite = new TestSuite("Tests");
|
||||||
|
|
|
@ -45,6 +45,8 @@ public class Tester {
|
||||||
}
|
}
|
||||||
|
|
||||||
public native int run(String args[]);
|
public native int run(String args[]);
|
||||||
|
public static native void keepAccounts(boolean keep);
|
||||||
|
public static native void clearAccounts();
|
||||||
|
|
||||||
public void printLog(final int level, final String message) {
|
public void printLog(final int level, final String message) {
|
||||||
switch(level) {
|
switch(level) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 23f950a73fe9bacd00e934fddfe40cd7acf970a9
|
Subproject commit 5824199483fbd4ff62d92722cd2c5175e41e7888
|
Loading…
Reference in a new issue