Change soft-fail to use the config, rather than env
[rbx.git] / test / mri / wsdl / raa / test_raa.rb
blob0b00042ffbd2cd12eace60c406a8807e6cae7cfb
1 require 'test/unit'
2 require 'soap/wsdlDriver'
3 require 'RAA.rb'
4 require 'RAAServant.rb'
5 require 'RAAService.rb'
8 module WSDL
9 module RAA
12 class TestRAA < Test::Unit::TestCase
13   DIR = File.dirname(File.expand_path(__FILE__))
15   Port = 17171
17   def setup
18     setup_server
19     setup_client
20   end
22   def setup_server
23     @server = App.new('RAA server', nil, '0.0.0.0', Port)
24     @server.level = Logger::Severity::ERROR
25     @t = Thread.new {
26       Thread.current.abort_on_exception = true
27       @server.start
28     }
29   end
31   def setup_client
32     wsdl = File.join(DIR, 'raa.wsdl')
33     @raa = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
34     @raa.endpoint_url = "http://localhost:#{Port}/"
35   end
37   def teardown
38     teardown_server
39     teardown_client
40   end
42   def teardown_server
43     @server.shutdown
44     @t.kill
45     @t.join
46   end
48   def teardown_client
49     @raa.reset_stream
50   end
52   def test_raa
53     assert_equal(["ruby", "soap4r"], @raa.getAllListings)
54   end
56   def foo
57     p @raa.getProductTree()
58     p @raa.getInfoFromCategory(Category.new("Library", "XML"))
59     t = Time.at(Time.now.to_i - 24 * 3600)
60     p @raa.getModifiedInfoSince(t)
61     p @raa.getModifiedInfoSince(DateTime.new(t.year, t.mon, t.mday, t.hour, t.min, t.sec))
62     o = @raa.getInfoFromName("SOAP4R")
63     p o.type
64     p o.owner.name
65     p o
66   end
67 end
70 end
71 end