calabash-android 0.4.7.pre7 → 0.4.7.pre8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cef60c767cc5d65fbe92b152d074a39110485815
4
- data.tar.gz: 2176ececc5a8775c25c273459c7365b72a63e9db
3
+ metadata.gz: 19abb342f1359f26b1e7b8a1d53778979a9bde51
4
+ data.tar.gz: 62aceab9963f035a0263b06902f52b9165d3f26b
5
5
  SHA512:
6
- metadata.gz: 7d2f70bebaf738c050561bf42b9fd0be6853496270b546f9fb326e00de49bcd9dd42f5b0cfc8a9b33e8312c785553d8c1d6001e9eb419849c8fe3ad8a89fa36d
7
- data.tar.gz: f819d4a18a951b5264fb7e6a17786a98faed5f07efd0b164f7e8db4b49dc033bc658e75155ae217f62b169f7051e04eea4bf0e1164b18d9bb1f5a497e9446a5a
6
+ metadata.gz: d7817b6dd4e7864d1a964096b99c29c9b7d3d3bec69772a980d579797f64c75863076372cdeceec9fb05a432994eada5732967383e5b42bd21f58483ba476887
7
+ data.tar.gz: d66b8cb96a8bc16add49a94c75d94fc5cc2f255d583e9e3b435d28f9b96b5f06d0cb7b5382124968cdd856aabb8bd2e6c930acba854f3e5ab91f8deac12f0ceb
@@ -1,5 +1,5 @@
1
1
  module Calabash
2
2
  module Android
3
- VERSION = "0.4.7.pre7"
3
+ VERSION = "0.4.7.pre8"
4
4
  end
5
5
  end
@@ -17,7 +17,7 @@
17
17
  <condition property="bat" value=".bat" else=""><os family="windows" /></condition>
18
18
 
19
19
  <property name="dx" location="${tools.dir}/dx${bat}" />
20
- <property name="aapt" location="${tools.dir}/aapt${bat}" />
20
+ <property name="aapt" location="${tools.dir}/aapt" />
21
21
 
22
22
  <property name="android.lib" location="${env.ANDROID_HOME}/platforms/android-${android.api.level}/android.jar"/>
23
23
  <path id="android.antlibs">
@@ -64,6 +64,13 @@
64
64
  <fileset dir="${calabashjs.dir}"/>
65
65
  </copy>
66
66
  <replace file="${staging.dir}/src/sh/calaba/instrumentationbackend/actions/version/Version.java" token="####VERSION####" value="${version}" failOnNoReplacements="true" />
67
+
68
+ <property name="src.dir.absolute" location="${staging.dir}/src" />
69
+ <pathconvert property="testserver.actions" pathsep="${line.separator}" dirsep=".">
70
+ <fileset dir="${src.dir.absolute}" includes="sh/calaba/instrumentationbackend/actions/**/*.java" />
71
+ <globmapper from="${src.dir.absolute}/*.java" to="*" handledirsep="true" />
72
+ </pathconvert>
73
+ <echo file="${staging.dir}/assets/actions" message="${testserver.actions}${line.separator}" />
67
74
  </target>
68
75
 
69
76
 
@@ -1,11 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <classpath>
3
- <classpathentry kind="src" path="src"/>
4
- <classpathentry kind="src" path="gen"/>
5
3
  <classpathentry kind="src" path="assets"/>
6
4
  <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
7
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
5
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
8
6
  <classpathentry kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
9
7
  <classpathentry kind="lib" path="libs/robotium-solo-4.1.jar"/>
8
+ <classpathentry kind="src" path="src"/>
9
+ <classpathentry kind="src" path="gen"/>
10
10
  <classpathentry kind="output" path="bin/classes"/>
11
11
  </classpath>
@@ -2,15 +2,14 @@ package com.jayway.android.robotium.solo;
2
2
 
3
3
  import java.util.List;
4
4
 
5
- import android.app.Activity;
6
5
  import android.app.Instrumentation;
7
6
 
