From c552639de6e6192654c9aea02e89d6541baa3857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 10 Jul 2014 11:05:58 +0200 Subject: Minor gradle updates, due to Android L. - Build tools update to latest version (20). - testPackageName is correctly calculated by default, doing nothing. - support library needs some tweaks to support pre Android L versions. --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index a57a2763..82f71bc8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,13 +2,12 @@ apply plugin: 'android' android { compileSdkVersion 19 - buildToolsVersion "19.1.0" + buildToolsVersion "20" defaultConfig { minSdkVersion 14 targetSdkVersion 19 - testPackageName "se.leap.bitmaskclient.test" testInstrumentationRunner "android.test.InstrumentationTestRunner" } @@ -47,7 +46,8 @@ android { } dependencies { - androidTestCompile 'com.android.support:support-v4:+' + androidTestCompile 'com.android.support:support-v4:20+' + androidTestCompile 'com.android.support:appcompat-v7:20.+' androidTestCompile 'com.jayway.android.robotium:robotium-solo:4.3.1' compile 'com.intellij:annotations:12.0' } -- cgit v1.2.3 From 629a0b279a80938212b01c096e55c402d91739d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 10 Jul 2014 12:40:26 +0200 Subject: We don't need support library from Robotium. I've also fixed a simple test that wasn't letting the suite to finish correctly. --- app/build.gradle | 6 +++--- .../java/se/leap/bitmaskclient/test/testConfigurationWizard.java | 2 +- .../androidTest/java/se/leap/bitmaskclient/test/testDashboard.java | 4 +--- app/src/main/java/se/leap/bitmaskclient/EIP.java | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index 82f71bc8..c4fdc44b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,9 +46,9 @@ android { } dependencies { - androidTestCompile 'com.android.support:support-v4:20+' - androidTestCompile 'com.android.support:appcompat-v7:20.+' - androidTestCompile 'com.jayway.android.robotium:robotium-solo:4.3.1' + // androidTestCompile 'com.android.support:support-v4:20+' + // androidTestCompile 'com.android.support:appcompat-v7:20.+' + androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.2.1' compile 'com.intellij:annotations:12.0' } 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 8ddfbc57..229c3452 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java @@ -2,7 +2,7 @@ package se.leap.bitmaskclient.test; import android.test.ActivityInstrumentationTestCase2; import android.widget.ListView; -import com.jayway.android.robotium.solo.Solo; +import com.robotium.solo.Solo; import java.io.IOException; import se.leap.bitmaskclient.AboutActivity; import se.leap.bitmaskclient.ConfigurationWizard; diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java index bbc3e97d..85197493 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java @@ -7,7 +7,7 @@ import android.content.IntentFilter; import android.provider.Settings; import android.test.ActivityInstrumentationTestCase2; import android.util.Log; -import com.jayway.android.robotium.solo.Solo; +import com.robotium.solo.Solo; import se.leap.bitmaskclient.ConfigurationWizard; import se.leap.bitmaskclient.Dashboard; import se.leap.bitmaskclient.R; @@ -39,8 +39,6 @@ public class testDashboard extends ActivityInstrumentationTestCase2 { */ public void testOnOffOpenVpn() { solo.clickOnView(solo.getView(R.id.eipSwitch)); - if(!solo.waitForText(getActivity().getString(R.string.eip_status_start_pending))) - fail(); if(!solo.waitForText(getActivity().getString(R.string.state_auth))) fail(); if(!solo.waitForText(getActivity().getString(R.string.eip_state_connected), 1, 30*1000)) diff --git a/app/src/main/java/se/leap/bitmaskclient/EIP.java b/app/src/main/java/se/leap/bitmaskclient/EIP.java index 0b43f9e1..7374d5ed 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/EIP.java @@ -445,7 +445,7 @@ public final class EIP extends IntentService { } catch (JSONException e) { Log.v(TAG,"Couldn't read gateway name for profile creation! Returning original name = " + mName); e.printStackTrace(); - return mName; + return (mName != null) ? mName : ""; } } -- cgit v1.2.3 From 98f2fcedc3c645b38ecf168d57e28287c4a7a76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 10 Jul 2014 18:32:55 +0200 Subject: Simulate network down. The tests say they failed, but it's because the adb server is no longer able to communicate with the emulator due to switching network connectivity off (and being the adb server connected to a local tcp port of the emulator, this port dissapears once connectivity is down). To see if all tests passed, take a look at the logcat. Once tests are finished, issue "adb kill-server" from the development machine, and then "adb logcat". --- .../androidTest/java/se/leap/bitmaskclient/test/testDashboard.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java index 85197493..66ef6565 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java @@ -48,14 +48,13 @@ public class testDashboard extends ActivityInstrumentationTestCase2 { if(!solo.waitForText(getActivity().getString(R.string.eip_state_not_connected))) fail(); - /*ConnectionManager.setMobileDataEnabled(false, solo.getCurrentActivity().getApplicationContext()); + ConnectionManager.setMobileDataEnabled(false, solo.getCurrentActivity().getApplicationContext()); solo.clickOnView(solo.getView(R.id.eipSwitch)); - if(!solo.waitForText(getActivity().getString(R.string.eip_status_start_pending))) - fail(); + // if(!solo.waitForText(getActivity().getString(R.string.eip_status_start_pending))) + // fail(); if(!solo.waitForText(getActivity().getString(R.string.state_nonetwork))) fail(); - */ } public void testLogInAndOut() { -- cgit v1.2.3 From 623f81b5e52a5155549731e4afe35ca054f97a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 10 Jul 2014 20:55:55 +0200 Subject: network up & down 3 times: sometimes fails I simulate removing the network at the end of the test. Sometimes, the test fails because a openvpn tries to close a bad file descriptor. --- .../se/leap/bitmaskclient/test/testDashboard.java | 71 ++++++++++++++++------ 1 file changed, 53 insertions(+), 18 deletions(-) (limited to 'app') diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java index 66ef6565..fdf4f135 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java @@ -8,6 +8,8 @@ import android.provider.Settings; import android.test.ActivityInstrumentationTestCase2; import android.util.Log; import com.robotium.solo.Solo; + +import de.blinkt.openvpn.activities.DisconnectVPN; import se.leap.bitmaskclient.ConfigurationWizard; import se.leap.bitmaskclient.Dashboard; import se.leap.bitmaskclient.R; @@ -38,25 +40,58 @@ public class testDashboard extends ActivityInstrumentationTestCase2 { * I cannot automate that dialog. */ public void testOnOffOpenVpn() { - solo.clickOnView(solo.getView(R.id.eipSwitch)); - if(!solo.waitForText(getActivity().getString(R.string.state_auth))) - fail(); - if(!solo.waitForText(getActivity().getString(R.string.eip_state_connected), 1, 30*1000)) - fail(); - - solo.clickOnView(solo.getView(R.id.eipSwitch)); - if(!solo.waitForText(getActivity().getString(R.string.eip_state_not_connected))) - fail(); - - ConnectionManager.setMobileDataEnabled(false, solo.getCurrentActivity().getApplicationContext()); - - solo.clickOnView(solo.getView(R.id.eipSwitch)); - // if(!solo.waitForText(getActivity().getString(R.string.eip_status_start_pending))) - // fail(); - if(!solo.waitForText(getActivity().getString(R.string.state_nonetwork))) - fail(); + solo.clickOnView(solo.getView(R.id.eipSwitch)); + testEipTurningOn(); + + solo.clickOnView(solo.getView(R.id.eipSwitch)); + testEipTurningOff(); + + solo.clickOnView(solo.getView(R.id.eipSwitch)); + testEipTurningOn(); + + solo.clickOnView(solo.getView(R.id.eipSwitch)); + testEipTurningOff(); + + solo.clickOnView(solo.getView(R.id.eipSwitch)); + testEipTurningOn(); + + solo.clickOnView(solo.getView(R.id.eipSwitch)); + testEipTurningOff(); + + solo.clickOnView(solo.getView(R.id.eipSwitch)); + testEipTurningOn(); + + testEipIsOnNoNetwork(); + } - + + private void testEipTurningOn() { + if(!solo.waitForText(getActivity().getString(R.string.state_auth))) + fail(); + if(!solo.waitForText(getActivity().getString(R.string.eip_state_connected), 1, 30*1000)) + fail(); + solo.sleep(2*1000); + } + + private void testEipTurningOff() { + sayOkToDisconnect(); + if(!solo.waitForText(getActivity().getString(R.string.eip_state_not_connected))) + fail(); + solo.sleep(2*1000); + } + + private void sayOkToDisconnect() { + if(!solo.waitForActivity(DisconnectVPN.class)) + fail(); + solo.clickOnText(getActivity().getString(android.R.string.yes)); + } + + private void testEipIsOnNoNetwork() { + ConnectionManager.setMobileDataEnabled(false, solo.getCurrentActivity().getApplicationContext()); + if(!solo.waitForText(getActivity().getString(R.string.eip_state_not_connected), 1, 15*1000)) + fail(); + } + public void testLogInAndOut() { long miliseconds_to_log_in = 40 * 1000; solo.clickOnActionBarItem(R.id.login_button); -- cgit v1.2.3 From b8165c50328beca82efc93fadfc69a3ac18123dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 15 Jul 2014 18:29:37 +0200 Subject: Bump build number and version for 0.6.0-RC1 --- app/src/main/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f73d59cb..8018f7e8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,8 +17,8 @@ + android:versionCode="85" + android:versionName="0.6.0-RC1" > -- cgit v1.2.3 From dce7064c35a903c7b13e97181c07058e143df621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 21 Jul 2014 17:10:31 +0200 Subject: Bump version number for the "meetup" release --- app/src/main/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8018f7e8..a90d6396 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,8 +17,8 @@ + android:versionCode="86" + android:versionName="0.5.4" > -- cgit v1.2.3