mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1f930a0ad7
commit
cf34b58938
3 changed files with 305 additions and 0 deletions
116
lib/rdoc/generators/template/html/one_page_html.rb
Normal file
116
lib/rdoc/generators/template/html/one_page_html.rb
Normal file
|
@ -0,0 +1,116 @@
|
|||
module RDoc
|
||||
module Page
|
||||
######################################################################
|
||||
#
|
||||
# The following is used for the -1 option
|
||||
#
|
||||
|
||||
CONTENTS_XML = %{
|
||||
IF:description
|
||||
%description%
|
||||
ENDIF:description
|
||||
|
||||
IF:requires
|
||||
<h4>Requires:</h4>
|
||||
<ul>
|
||||
START:requires
|
||||
IF:aref
|
||||
<li><a href="%aref%">%name%</a></li>
|
||||
ENDIF:aref
|
||||
IFNOT:aref
|
||||
<li>%name%</li>
|
||||
ENDIF:aref
|
||||
END:requires
|
||||
</ul>
|
||||
ENDIF:requires
|
||||
|
||||
IF:attributes
|
||||
<h4>Attributes</h4>
|
||||
<table>
|
||||
START:attributes
|
||||
<tr><td>%name%</td><td>%rw%</td><td>%a_desc%</td></tr>
|
||||
END:attributes
|
||||
</table>
|
||||
ENDIF:attributes
|
||||
|
||||
IF:includes
|
||||
<h4>Includes</h4>
|
||||
<ul>
|
||||
START:includes
|
||||
IF:aref
|
||||
<li><a href="%aref%">%name%</a></li>
|
||||
ENDIF:aref
|
||||
IFNOT:aref
|
||||
<li>%name%</li>
|
||||
ENDIF:aref
|
||||
END:includes
|
||||
</ul>
|
||||
ENDIF:includes
|
||||
|
||||
IF:method_list
|
||||
<h3>Methods</h3>
|
||||
START:method_list
|
||||
IF:methods
|
||||
START:methods
|
||||
<h4>%type% %category% method: <a name="%aref%">%name%%params%</a></h4>
|
||||
|
||||
IF:m_desc
|
||||
%m_desc%
|
||||
ENDIF:m_desc
|
||||
|
||||
IF:sourcecode
|
||||
<blockquote><pre>
|
||||
%sourcecode%
|
||||
</pre></blockquote>
|
||||
ENDIF:sourcecode
|
||||
END:methods
|
||||
ENDIF:methods
|
||||
END:method_list
|
||||
ENDIF:method_list
|
||||
}
|
||||
|
||||
########################################################################
|
||||
|
||||
ONE_PAGE = %{
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>%title%</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
||||
</head>
|
||||
<body>
|
||||
START:files
|
||||
<h2>File: %short_name%</h2>
|
||||
<table>
|
||||
<tr><td>Path:</td><td>%full_path%</td></tr>
|
||||
<tr><td>Modified:</td><td>%dtm_modified%</td></tr>
|
||||
</table>
|
||||
} + CONTENTS_XML + %{
|
||||
END:files
|
||||
|
||||
IF:classes
|
||||
<h2>Classes</h2>
|
||||
START:classes
|
||||
IF:parent
|
||||
<h3>%classmod% %full_name% < HREF:par_url:parent:</h3>
|
||||
ENDIF:parent
|
||||
IFNOT:parent
|
||||
<h3>%classmod% %full_name%</h3>
|
||||
ENDIF:parent
|
||||
|
||||
IF:infiles
|
||||
(in files
|
||||
START:infiles
|
||||
HREF:full_path_url:full_path:
|
||||
END:infiles
|
||||
)
|
||||
ENDIF:infiles
|
||||
} + CONTENTS_XML + %{
|
||||
END:classes
|
||||
ENDIF:classes
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
|
||||
end
|
||||
end
|
103
test/wsdl/soap/soapbodyparts.wsdl
Normal file
103
test/wsdl/soap/soapbodyparts.wsdl
Normal file
|
@ -0,0 +1,103 @@
|
|||
<?xml version="1.0"?>
|
||||
<definitions
|
||||
name="soapbodyparts"
|
||||
targetNamespace="urn:www.example.com:soapbodyparts:v1"
|
||||
xmlns:tns="urn:www.example.com:soapbodyparts:v1"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
|
||||
<types>
|
||||
<schema xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:www.example.com:soapbodyparts:v1">
|
||||
<import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
<complexType name="StringArray">
|
||||
<complexContent>
|
||||
<restriction base="soapenc:Array">
|
||||
<attribute ref="soapenc:arrayType" wsdl:arrayType="string[]"/>
|
||||
</restriction>
|
||||
</complexContent>
|
||||
</complexType>
|
||||
</schema>
|
||||
</types>
|
||||
|
||||
<message name="fooRequest">
|
||||
<part name="param1" type="xsd:string"/>
|
||||
<part name="param2" type="xsd:string"/>
|
||||
<part name="param3" type="xsd:string"/>
|
||||
</message>
|
||||
|
||||
<message name="fooResponse">
|
||||
<part name="return" type="tns:StringArray"/>
|
||||
</message>
|
||||
|
||||
<portType name="FooServicePortType">
|
||||
<operation name="foo"
|
||||
parameterOrder="param3 param2 param1">
|
||||
<input message="tns:fooRequest"/>
|
||||
<output message="tns:fooResponse"/>
|
||||
</operation>
|
||||
<operation name="bar"
|
||||
parameterOrder="param1 param2 param3">
|
||||
<input message="tns:fooRequest"/>
|
||||
<output message="tns:fooResponse"/>
|
||||
</operation>
|
||||
<operation name="baz">
|
||||
<input message="tns:fooRequest"/>
|
||||
<output message="tns:fooResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding name="FooServicePortBinding" type="tns:FooServicePortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="foo">
|
||||
<soap:operation soapAction=""/>
|
||||
<input>
|
||||
<soap:body use="encoded"
|
||||
parts="param1 param3"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="urn:www.example.com:soapbodyparts:v1"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="urn:www.example.com:soapbodyparts:v1"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="bar">
|
||||
<soap:operation soapAction=""/>
|
||||
<input>
|
||||
<soap:body use="encoded"
|
||||
parts="param3 param2"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="urn:www.example.com:soapbodyparts:v1"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="urn:www.example.com:soapbodyparts:v1"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="baz">
|
||||
<soap:operation soapAction=""/>
|
||||
<input>
|
||||
<soap:body use="encoded"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="urn:www.example.com:soapbodyparts:v1"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
namespace="urn:www.example.com:soapbodyparts:v1"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
|
||||
<service name="FooService">
|
||||
<port name="FooServicePort" binding="tns:FooServicePortBinding">
|
||||
<soap:address location="http://raa.ruby-lang.org/soap/1.0.2/"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
86
test/wsdl/soap/test_soapbodyparts.rb
Normal file
86
test/wsdl/soap/test_soapbodyparts.rb
Normal file
|
@ -0,0 +1,86 @@
|
|||
require 'test/unit'
|
||||
require 'soap/rpc/standaloneServer'
|
||||
require 'soap/wsdlDriver'
|
||||
|
||||
|
||||
module WSDL
|
||||
module SOAP
|
||||
|
||||
|
||||
class TestSOAPBodyParts < Test::Unit::TestCase
|
||||
class Server < ::SOAP::RPC::StandaloneServer
|
||||
def on_init
|
||||
add_method(self, 'foo', 'p1', 'p2')
|
||||
add_method(self, 'bar', 'p1', 'p2')
|
||||
add_method(self, 'baz', 'p1', 'p2', 'p3')
|
||||
end
|
||||
|
||||
def foo(p1, p2)
|
||||
[p1, p2]
|
||||
end
|
||||
|
||||
alias bar foo
|
||||
|
||||
def baz(p1, p2, p3)
|
||||
[p1, p2, p3]
|
||||
end
|
||||
end
|
||||
|
||||
DIR = File.dirname(File.expand_path(__FILE__))
|
||||
|
||||
Port = 17171
|
||||
|
||||
def setup
|
||||
setup_server
|
||||
setup_client
|
||||
end
|
||||
|
||||
def setup_server
|
||||
@server = Server.new('Test', "urn:www.example.com:soapbodyparts:v1", '0.0.0.0', Port)
|
||||
@server.level = Logger::Severity::ERROR
|
||||
@t = Thread.new {
|
||||
Thread.current.abort_on_exception = true
|
||||
@server.start
|
||||
}
|
||||
while @server.status != :Running
|
||||
sleep 0.1
|
||||
unless @t.alive?
|
||||
@t.join
|
||||
raise
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def setup_client
|
||||
wsdl = File.join(DIR, 'soapbodyparts.wsdl')
|
||||
@client = ::SOAP::WSDLDriverFactory.new(wsdl).create_driver
|
||||
@client.endpoint_url = "http://localhost:#{Port}/"
|
||||
@client.wiredump_dev = STDERR if $DEBUG
|
||||
end
|
||||
|
||||
def teardown
|
||||
teardown_server
|
||||
teardown_client
|
||||
end
|
||||
|
||||
def teardown_server
|
||||
@server.shutdown
|
||||
@t.kill
|
||||
@t.join
|
||||
end
|
||||
|
||||
def teardown_client
|
||||
@client.reset_stream
|
||||
end
|
||||
|
||||
def test_soapbodyparts
|
||||
assert_equal(["2", "1"], @client.foo("1", "2"))
|
||||
assert_equal(["1", "2"], @client.foo("2", "1"))
|
||||
assert_equal(["2", "3"], @client.bar("2", "3"))
|
||||
assert_equal(["1", "2", "3"], @client.baz("1", "2", "3"))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue