From cf34b589384bebdcd424ee276a607d2c72b949da Mon Sep 17 00:00:00 2001
From: "(no author)" <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Sun, 25 Jan 2004 20:19:17 +0000
Subject: [PATCH] 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
---
.../generators/template/html/one_page_html.rb | 116 ++++++++++++++++++
test/wsdl/soap/soapbodyparts.wsdl | 103 ++++++++++++++++
test/wsdl/soap/test_soapbodyparts.rb | 86 +++++++++++++
3 files changed, 305 insertions(+)
create mode 100644 lib/rdoc/generators/template/html/one_page_html.rb
create mode 100644 test/wsdl/soap/soapbodyparts.wsdl
create mode 100644 test/wsdl/soap/test_soapbodyparts.rb
diff --git a/lib/rdoc/generators/template/html/one_page_html.rb b/lib/rdoc/generators/template/html/one_page_html.rb
new file mode 100644
index 0000000000..ca69908c97
--- /dev/null
+++ b/lib/rdoc/generators/template/html/one_page_html.rb
@@ -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
+
Requires:
+
+START:requires
+IF:aref
+- %name%
+ENDIF:aref
+IFNOT:aref
+- %name%
+ENDIF:aref
+END:requires
+
+ENDIF:requires
+
+IF:attributes
+Attributes
+
+START:attributes
+%name% | %rw% | %a_desc% |
+END:attributes
+
+ENDIF:attributes
+
+IF:includes
+Includes
+
+START:includes
+IF:aref
+- %name%
+ENDIF:aref
+IFNOT:aref
+- %name%
+ENDIF:aref
+END:includes
+
+ENDIF:includes
+
+IF:method_list
+Methods
+START:method_list
+IF:methods
+START:methods
+
+
+IF:m_desc
+%m_desc%
+ENDIF:m_desc
+
+IF:sourcecode
+
+%sourcecode%
+
+ENDIF:sourcecode
+END:methods
+ENDIF:methods
+END:method_list
+ENDIF:method_list
+}
+
+########################################################################
+
+ONE_PAGE = %{
+
+
+
+ %title%
+
+
+
+START:files
+File: %short_name%
+
+ Path: | %full_path% |
+ Modified: | %dtm_modified% |
+
+} + CONTENTS_XML + %{
+END:files
+
+IF:classes
+Classes
+START:classes
+IF:parent
+%classmod% %full_name% < HREF:par_url:parent:
+ENDIF:parent
+IFNOT:parent
+%classmod% %full_name%
+ENDIF:parent
+
+IF:infiles
+(in files
+START:infiles
+HREF:full_path_url:full_path:
+END:infiles
+)
+ENDIF:infiles
+} + CONTENTS_XML + %{
+END:classes
+ENDIF:classes
+
+
+}
+
+end
+end
diff --git a/test/wsdl/soap/soapbodyparts.wsdl b/test/wsdl/soap/soapbodyparts.wsdl
new file mode 100644
index 0000000000..0e6da0ebee
--- /dev/null
+++ b/test/wsdl/soap/soapbodyparts.wsdl
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/wsdl/soap/test_soapbodyparts.rb b/test/wsdl/soap/test_soapbodyparts.rb
new file mode 100644
index 0000000000..efead18301
--- /dev/null
+++ b/test/wsdl/soap/test_soapbodyparts.rb
@@ -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