iudex-async-httpclient 1.4.0-java → 1.7.0-java

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 353e2e37237f5b5e1b10e8bb260be854ec3d24be
4
+ data.tar.gz: 288474a61ebe676dfce48c0511073a0109657083
5
+ SHA512:
6
+ metadata.gz: f400389cd76648f4a8c6a8f4170eab69dadc1667700deaef04c72d32b479f708f0973f1b931de79157f9665d77c28bc1c87947ea06987ec4c90d34fbbc2fa17a
7
+ data.tar.gz: 3c2423f2d7003ea61df1239e32542215bd07b3202c4648fcce41f681b87bcfac5250a827633e44ec50018349db8136b2752c57ef17a1567a1f283b9acd3a527d
@@ -1,3 +1,8 @@
1
+ === 1.7.0 (2015-5-3)
2
+ * Upgrade to iudex-* ~> 1.7 dependencies
3
+ * Upgrade to async-httpclient ~> 1.8.5 (tested through 1.8.15)
4
+ * Add POST method and request content support.
5
+
1
6
  === 1.4.0 (2013-10-29)
2
7
  * Upgrade to async-httpclient ~> 1.7.11
3
8
  * Upgrade to iudex-* ~> 1.4.0 dependencies
@@ -7,4 +7,4 @@ lib/iudex-async-httpclient/base.rb
7
7
  lib/iudex-async-httpclient.rb
8
8
  test/setup.rb
9
9
  test/test_httpclient.rb
10
- lib/iudex-async-httpclient/iudex-async-httpclient-1.4.0.jar
10
+ lib/iudex-async-httpclient/iudex-async-httpclient-1.7.0.jar
@@ -11,7 +11,7 @@ of the iudex-http interfaces.
11
11
 
12
12
  == License
13
13
 
14
- Copyright (c) 2008-2013 David Kellum
14
+ Copyright (c) 2008-2015 David Kellum
15
15
 
16
16
  Licensed under the Apache License, Version 2.0 (the "License"); you
17
17
  may not use this file except in compliance with the License. You
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2013 David Kellum
2
+ # Copyright (c) 2008-2015 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2013 David Kellum
2
+ # Copyright (c) 2008-2015 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You
@@ -16,7 +16,7 @@
16
16
 
17
17
  module Iudex
18
18
  module AsyncHTTPClient
19
- VERSION = '1.4.0'
19
+ VERSION = '1.7.0'
20
20
 
21
21
  LIB_DIR = File.dirname( __FILE__ ) # :nodoc:
22
22
  end
data/pom.xml CHANGED
@@ -5,13 +5,13 @@
5
5
  <groupId>iudex</groupId>
6
6
  <artifactId>iudex-async-httpclient</artifactId>
7
7
  <packaging>jar</packaging>
8
- <version>1.4.0</version>
8
+ <version>1.7.0</version>
9
9
  <name>Iudex Async HTTP Client Adaptor</name>
10
10
 
11
11
  <parent>
12
12
  <groupId>iudex</groupId>
13
13
  <artifactId>iudex-parent</artifactId>
14
- <version>1.4.0</version>
14
+ <version>1.7.0</version>
15
15
  <relativePath>..</relativePath>
16
16
  </parent>
17
17
 
@@ -20,13 +20,13 @@
20
20
  <dependency>
21
21
  <groupId>iudex</groupId>
22
22
  <artifactId>iudex-http</artifactId>
23
- <version>[1.4.0,1.4.999)</version>
23
+ <version>[1.7.0,1.999)</version>
24
24
  </dependency>
25
25
 
26
26
  <dependency>
27
27
  <groupId>com.ning</groupId>
28
28
  <artifactId>async-http-client</artifactId>
29
- <version>[1.7.11,1.7.9999]</version>
29
+ <version>[1.8.5,1.8.9999)</version>
30
30
  </dependency>
31
31
 
32
32
  </dependencies>
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2013 David Kellum
2
+ # Copyright (c) 2008-2015 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2008-2013 David Kellum
5
+ # Copyright (c) 2008-2015 David Kellum
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
8
8
  # may not use this file except in compliance with the License. You
@@ -23,7 +23,6 @@ require 'iudex-http-test/helper'
23
23
  require 'iudex-http-test/broken_server'
24
24
 
25
25
  require 'iudex-async-httpclient'
26
- require 'thread'
27
26
 
28
27
  class TestHTTPClient < MiniTest::Unit::TestCase
29
28
  include Iudex
@@ -54,7 +53,7 @@ class TestHTTPClient < MiniTest::Unit::TestCase
54
53
 
55
54
  def test_custom_executor
56
55
 