8
7
  public class SoloEnhanced extends Solo {
9
8
  // private Pincher pincher;
10
9
  private MapViewUtils mapViewUtils;
11
10
 
12
- public SoloEnhanced(Instrumentation instrumentation, Activity activity) {
13
- super(instrumentation, activity);
11
+ public SoloEnhanced(Instrumentation instrumentation) {
12
+ super(instrumentation);
14
13
  this.mapViewUtils = new MapViewUtils(instrumentation, viewFetcher, sleeper, waiter);
15
14
  // this.pincher = new Pincher(instrumentation, viewFetcher);
16
15
  }
@@ -3,6 +3,7 @@ package sh.calaba.instrumentationbackend;
3
3
  import java.lang.reflect.Method;
4
4
 
5
5
  import sh.calaba.instrumentationbackend.actions.HttpServer;
6
+ import android.app.Activity;
6
7
  import android.content.Context;
7
8
  import android.os.Bundle;
8
9
  import android.test.InstrumentationTestRunner;
@@ -27,7 +28,7 @@ public class CalabashInstrumentationTestRunner extends InstrumentationTestRunner
27
28
  InstrumentationBackend.extras = arguments;
28
29
 
29
30
  try {
30
- InstrumentationBackend.mainActivity = Class.forName(arguments.getString("main_activity"));
31
+ InstrumentationBackend.mainActivity = Class.forName(arguments.getString("main_activity")).asSubclass(Activity.class);
31
32
  } catch (ClassNotFoundException e) {
32
33
  throw new RuntimeException(e);
33
34
  }
@@ -16,9 +16,9 @@ import android.util.Log;
16
16
  import com.jayway.android.robotium.solo.PublicViewFetcher;
17
17
  import com.jayway.android.robotium.solo.SoloEnhanced;
18
18
 
19
- public class InstrumentationBackend extends ActivityInstrumentationTestCase2 {
19
+ public class InstrumentationBackend extends ActivityInstrumentationTestCase2<Activity> {
20
20
  public static String testPackage;
21
- public static Class mainActivity;
21
+ public static Class<? extends Activity> mainActivity;
22
22
  public static Bundle extras;
23
23
 
24
24
  private static final String TAG = "InstrumentationBackend";
@@ -28,8 +28,9 @@ public class InstrumentationBackend extends ActivityInstrumentationTestCase2 {
28
28
  public static PublicViewFetcher viewFetcher;
29
29
  public static Actions actions;
30
30
 
31
+ @SuppressWarnings({ "deprecation", "unchecked" })
31
32
  public InstrumentationBackend() {
32
- super(testPackage, mainActivity);
33
+ super(testPackage, (Class<Activity>) mainActivity);
33
34
  }
34
35
 
35
36
  @Override
@@ -39,7 +40,7 @@ public class InstrumentationBackend extends ActivityInstrumentationTestCase2 {
39
40
  i.setClassName(testPackage, mainActivity.getName());
40
41
  i.putExtras(extras);
41
42
  setActivityIntent(i);
42
- solo = new SoloEnhanced(getInstrumentation(), this.getActivity());
43
+ solo = new SoloEnhanced(getInstrumentation());
43
44
  viewFetcher = new PublicViewFetcher(getInstrumentation(), this.getActivity());
44
45
  actions = new Actions(getInstrumentation(), this);
45
46
  instrumentation = getInstrumentation();
@@ -1,6 +1,7 @@
1
1
  package sh.calaba.instrumentationbackend.actions;
2
2
 
3
- import java.util.Enumeration;
3
+ import java.io.BufferedReader;
4
+ import java.io.InputStreamReader;
4
5
  import java.util.HashMap;
5
6
  import java.util.Map;
6
7
 
@@ -12,7 +13,6 @@ import android.content.pm.InstrumentationInfo;
12
13
  import android.content.pm.PackageManager;
13
14
  import android.content.pm.PackageManager.NameNotFoundException;
14
15
  import android.test.InstrumentationTestCase;
15
- import dalvik.system.DexFile;
16
16
 
17
17
  public class Actions {
18
18
 
@@ -20,8 +20,8 @@ public class Actions {
20
20
  public static Instrumentation parentInstrumentation;
21
21
  public static InstrumentationTestCase parentTestCase;
22
22
  private Context context;
23
- private Context targetContext;
24
-
23
+ private Context targetContext;
24
+
25
25
  public Actions(Instrumentation parentInstrumentation, InstrumentationTestCase parentTestCase) {
26
26
  Actions.parentInstrumentation = parentInstrumentation;
27
27
  Actions.parentTestCase = parentTestCase;
@@ -32,18 +32,16 @@ public class Actions {
32
32
 
33
33
  private void loadActions() {
34
34
  try {
35
- DexFile dexFile = new DexFile(getApkLocation());
36
- Enumeration<String> entries = dexFile.entries();
37
- while (entries.hasMoreElements()) {
38
- String element = entries.nextElement();
39
- // Only look at classes from the actions package (and sub
40
- // packages)
41
- if (element.startsWith("sh.calaba.instrumentationbackend.actions.")) {
42
- addAction(element);
35
+ BufferedReader reader = new BufferedReader(new InputStreamReader(context.getAssets().open("actions")));
36
+ try {
37
+ for (String line = reader.readLine(); line != null; line = reader.readLine()) {
38
+ String name = line.trim();
39
+ if (name.length() > 0) addAction(name);
43
40
  }
41
+ } finally {
42
+ reader.close();
44
43
  }
45
- dexFile.close();
46
- } catch (Exception e) {
44
+ } catch (Exception e) {
47
45
  throw new RuntimeException(e);
48
46
  }
49
47
  }
@@ -84,29 +82,6 @@ public class Actions {
84
82
  return action;
85
83
  }
86
84
 
87
- private String getApkLocation() {
88
- PackageManager pm = context.getPackageManager();
89
- InstrumentationInfo info = null;
90
- try {
91
- info = pm.getInstrumentationInfo(new ComponentName(context, parentInstrumentation.getClass()), 0);
92
- } catch (NameNotFoundException e) {
93
- e.printStackTrace();
94
- }
95
- return info != null ? info.sourceDir : null;
96
- }
97
-
98
- private String getTargetApkLocation() {
99
- PackageManager pm = targetContext.getPackageManager();
100
- InstrumentationInfo info = null;
101
- try {
102
- info = pm.getInstrumentationInfo(new ComponentName(targetContext, parentInstrumentation.getClass()), 0);
103
- } catch (NameNotFoundException e) {
104
- e.printStackTrace();
105
- }
106
- return info != null ? info.sourceDir : null;
107
- }
108
-
109
-
110
85
  public Map<String, Action> getActions() {
111
86
  return actions;
112
87
  }
@@ -10,7 +10,7 @@ public class PressListItems implements Action {
10
10
 
11
11
  @Override
12
12
  public Result execute(String... args) {
13
- InstrumentationBackend.solo.clickInList(Integer.parseInt(args[0]) - 1, Integer.parseInt(args[1]));
13
+ InstrumentationBackend.solo.clickInList(Integer.parseInt(args[0]), Integer.parseInt(args[1]));
14
14
  return Result.successResult();
15
15
  }
16
16
 
@@ -1,10 +1,13 @@
1
1
  package sh.calaba.instrumentationbackend.actions.search;
2
2
 
3
+ import android.annotation.TargetApi;
4
+ import android.os.Build;
3
5
  import android.widget.SearchView;
4
6
  import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
7
  import sh.calaba.instrumentationbackend.Result;
6
8
  import sh.calaba.instrumentationbackend.actions.Action;
7
9
 
10
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
8
11
  public class EnterQueryByIndex implements Action {
9
12
  @Override
10
13
  public Result execute(String... args) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-android
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7.pre7
4
+ version: 0.4.7.pre8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Maturana Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-25 00:00:00.000000000 Z
11
+ date: 2013-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -861,4 +861,3 @@ signing_key:
861
861
  specification_version: 4
862
862
  summary: Client for calabash-android for automated functional testing on Android
863
863
  test_files: []
864
- has_rdoc: