torquespec 0.1.4 → 0.1.5
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/apps/node-info.war +0 -0
- data/lib/torquespec/as7.rb +18 -23
- data/lib/torquespec/server.rb +0 -5
- data/lib/torquespec/version.rb +1 -1
- data/spec/hello_world_spec.rb +11 -0
- metadata +4 -3
data/apps/node-info.war
ADDED
Binary file
|
data/lib/torquespec/as7.rb
CHANGED
@@ -20,26 +20,25 @@ module TorqueSpec
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def _deploy(path)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
once = true
|
24
|
+
begin
|
25
|
+
domain_api( :operation => "add",
|
26
|
+
:address => [ "deployment", addressify(path) ],
|
27
|
+
:url => urlify(path) )
|
28
|
+
rescue Exception
|
29
|
+
_undeploy(path)
|
30
|
+
if once
|
31
|
+
once = false
|
32
|
+
retry
|
33
|
+
end
|
33
34
|
end
|
35
|
+
domain_api( :operation => "deploy",
|
36
|
+
:address => [ "deployment", addressify(path) ] )
|
34
37
|
end
|
35
38
|
|
36
39
|
def _undeploy(path)
|
37
|
-
|
38
|
-
|
39
|
-
else
|
40
|
-
domain_api( :operation => "remove",
|
41
|
-
:address => [ "deployment", urlify(path) ] )
|
42
|
-
end
|
40
|
+
domain_api( :operation => "remove",
|
41
|
+
:address => [ "deployment", addressify(path) ] )
|
43
42
|
end
|
44
43
|
|
45
44
|
def ready?
|
@@ -50,10 +49,6 @@ module TorqueSpec
|
|
50
49
|
false
|
51
50
|
end
|
52
51
|
|
53
|
-
def cleanup
|
54
|
-
deployments.keys.each { |k| domain_api( deployments.delete(k) ) }
|
55
|
-
end
|
56
|
-
|
57
52
|
private
|
58
53
|
|
59
54
|
def domain_api(params)
|
@@ -63,9 +58,9 @@ module TorqueSpec
|
|
63
58
|
def urlify(path)
|
64
59
|
URI.parse(path).scheme.nil? ? "file:#{path}" : path
|
65
60
|
end
|
66
|
-
|
67
|
-
def
|
68
|
-
|
61
|
+
|
62
|
+
def addressify(path)
|
63
|
+
File.basename(path)
|
69
64
|
end
|
70
65
|
end
|
71
66
|
end
|
data/lib/torquespec/server.rb
CHANGED
@@ -26,7 +26,6 @@ module TorqueSpec
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def stop
|
29
|
-
cleanup
|
30
29
|
return if stopped
|
31
30
|
self.stopped = true
|
32
31
|
if TorqueSpec.lazy
|
@@ -62,10 +61,6 @@ module TorqueSpec
|
|
62
61
|
raise "JBoss failed to start"
|
63
62
|
end
|
64
63
|
|
65
|
-
def cleanup
|
66
|
-
# modules may mixin if needed
|
67
|
-
end
|
68
|
-
|
69
64
|
protected
|
70
65
|
|
71
66
|
def startup(opts)
|
data/lib/torquespec/version.rb
CHANGED
data/spec/hello_world_spec.rb
CHANGED
@@ -25,3 +25,14 @@ describe "simple directory deployment" do
|
|
25
25
|
response.strip.should == "Hello World!"
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
describe "war deployment" do
|
30
|
+
|
31
|
+
deploy File.join( File.dirname(__FILE__), "../apps/node-info.war" )
|
32
|
+
|
33
|
+
it "should greet the world" do
|
34
|
+
response = open("http://localhost:8080/node-info") {|f| f.read}
|
35
|
+
response.should include( 'JBoss-Cloud node info' )
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torquespec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jim Crossley
|
@@ -60,6 +60,7 @@ files:
|
|
60
60
|
- Gemfile
|
61
61
|
- README.md
|
62
62
|
- Rakefile
|
63
|
+
- apps/node-info.war
|
63
64
|
- apps/simple.knob
|
64
65
|
- apps/simple/config.ru
|
65
66
|
- lib/torquespec.rb
|