57
- executor = ThreadPoolExecutor.new( 1, 10,
56
+ executor = ThreadPoolExecutor.new( 8, 8,
58
57
  10, TimeUnit::SECONDS,
59
58
  ArrayBlockingQueue.new( 20 ) )
60
59
 
@@ -244,9 +243,7 @@ class TestHTTPClient < MiniTest::Unit::TestCase
244
243
  bs = BrokenServer.new
245
244
  bs.start
246
245
 
247
- sthread = Thread.new do
248
- bs.accept { |sock| sock.write "FU Stinky\r\n" }
249
- end
246
+ sthread = bs.accept_thread { |sock| sock.write "FU Stinky\r\n" }
250
247
 
251
248
  #FIXME: IllegalArgumentException on bad HTTP response line?
252
249
  with_new_client do |client|
@@ -265,9 +262,7 @@ class TestHTTPClient < MiniTest::Unit::TestCase
265
262
  bs = BrokenServer.new
266
263
  bs.start
267
264
 
268
- sthread = Thread.new do
269
- bs.accept { |sock| sock.close }
270
- end
265
+ sthread = bs.accept_thread { |sock| sock.close }
271
266
 
272
267
  with_new_client( :connection_timeout_in_ms => 100,
273
268
  :request_timeout_in_ms => 100 ) do |client|
@@ -347,13 +342,31 @@ class TestHTTPClient < MiniTest::Unit::TestCase
347
342
  end
348
343
  end
349
344
 
350
- def with_session_handler( client, uri, wait = true, headers = {}, &block )
345
+ def test_post
346
+ with_new_client do |client|
347
+ smod = Proc.new do |s|
348
+ s.method = HTTPSession::Method::POST
349
+ s.requestContent =
350
+ RequestContent.new( "a=1+2&b=3".to_java_bytes,
351
+ "application/x-www-form-urlencoded" )
352
+ end
353
+ with_session_handler( client, "/post_to", true, {}, smod ) do |s,x|
354
+ output_bomb( s ) unless s.status_code == 200
355
+ assert_equal( 200, s.status_code, "see bomb.out" )
356
+ assert_equal( %Q[{"a"=>"1 2", "b"=>"3"}], s.response_stream.to_io.read )
357
+ end
358
+ end
359
+ end
360
+
361
+ def with_session_handler( client, uri, wait = true,
362
+ headers = {}, smod = nil, &block )
351
363
  session = client.create_session
352
364
  uri = "http://localhost:#{server.port}#{uri}" unless uri =~ /^http:/
353
365
  session.url = uri
354
366
  headers.each do |k,v|
355
367
  session.add_request_header( Java::iudex.http.Header.new( k, v ) )
356
368
  end
369
+ smod.call( session ) if smod
357
370
  handler = TestHandler.new( &block )
358
371
  client.request( session, handler )
359
372
  if wait
metadata CHANGED
@@ -1,128 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iudex-async-httpclient
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.4.0
4
+ version: 1.7.0
6
5
  platform: java
7
6
  authors:
8
7
  - David Kellum
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-30 00:00:00.000000000 Z
11
+ date: 2015-05-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: iudex-http
16
- version_requirements: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ~>
19
- - !ruby/object:Gem::Version
20
- version: 1.4.0
21
- none: false
22
14
  requirement: !ruby/object:Gem::Requirement
23
15
  requirements:
24
16
  - - ~>
25
17
  - !ruby/object:Gem::Version
26
- version: 1.4.0
27
- none: false
18
+ version: '1.7'
19
+ name: iudex-http
28
20
  prerelease: false
29
21
  type: :runtime
30
- - !ruby/object:Gem::Dependency
31
- name: rjack-async-httpclient
32
22
  version_requirements: !ruby/object:Gem::Requirement
33
23
  requirements:
34
24
  - - ~>
35
25
  - !ruby/object:Gem::Version
36
- version: 1.7.11
37
- none: false
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
38
28
  requirement: !ruby/object:Gem::Requirement
39
29
  requirements:
40
30
  - - ~>
41
31
  - !ruby/object:Gem::Version
42
- version: 1.7.11
43
- none: false
32
+ version: 1.8.5
33
+ name: rjack-async-httpclient
44
34
  prerelease: false
45
35
  type: :runtime
46
- - !ruby/object:Gem::Dependency
47
- name: hooker
48
36
  version_requirements: !ruby/object:Gem::Requirement
49
37
  requirements:
50
38
  - - ~>
51
39
  - !ruby/object:Gem::Version
52
- version: 1.0.0
53
- none: false
40
+ version: 1.8.5
41
+ - !ruby/object:Gem::Dependency
54
42
  requirement: !ruby/object:Gem::Requirement
55
43
  requirements:
56
44
  - - ~>
57
45
  - !ruby/object:Gem::Version
58
46
  version: 1.0.0
59
- none: false
47
+ name: hooker
60
48
  prerelease: false
61
49
  type: :runtime
62
- - !ruby/object:Gem::Dependency
63
- name: minitest
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - ~>
67
53
  - !ruby/object:Gem::Version
68
- version: 4.7.4
69
- none: false
54
+ version: 1.0.0
55
+ - !ruby/object:Gem::Dependency
70
56
  requirement: !ruby/object:Gem::Requirement
71
57
  requirements:
72
58
  - - ~>
73
59
  - !ruby/object:Gem::Version
74
60
  version: 4.7.4
75
- none: false
61
+ name: minitest
76
62
  prerelease: false
77
63
  type: :development
78
- - !ruby/object:Gem::Dependency
79
- name: iudex-http-test
80
64
  version_requirements: !ruby/object:Gem::Requirement
81
65
  requirements:
82
66
  - - ~>
83
67
  - !ruby/object:Gem::Version
84
- version: 1.4.0
85
- none: false
68
+ version: 4.7.4
69
+ - !ruby/object:Gem::Dependency
86
70
  requirement: !ruby/object:Gem::Requirement
87
71
  requirements:
88
72
  - - ~>
89
73
  - !ruby/object:Gem::Version
90
- version: 1.4.0
91
- none: false
74
+ version: '1.7'
75
+ name: iudex-http-test
92
76
  prerelease: false
93
77
  type: :development
94
- - !ruby/object:Gem::Dependency
95
- name: rjack-logback
96
78
  version_requirements: !ruby/object:Gem::Requirement
97
79
  requirements:
98
80
  - - ~>
99
81
  - !ruby/object:Gem::Version
100
- version: '1.5'
101
- none: false
82
+ version: '1.7'
83
+ - !ruby/object:Gem::Dependency
102
84
  requirement: !ruby/object:Gem::Requirement
103
85
  requirements:
104
86
  - - ~>
105
87
  - !ruby/object:Gem::Version
106
88
  version: '1.5'
107
- none: false
89
+ name: rjack-logback
108
90
  prerelease: false
109
91
  type: :development
110
- - !ruby/object:Gem::Dependency
111
- name: rjack-tarpit
112
92
  version_requirements: !ruby/object:Gem::Requirement
113
93
  requirements:
114
94
  - - ~>
115
95
  - !ruby/object:Gem::Version
116
- version: '2.0'
117
- none: false
96
+ version: '1.5'
97
+ - !ruby/object:Gem::Dependency
118
98
  requirement: !ruby/object:Gem::Requirement
119
99
  requirements:
120
100
  - - ~>
121
101
  - !ruby/object:Gem::Version
122
- version: '2.0'
123
- none: false
102
+ version: '2.1'
103
+ name: rjack-tarpit
124
104
  prerelease: false
125
105
  type: :development
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '2.1'
126
111
  description: Iudex is a general purpose web crawler and feed processor in ruby/java. This gem is an rjack-async-httpclient based implementation of the iudex-http interfaces.
127
112
  email:
128
113
  - dek-oss@gravitext.com
@@ -136,14 +121,16 @@ files:
136
121
  - Manifest.txt
137
122
  - README.rdoc
138
123
  - Rakefile
139
- - pom.xml
140
- - lib/iudex-async-httpclient/base.rb
141
124
  - lib/iudex-async-httpclient.rb
125
+ - lib/iudex-async-httpclient/base.rb
126
+ - lib/iudex-async-httpclient/iudex-async-httpclient-1.7.0.jar
127
+ - pom.xml
142
128
  - test/setup.rb
143
129
  - test/test_httpclient.rb
144
- - lib/iudex-async-httpclient/iudex-async-httpclient-1.4.0.jar
145
130
  homepage: http://iudex.gravitext.com
146
- licenses: []
131
+ licenses:
132
+ - Apache-2.0
133
+ metadata: {}
147
134
  post_install_message:
148
135
  rdoc_options:
149
136
  - --main
@@ -152,27 +139,18 @@ require_paths:
152
139
  - lib
153
140
  required_ruby_version: !ruby/object:Gem::Requirement
154
141
  requirements:
155
- - - ! '>='
142
+ - - '>='
156
143
  - !ruby/object:Gem::Version
157
- version: '0'
158
- segments:
159
- - 0
160
- hash: 2
161
- none: false
144
+ version: 1.8.7
162
145
  required_rubygems_version: !ruby/object:Gem::Requirement
163
146
  requirements:
164
- - - ! '>='
147
+ - - '>='
165
148
  - !ruby/object:Gem::Version
166
149
  version: '0'
167
- segments:
168
- - 0
169
- hash: 2
170
- none: false
171
150
  requirements: []
172
151
  rubyforge_project:
173
- rubygems_version: 1.8.24
152
+ rubygems_version: 2.4.5
174
153
  signing_key:
175
- specification_version: 3
154
+ specification_version: 4
176
155
  summary: Iudex is a general purpose web crawler and feed processor in ruby/java.
177
156
  test_files: []
178
- ...