summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-12-01 19:52:54 +0100
committerParménides GV <parmegv@sdf.org>2014-12-01 19:52:54 +0100
commita59f2e0083b05fd94e2d0d2c1fcfeaa42b851531 (patch)
treefa4728712320ba459760906390851a09930f7712
parentb32fdf11b0ef473d489f9fb23f136fecf7051354 (diff)
Reordered EIP methods.
Written basic skeleton for testEIP, renamed testDashboard to start, in the future, unit tests.
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboardIntegration.java (renamed from app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java)4
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/testEIP.java32
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EIP.java17
3 files changed, 42 insertions, 11 deletions
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboardIntegration.java
index 1af17fe6..94cb67a3 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboard.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testDashboardIntegration.java
@@ -15,11 +15,11 @@ import se.leap.bitmaskclient.Dashboard;
import se.leap.bitmaskclient.R;
import se.leap.bitmaskclient.test.ConnectionManager;
-public class testDashboard extends ActivityInstrumentationTestCase2<Dashboard> {
+public class testDashboardIntegration extends ActivityInstrumentationTestCase2<Dashboard> {
private Solo solo;
- public testDashboard() {
+ public testDashboardIntegration() {
super(Dashboard.class);
}
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testEIP.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testEIP.java
new file mode 100644
index 00000000..4e1819d0
--- /dev/null
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testEIP.java
@@ -0,0 +1,32 @@
+package se.leap.bitmaskclient.test;
+
+import android.content.Context;
+import android.content.Intent;
+import android.test.ActivityUnitTestCase;
+import android.test.ServiceTestCase;
+
+import se.leap.bitmaskclient.Dashboard;
+import se.leap.bitmaskclient.eip.EIP;
+
+public class testEIP extends ServiceTestCase<EIP> {
+
+ private Context context;
+ private Intent intent;
+ private EIP activity;
+
+ public testEIP(Class<EIP> activityClass) {
+ super(activityClass);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+
+}
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
index a67eaccd..b4208556 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
@@ -160,21 +160,12 @@ public final class EIP extends IntentService {
tellToReceiver(ACTION_STOP_EIP, result_code);
}
-
- private void tellToReceiver(String action, int resultCode) {
- if (mReceiver != null){
- Bundle resultData = new Bundle();
- resultData.putString(REQUEST_TAG, action);
- mReceiver.send(resultCode, resultData);
- }
- }
/**
* Checks the last stored status notified by ics-openvpn
* Sends <code>Activity.RESULT_CANCELED</code> to the ResultReceiver that made the
* request if it's not connected, <code>Activity.RESULT_OK</code> otherwise.
*/
-
private void isRunning() {
EipStatus eip_status = EipStatus.getInstance();
int resultCode = (eip_status.isConnected()) ?
@@ -253,4 +244,12 @@ public final class EIP extends IntentService {
Activity.RESULT_CANCELED;
tellToReceiver(ACTION_CHECK_CERT_VALIDITY, resultCode);
}
+
+ private void tellToReceiver(String action, int resultCode) {
+ if (mReceiver != null){
+ Bundle resultData = new Bundle();
+ resultData.putString(REQUEST_TAG, action);
+ mReceiver.send(resultCode, resultData);
+ }
+ }
}