1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/wsdl/raa/test_raa.rb
nahi b7931c40fe * test/wsdl/raa/*: add new testcase for WSDL loading, parsing and reading.
* test/soap/marshal/*: backport from soap4r/1.5.1.  all differences are for
  ruby/1.6.

* lib/soap/*: backport from soap4r/1.5.1.  all differences are for ruby/1.6.

* lib/wsdl/data.rb, lib/wsdl/xmlSchema/data.rb: move definition of
  ArrayTypeAttrName from ::WSDL::XMLSchema::* to ::WSDL::*.  [ruby-talk:84813]

* lib/wsdl/soap/definitions.rb: element name typo in custom exception struct
  definition which is needed for wsdlDriver; camelCase -> underscore_name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-08 09:52:42 +00:00

78 lines
1.5 KiB
Ruby

require 'test/unit'
require 'soap/wsdlDriver'
module WSDL
module RAA
class TestRAA < Test::Unit::TestCase
DIR = File.dirname(File.expand_path(__FILE__))
Port = 17171
def setup
setup_server
setup_client
end
def setup_server
$:.push(DIR)
require File.join(DIR, 'server.rb')
$:.delete(DIR)
@server = RAABaseServiceServer.new('RAA server', nil, '0.0.0.0', Port)
@server.level = Logger::Severity::ERROR
@t = Thread.new {
Thread.current.abort_on_exception = true
@server.start
}
while @server.server.nil? or @server.server.status != :Running
sleep 0.1
unless @t.alive?
@t.join
raise
end
end
end
def setup_client
wsdl = File.join(DIR, 'raa.wsdl')
@raa = ::SOAP::WSDLDriverFactory.new(wsdl).create_driver
@raa.endpoint_url = "http://localhost:#{Port}/"
end
def teardown
teardown_server
teardown_client
end
def teardown_server
@server.server.shutdown
@t.kill
@t.join
end
def teardown_client
@raa.reset_stream
end
def test_raa
assert_equal(["ruby", "soap4r"], @raa.getAllListings)
end
def foo
p @raa.getProductTree()
p @raa.getInfoFromCategory(Category.new("Library", "XML"))
t = Time.at(Time.now.to_i - 24 * 3600)
p @raa.getModifiedInfoSince(t)
p @raa.getModifiedInfoSince(DateTime.new(t.year, t.mon, t.mday, t.hour, t.min, t.sec))
o = @raa.getInfoFromName("SOAP4R")
p o.type
p o.owner.name
p o
end
end
end
end