Changeset 1016
- Timestamp:
- 10/19/03 00:10:30 (5 years ago)
- Files:
-
- trunk/test/interopR2/server.rb (modified) (2 diffs)
- trunk/test/runner.rb (modified) (1 diff)
- trunk/test/soap/calc/server.rb (modified) (1 diff)
- trunk/test/soap/calc/server2.rb (modified) (1 diff)
- trunk/test/soap/calc/test_calc.rb (modified) (2 diffs)
- trunk/test/soap/calc/test_calc2.rb (modified) (2 diffs)
- trunk/test/soap/calc/test_calc_cgi.rb (modified) (3 diffs)
- trunk/test/soap/helloworld/hw_s.rb (modified) (1 diff)
- trunk/test/soap/helloworld/test_helloworld.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/test/interopR2/server.rb
r952 r1016 4 4 5 5 #$KCODE = "UTF8" # Set $KCODE before loading 'soap/xmlparser'. 6 #$KCODE = "EUC"7 $KCODE = "SJIS"6 $KCODE = "EUC" 7 #$KCODE = "SJIS" 8 8 9 9 require 'soap/rpc/standaloneServer' … … 268 268 end 269 269 270 GC.start 271 InteropApp.new('InteropApp', InterfaceNS, '0.0.0.0', 10080).start 270 if __FILE__ == $0 271 InteropApp.new('InteropApp', InterfaceNS, '0.0.0.0', 10080).start 272 end trunk/test/runner.rb
r999 r1016 1 require 'test/unit/testsuite' 2 require 'test/unit/testcase' 3 require 'optparse' 1 require 'test/unit' 4 2 5 rcsid = %w$Id: runner.rb,v 1. 3 2003/10/04 08:42:13nahi Exp $3 rcsid = %w$Id: runner.rb,v 1.4 2003/10/18 15:10:29 nahi Exp $ 6 4 Version = rcsid[2].scan(/\d+/).collect!(&method(:Integer)).freeze 7 5 Release = rcsid[3].freeze 8 6 9 class BulkTestSuite < Test::Unit::TestSuite 10 def self.suite 11 suite = Test::Unit::TestSuite.new(self.name) 12 ObjectSpace.each_object(Class) do |klass| 13 suite << klass.suite if (Test::Unit::TestCase > klass) 14 end 15 suite 16 end 17 end 18 19 runners_map = { 20 'console' => proc do |suite| 21 require 'test/unit/ui/console/testrunner' 22 passed = Test::Unit::UI::Console::TestRunner.run(suite).passed? 23 exit(passed ? 0 : 1) 24 end, 25 'gtk' => proc do |suite| 26 require 'test/unit/ui/gtk/testrunner' 27 Test::Unit::UI::GTK::TestRunner.run(suite) 28 end, 29 'fox' => proc do |suite| 30 require 'test/unit/ui/fox/testrunner' 31 Test::Unit::UI::Fox::TestRunner.run(suite) 32 end, 33 } 34 35 runner = 'console' 36 opt = OptionParser.new 37 opt.program_name = $0 38 opt.banner << " [tests...]" 39 opt.on("--runner=mode", runners_map.keys, "UI mode (console, gtk,fox)") do |arg| 40 runner = arg 41 end 42 begin 43 argv = opt.parse(*ARGV) 44 rescue OptionParser::ParseError 45 opt.abort($!) 46 end 47 48 if argv.empty? 49 argv = [File.dirname(__FILE__)] 50 end 51 argv.collect! do |arg| 52 if File.directory?(arg) 53 Dir.glob(File.join(arg, "**", "test_*.rb")).sort 54 else 55 arg 56 end 57 end.flatten! 58 59 argv.each do |tc_name| 60 require tc_name 61 end 62 63 runners_map[runner].call(BulkTestSuite.suite) 7 runner = Test::Unit::AutoRunner.new(true) 8 runner.to_run.concat(ARGV) 9 runner.to_run << File.dirname(__FILE__) if runner.to_run.empty? 10 runner.run trunk/test/soap/calc/server.rb
r965 r1016 14 14 15 15 if $0 == __FILE__ 16 status = CalcServer.new('CalcServer', nil, '0.0.0.0', 7000).start16 status = CalcServer.new('CalcServer', nil, '0.0.0.0', 17171).start 17 17 end trunk/test/soap/calc/server2.rb
r965 r1016 17 17 18 18 if $0 == __FILE__ 19 status = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 7000).start19 status = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 17171).start 20 20 end trunk/test/soap/calc/test_calc.rb
r985 r1016 13 13 14 14 class TestCalc < Test::Unit::TestCase 15 Port = 17171 16 15 17 def setup 16 @server = CalcServer.new(self.class.name, nil, '0.0.0.0', 7000)18 @server = CalcServer.new(self.class.name, nil, '0.0.0.0', Port) 17 19 @server.level = Logger::Severity::FATAL 18 20 @t = Thread.new { … … 22 24 sleep 0.1 23 25 end 24 @calc = SOAP::RPC::Driver.new( 'http://localhost:7000/', 'http://tempuri.org/calcService')26 @calc = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'http://tempuri.org/calcService') 25 27 @calc.add_method('add', 'lhs', 'rhs') 26 28 @calc.add_method('sub', 'lhs', 'rhs') trunk/test/soap/calc/test_calc2.rb
r985 r1016 13 13 14 14 class TestCalc2 < Test::Unit::TestCase 15 Port = 17171 16 15 17 def setup 16 @server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 7000)18 @server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', Port) 17 19 @server.level = Logger::Severity::FATAL 18 20 @t = Thread.new { … … 22 24 sleep 0.1 23 25 end 24 @var = SOAP::RPC::Driver.new( 'http://localhost:7000/', 'http://tempuri.org/calcService')26 @var = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'http://tempuri.org/calcService') 25 27 @var.add_method('set', 'newValue') 26 28 @var.add_method('get') trunk/test/soap/calc/test_calc_cgi.rb
r1000 r1016 17 17 ) 18 18 19 Port = 17171 20 19 21 def setup 20 22 logger = Logger.new(STDERR) … … 23 25 :BindAddress => "0.0.0.0", 24 26 :Logger => logger, 25 :Port => 8808,27 :Port => Port, 26 28 :AccessLog => [], 27 29 :DocumentRoot => File.dirname(File.expand_path(__FILE__)), … … 35 37 sleep 0.1 36 38 end 37 @calc = SOAP::RPC::Driver.new( 'http://localhost:8808/server.cgi', 'http://tempuri.org/calcService')39 @calc = SOAP::RPC::Driver.new("http://localhost:#{Port}/server.cgi", 'http://tempuri.org/calcService') 38 40 @calc.add_method('add', 'lhs', 'rhs') 39 41 @calc.add_method('sub', 'lhs', 'rhs') trunk/test/soap/helloworld/hw_s.rb
r985 r1016 12 12 13 13 if $0 == __FILE__ 14 server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 2000)14 server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 17171) 15 15 server.start 16 16 end trunk/test/soap/helloworld/test_helloworld.rb
r985 r1016 13 13 14 14 class TestHelloWorld < Test::Unit::TestCase 15 Port = 17171 16 15 17 def setup 16 @server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 2000)18 @server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', Port) 17 19 @server.level = Logger::Severity::UNKNOWN 18 20 @t = Thread.new { … … 22 24 sleep 0.1 23 25 end 24 @client = SOAP::RPC::Driver.new( 'http://localhost:2000/', 'urn:hws')26 @client = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'urn:hws') 25 27 @client.add_method("hello_world", "from") 26 28 end