simplews 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.1.0 2008-10-28
2
+
3
+ * 1 major enhancement:
4
+ * Web Service with asynchronous jobs
5
+
1
6
  == 1.0.2 2008-10-28
2
7
 
3
8
  * 1 bug fix:
@@ -1,8 +1,8 @@
1
1
  module Simplews
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
- MINOR = 0
5
- TINY = 2
4
+ MINOR = 1
5
+ TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  self
data/lib/simplews.rb CHANGED
@@ -163,6 +163,7 @@ ${BINDINGS}
163
163
  EOT
164
164
 
165
165
  @@type2wsdl = {
166
+ :boolean => 'xsd:boolean',
166
167
  :string => 'xsd:string',
167
168
  :integer => 'xsd:integer',
168
169
  :array => 'tns:ArrayOfString',
@@ -0,0 +1,68 @@
1
+ require File.dirname(File.dirname(__FILE__)) + '/test_helper.rb'
2
+
3
+ class TestSimpleWS < Test::Unit::TestCase
4
+
5
+ class TestAWS < SimpleWS::Asynchronous
6
+
7
+ def process(name)
8
+ name = Job.start(name) do
9
+ step(:init)
10
+ sleep 2
11
+ step(:step1, "Step1")
12
+ sleep 2
13
+ step(:step2, "Step2")
14
+ sleep 2
15
+ step(:step2, "Step3")
16
+ end
17
+
18
+ name
19
+ end
20
+
21
+ def initialize(*args)
22
+ super(*args)
23
+ serve :process, %w(name), :name => :string, :return => :string
24
+
25
+ end
26
+ end
27
+
28
+
29
+ def setup
30
+ server = TestAWS.new("TestAWS", "Asynchronous Job Server", 'localhost', '1984')
31
+
32
+ Thread.new do
33
+ server.start
34
+ end
35
+
36
+ end
37
+
38
+ def test_client
39
+
40
+ require 'soap/wsdlDriver'
41
+
42
+ driver = SimpleWS.get_driver('http://localhost:1984', 'TestAWS')
43
+
44
+ name = driver.process("test-AWS")
45
+
46
+
47
+ puts "Job name #{ name }"
48
+
49
+ while !driver.done(name)
50
+ puts "status: " + driver.status(name)
51
+ sleep 1
52
+ end
53
+
54
+ assert(!driver.error(name))
55
+ assert(driver.messages(name).include? "Step3")
56
+
57
+
58
+ name = driver.process("test-AWS")
59
+ sleep 2
60
+ puts "status: " + driver.status(name)
61
+ driver.abort(name)
62
+ sleep 2
63
+ assert(!driver.aborted(name))
64
+ end
65
+
66
+
67
+
68
+ end
data/test/test_helper.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  require 'test/unit'
2
2
  require File.dirname(__FILE__) + '/../lib/simplews'
3
+ require File.dirname(__FILE__) + '/../lib/simplews/asynchronous'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplews
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-28 00:00:00 +01:00
12
+ date: 2008-11-07 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -96,3 +96,4 @@ summary: Simplifies the development of Web Services, producing WSDL automaticall
96
96
  test_files:
97
97
  - test/test_simplews.rb
98
98
  - test/test_helper.rb
99
+ - test/simplews/test_asynchronous.rb