From 250b56762857f2e52626236d3716459786ce126d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 15 Jan 2015 15:24:52 +0100 Subject: More tests, sometimes they don't pass sometimes do testIsValid depends on the speed of Runtime's exec: sometimes it's quick and passes (because it changes the date correctly) and sometimes is not. A waitFor doesn't fix the issue, it waits forever. --- .../leap/bitmaskclient/test/ConnectionManager.java | 6 +- .../test/testConfigurationWizard.java | 106 +++++++---- .../test/testDashboardIntegration.java | 194 +++++++++++---------- .../test/testVpnCertificateValidator.java | 22 ++- 4 files changed, 184 insertions(+), 144 deletions(-) (limited to 'app/src/androidTest/java/se') diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/ConnectionManager.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/ConnectionManager.java index f1cbff19..e67dd820 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/ConnectionManager.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/ConnectionManager.java @@ -17,12 +17,10 @@ public class ConnectionManager { method.setAccessible(true); try { method.invoke(conman, enabled); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { + } catch (InvocationTargetException | IllegalAccessException e) { e.printStackTrace(); } - } + } } } diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java index 78ce1c81..755f83a7 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java @@ -1,14 +1,10 @@ package se.leap.bitmaskclient.test; -import android.test.ActivityInstrumentationTestCase2; -import android.widget.ListView; -import com.robotium.solo.Solo; -import java.io.IOException; -import se.leap.bitmaskclient.AboutActivity; -import se.leap.bitmaskclient.ConfigurationWizard; -import se.leap.bitmaskclient.ProviderDetailFragment; -import se.leap.bitmaskclient.R; -import se.leap.bitmaskclient.test.ConnectionManager; +import android.test.*; +import android.widget.*; +import com.robotium.solo.*; +import java.io.*; +import se.leap.bitmaskclient.*; public class testConfigurationWizard extends ActivityInstrumentationTestCase2 { @@ -19,10 +15,15 @@ public class testConfigurationWizard extends ActivityInstrumentationTestCase2 { private Solo solo; - + private Context context; + public testDashboardIntegration() { super(Dashboard.class); } @@ -30,8 +21,12 @@ public class testDashboardIntegration extends ActivityInstrumentationTestCase2