simplews 1.0.2 → 1.1.0
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.
- data/History.txt +5 -0
- data/lib/simplews/version.rb +2 -2
- data/lib/simplews.rb +1 -0
- data/test/simplews/test_asynchronous.rb +68 -0
- data/test/test_helper.rb +1 -0
- metadata +3 -2
data/History.txt
CHANGED
data/lib/simplews/version.rb
CHANGED
data/lib/simplews.rb
CHANGED
@@ -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
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
|
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-
|
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
|