calabash-android 0.2.12 → 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ 0.2.13:
2
+ Now using application/json content type for communication with test server.
3
+
1
4
  0.2.12:
2
5
  Various small improvements and bug fixes.
3
6
 
@@ -182,9 +182,7 @@ module Operations
182
182
  retries = 0
183
183
  begin
184
184
  http = Net::HTTP.new "127.0.0.1", @server_port
185
- cmd = "command=#{data.to_json}"
186
- cmd = cmd.gsub("+", "%2B")
187
- resp = http.post(path, cmd, {})
185
+ resp = http.post(path, "#{data.to_json}", {"Content-Type" => "application/json;charset=utf-8"})
188
186
  resp.body
189
187
  rescue Exception => e
190
188
  raise e if retries > 20
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Android
3
- VERSION = "0.2.12"
4
- FRAMEWORK_VERSION = "0.2.12"
3
+ VERSION = "0.2.13"
4
+ FRAMEWORK_VERSION = "0.2.13"
5
5
  end
6
6
  end
@@ -93,7 +93,12 @@ public class HttpServer extends NanoHTTPD {
93
93
  return new NanoHTTPD.Response( HTTP_OK, "image/png", new ByteArrayInputStream(out.toByteArray()));
94
94
  }
95
95
 
96
- String commandString = params.getProperty("command");
96
+ System.out.println("header: "+ header);
97
+ System.out.println("params: "+ params);
98
+ System.out.println("files: "+ files);
99
+
100
+
101
+ String commandString = params.getProperty("json");
97
102
  System.out.println("command: "+ commandString);
98
103
  String result = toJson(runCommand(commandString));
99
104
  System.out.println("result:" + result);
@@ -352,7 +352,7 @@ public class NanoHTTPD
352
352
 
353
353
  // Create a BufferedReader for easily reading it as string.
354
354
  ByteArrayInputStream bin = new ByteArrayInputStream(fbuf);
355
- BufferedReader in = new BufferedReader( new InputStreamReader(bin));
355
+ BufferedReader in = new BufferedReader( new InputStreamReader(bin, "UTF-8"));
356
356
 
357
357
  // If the method is POST, there may be parameters
358
358
  // in data section, too, read it:
@@ -379,6 +379,16 @@ public class NanoHTTPD
379
379
 
380
380
  decodeMultipartData(boundary, fbuf, in, parms, files);
381
381
  }
382
+ else if (contentType.toLowerCase().startsWith("application/json"))
383
+ {
384
+ StringBuffer sb = new StringBuffer();
385
+ String line = null;
386
+ while ((line = in.readLine()) != null)
387
+ {
388
+ sb.append(line + "\n");
389
+ }
390
+ parms.put("json", sb.toString());
391
+ }
382
392
  else
383
393
  {
384
394
  // Handle application/x-www-form-urlencoded
metadata CHANGED
@@ -1,88 +1,89 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: calabash-android
3
- version: !ruby/object:Gem::Version
4
- version: 0.2.12
3
+ version: !ruby/object:Gem::Version
4
+ hash: 13
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 13
10
+ version: 0.2.13
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Jonas Maturana Larsen
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-08-27 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-08-31 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
15
22
  name: cucumber
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: json
32
- requirement: !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
33
25
  none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
38
33
  type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: json
39
37
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: slowhandcuke
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &id002 !ruby/object:Gem::Requirement
49
39
  none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
54
47
  type: :runtime
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: slowhandcuke
55
51
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: retriable
64
- requirement: !ruby/object:Gem::Requirement
52
+ requirement: &id003 !ruby/object:Gem::Requirement
65
53
  none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
70
61
  type: :runtime
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ name: retriable
71
65
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
66
+ requirement: &id004 !ruby/object:Gem::Requirement
73
67
  none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- description: ! 'calabash-android drives tests for native and hybrid Android apps. '
79
- email:
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ type: :runtime
76
+ version_requirements: *id004
77
+ description: "calabash-android drives tests for native and hybrid Android apps. "
78
+ email:
80
79
  - jonas@lesspainful.com
81
- executables:
80
+ executables:
82
81
  - calabash-android
83
82
  extensions: []
83
+
84
84
  extra_rdoc_files: []
85
- files:
85
+
86
+ files:
86
87
  - .calabash_settings
87
88
  - CHANGES.txt
88
89
  - Gemfile
@@ -654,28 +655,39 @@ files:
654
655
  - test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/package-info.java
655
656
  - test-server/calabash-js/src/calabash.js
656
657
  - test-server/calabash-js/src/set_text.js
658
+ has_rdoc: true
657
659
  homepage: http://github.com/calabash
658
660
  licenses: []
661
+
659
662
  post_install_message:
660
663
  rdoc_options: []
661
- require_paths:
664
+
665
+ require_paths:
662
666
  - lib
663
- required_ruby_version: !ruby/object:Gem::Requirement
667
+ required_ruby_version: !ruby/object:Gem::Requirement
664
668
  none: false
665
- requirements:
666
- - - ! '>='
667
- - !ruby/object:Gem::Version
668
- version: '0'
669
- required_rubygems_version: !ruby/object:Gem::Requirement
669
+ requirements:
670
+ - - ">="
671
+ - !ruby/object:Gem::Version
672
+ hash: 3
673
+ segments:
674
+ - 0
675
+ version: "0"
676
+ required_rubygems_version: !ruby/object:Gem::Requirement
670
677
  none: false
671
- requirements:
672
- - - ! '>='
673
- - !ruby/object:Gem::Version
674
- version: '0'
678
+ requirements:
679
+ - - ">="
680
+ - !ruby/object:Gem::Version
681
+ hash: 3
682
+ segments:
683
+ - 0
684
+ version: "0"
675
685
  requirements: []
686
+
676
687
  rubyforge_project:
677
- rubygems_version: 1.8.24
688
+ rubygems_version: 1.6.2
678
689
  signing_key:
679
690
  specification_version: 3
680
691
  summary: Client for calabash-android for automated functional testing on Android
681
692
  test_files: []
693
+