t2-server 0.6.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/.rvmrc +1 -0
  2. data/CHANGES.rdoc +48 -0
  3. data/LICENCE.rdoc +2 -2
  4. data/README.rdoc +245 -10
  5. data/Rakefile +108 -0
  6. data/bin/t2-delete-runs +21 -34
  7. data/bin/t2-get-output +134 -0
  8. data/bin/t2-run-workflow +121 -109
  9. data/bin/t2-server-admin +128 -0
  10. data/bin/t2-server-info +25 -38
  11. data/lib/t2-server-cli.rb +116 -0
  12. data/lib/t2-server.rb +16 -27
  13. data/lib/t2-server/admin.rb +147 -0
  14. data/lib/t2-server/connection-parameters.rb +144 -0
  15. data/lib/t2-server/connection.rb +352 -0
  16. data/lib/t2-server/credentials.rb +84 -0
  17. data/lib/t2-server/exceptions.rb +42 -21
  18. data/lib/t2-server/port.rb +472 -0
  19. data/lib/t2-server/run.rb +822 -227
  20. data/lib/t2-server/server.rb +313 -317
  21. data/lib/t2-server/util.rb +71 -0
  22. data/lib/t2-server/xml/libxml.rb +87 -0
  23. data/lib/t2-server/xml/nokogiri.rb +85 -0
  24. data/lib/t2-server/xml/rexml.rb +85 -0
  25. data/lib/t2-server/xml/xml.rb +111 -0
  26. data/lib/t2server.rb +4 -1
  27. data/t2-server.gemspec +112 -0
  28. data/test/tc_admin.rb +63 -0
  29. data/test/{tc_paths.rb → tc_params.rb} +11 -25
  30. data/test/tc_perms.rb +132 -0
  31. data/test/tc_run.rb +200 -67
  32. data/test/tc_secure.rb +191 -0
  33. data/test/tc_server.rb +25 -23
  34. data/test/tc_util.rb +74 -0
  35. data/test/ts_t2server.rb +57 -12
  36. data/test/workflows/always_fail.t2flow +69 -0
  37. data/test/workflows/list_and_value.t2flow +12 -0
  38. data/test/workflows/list_with_errors.t2flow +107 -0
  39. data/test/workflows/secure/basic-http.t2flow +74 -0
  40. data/test/workflows/secure/basic-https.t2flow +74 -0
  41. data/test/workflows/secure/client-https.t2flow +162 -0
  42. data/test/workflows/secure/digest-http.t2flow +129 -0
  43. data/test/workflows/secure/digest-https.t2flow +107 -0
  44. data/test/workflows/secure/heater-pk.pem +20 -0
  45. data/test/workflows/secure/user-cert.p12 +0 -0
  46. data/test/workflows/secure/ws-http.t2flow +180 -0
  47. data/test/workflows/secure/ws-https.t2flow +180 -0
  48. data/test/workflows/strings.txt +10 -0
  49. data/test/workflows/xml_xpath.t2flow +136 -136
  50. data/version.yml +4 -0
  51. metadata +132 -34
  52. data/lib/t2-server/xml.rb +0 -86
data/lib/t2-server/xml.rb DELETED
@@ -1,86 +0,0 @@
1
- # Copyright (c) 2010, 2011 The University of Manchester, UK.
2
- #
3
- # All rights reserved.
4
- #
5
- # Redistribution and use in source and binary forms, with or without
6
- # modification, are permitted provided that the following conditions are met:
7
- #
8
- # * Redistributions of source code must retain the above copyright notice,
9
- # this list of conditions and the following disclaimer.
10
- #
11
- # * Redistributions in binary form must reproduce the above copyright notice,
12
- # this list of conditions and the following disclaimer in the documentation
13
- # and/or other materials provided with the distribution.
14
- #
15
- # * Neither the names of The University of Manchester nor the names of its
16
- # contributors may be used to endorse or promote products derived from this
17
- # software without specific prior written permission.
18
- #
19
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23
- # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
- # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
- # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
- # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
- # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
- # POSSIBILITY OF SUCH DAMAGE.
30
- #
31
- # Author: Robert Haines
32
-
33
- require 'rubygems'
34
- require 'libxml'
35
-
36
- module T2Server
37
- # :stopdoc:
38
- module Namespaces
39
- SERVER = "http://ns.taverna.org.uk/2010/xml/server/"
40
- REST = SERVER + "rest/"
41
- MAP = {
42
- "nss" => Namespaces::SERVER,
43
- "nsr" => Namespaces::REST
44
- }
45
- end
46
-
47
- module Fragments
48
- WORKFLOW = "<t2s:workflow xmlns:t2s=\"#{Namespaces::SERVER}\">\n %s\n</t2s:workflow>"
49
- RUNINPUT = "<t2sr:runInput xmlns:t2sr=\"#{Namespaces::REST}\">\n %s\n</t2sr:runInput>"
50
- RUNINPUTVALUE = RUNINPUT % "<t2sr:value>%s</t2sr:value>"
51
- RUNINPUTFILE = RUNINPUT % "<t2sr:file>%s</t2sr:file>"
52
- UPLOAD = "<t2sr:upload xmlns:t2sr=\"#{Namespaces::REST}\" t2sr:name=\"%s\">\n %s\n</t2sr:upload>"
53
- MKDIR = "<t2sr:mkdir xmlns:t2sr=\"#{Namespaces::REST}\" t2sr:name=\"%s\" />"
54
- end
55
-
56
- module XPaths
57
- include LibXML
58
-
59
- # Shut the libxml error handler up
60
- XML::Error.set_handler(&XML::Error::QUIET_HANDLER)
61
-
62
- # Server XPath queries
63
- RUN = XML::XPath::Expression.new("//nsr:run")
64
- RUNS = XML::XPath::Expression.new("//nsr:runs")
65
- RUNLIMIT = XML::XPath::Expression.new("//nsr:runLimit")
66
- PERMWKF = XML::XPath::Expression.new("//nsr:permittedWorkflows")
67
- PERMLSTN = XML::XPath::Expression.new("//nsr:permittedListeners")
68
-
69
- # Run XPath queries
70
- DIR = XML::XPath::Expression.new("//nss:dir")
71
- FILE = XML::XPath::Expression.new("//nss:file")
72
- EXPIRY = XML::XPath::Expression.new("//nsr:expiry")
73
- WORKFLOW = XML::XPath::Expression.new("//nsr:creationWorkflow")
74
- STATUS = XML::XPath::Expression.new("//nsr:status")
75
- CREATETIME = XML::XPath::Expression.new("//nsr:createTime")
76
- STARTTIME = XML::XPath::Expression.new("//nsr:startTime")
77
- FINISHTIME = XML::XPath::Expression.new("//nsr:finishTime")
78
- WDIR = XML::XPath::Expression.new("//nsr:workingDirectory")
79
- INPUTS = XML::XPath::Expression.new("//nsr:inputs")
80
- OUTPUT = XML::XPath::Expression.new("//nsr:output")
81
- SECURECTX = XML::XPath::Expression.new("//nsr:securityContext")
82
- LISTENERS = XML::XPath::Expression.new("//nsr:listeners")
83
- BACLAVA = XML::XPath::Expression.new("//nsr:baclava")
84
- end
85
- # :startdoc:
86
- end