diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 08:14:57 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 08:14:57 +0000 |
commit | 889c7de09d40ebdd3620cf9c0ad74d750b512221 (patch) | |
tree | 6c16302232c2b655cfd5ea406a9ac202814a8b35 /test/soap/calc | |
parent | efed292c4311c8c182a32ac2afe70c6969815b2d (diff) | |
download | ruby-889c7de09d40ebdd3620cf9c0ad74d750b512221.tar.gz |
Mon Dec 24 17:06:37 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* {lib,test}/{soap,wsdl,xsd}: removed soap4r along to the discussion
at ruby-core and ruby-dev. see [ruby-core:12535], [ruby-dev:31969].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/soap/calc')
-rw-r--r-- | test/soap/calc/calc.rb | 17 | ||||
-rw-r--r-- | test/soap/calc/calc2.rb | 29 | ||||
-rw-r--r-- | test/soap/calc/server.cgi | 13 | ||||
-rw-r--r-- | test/soap/calc/server.rb | 17 | ||||
-rw-r--r-- | test/soap/calc/server2.rb | 20 | ||||
-rw-r--r-- | test/soap/calc/test_calc.rb | 49 | ||||
-rw-r--r-- | test/soap/calc/test_calc2.rb | 53 | ||||
-rw-r--r-- | test/soap/calc/test_calc_cgi.rb | 69 |
8 files changed, 0 insertions, 267 deletions
diff --git a/test/soap/calc/calc.rb b/test/soap/calc/calc.rb deleted file mode 100644 index 6bc78803b3..0000000000 --- a/test/soap/calc/calc.rb +++ /dev/null @@ -1,17 +0,0 @@ -module CalcService - def self.add(lhs, rhs) - lhs + rhs - end - - def self.sub(lhs, rhs) - lhs - rhs - end - - def self.multi(lhs, rhs) - lhs * rhs - end - - def self.div(lhs, rhs) - lhs / rhs - end -end diff --git a/test/soap/calc/calc2.rb b/test/soap/calc/calc2.rb deleted file mode 100644 index 69495730e7..0000000000 --- a/test/soap/calc/calc2.rb +++ /dev/null @@ -1,29 +0,0 @@ -class CalcService2 - def initialize(value = 0) - @value = value - end - - def set_value(value) - @value = value - end - - def get_value - @value - end - - def +(rhs) - @value + rhs - end - - def -(rhs) - @value - rhs - end - - def *(rhs) - @value * rhs - end - - def /(rhs) - @value / rhs - end -end diff --git a/test/soap/calc/server.cgi b/test/soap/calc/server.cgi deleted file mode 100644 index 1eb0d1d864..0000000000 --- a/test/soap/calc/server.cgi +++ /dev/null @@ -1,13 +0,0 @@ -require 'soap/rpc/cgistub' - -class CalcServer < SOAP::RPC::CGIStub - def initialize(*arg) - super - - require 'calc' - servant = CalcService - add_servant(servant, 'http://tempuri.org/calcService') - end -end - -status = CalcServer.new('CalcServer', nil).start diff --git a/test/soap/calc/server.rb b/test/soap/calc/server.rb deleted file mode 100644 index a93774d909..0000000000 --- a/test/soap/calc/server.rb +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby - -require 'soap/rpc/standaloneServer' -require 'calc' - -class CalcServer < SOAP::RPC::StandaloneServer - def initialize(*arg) - super - - servant = CalcService - add_servant(servant, 'http://tempuri.org/calcService') - end -end - -if $0 == __FILE__ - status = CalcServer.new('CalcServer', nil, '0.0.0.0', 17171).start -end diff --git a/test/soap/calc/server2.rb b/test/soap/calc/server2.rb deleted file mode 100644 index 01c6d75289..0000000000 --- a/test/soap/calc/server2.rb +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env ruby - -require 'soap/rpc/standaloneServer' -require 'calc2' - -class CalcServer2 < SOAP::RPC::StandaloneServer - def on_init - servant = CalcService2.new - add_method(servant, 'set_value', 'newValue') - add_method(servant, 'get_value') - add_method_as(servant, '+', 'add', 'lhs') - add_method_as(servant, '-', 'sub', 'lhs') - add_method_as(servant, '*', 'multi', 'lhs') - add_method_as(servant, '/', 'div', 'lhs') - end -end - -if $0 == __FILE__ - status = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 17171).start -end diff --git a/test/soap/calc/test_calc.rb b/test/soap/calc/test_calc.rb deleted file mode 100644 index 88738716a6..0000000000 --- a/test/soap/calc/test_calc.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'test/unit' -require 'soap/rpc/driver' -require 'server.rb' - - -module SOAP -module Calc - - -class TestCalc < Test::Unit::TestCase - Port = 17171 - - def setup - @server = CalcServer.new(self.class.name, nil, '0.0.0.0', Port) - @server.level = Logger::Severity::ERROR - @t = Thread.new { - @server.start - } - @endpoint = "http://localhost:#{Port}/" - @calc = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService') - @calc.add_method('add', 'lhs', 'rhs') - @calc.add_method('sub', 'lhs', 'rhs') - @calc.add_method('multi', 'lhs', 'rhs') - @calc.add_method('div', 'lhs', 'rhs') - end - - def teardown - @server.shutdown - @t.kill - @t.join - @calc.reset_stream - end - - def test_calc - assert_equal(3, @calc.add(1, 2)) - assert_equal(-1.1, @calc.sub(1.1, 2.2)) - assert_equal(2.42, @calc.multi(1.1, 2.2)) - assert_equal(2, @calc.div(5, 2)) - assert_equal(2.5, @calc.div(5.0, 2)) - assert_equal(1.0/0.0, @calc.div(1.1, 0)) - assert_raises(ZeroDivisionError) do - @calc.div(1, 0) - end - end -end - - -end -end diff --git a/test/soap/calc/test_calc2.rb b/test/soap/calc/test_calc2.rb deleted file mode 100644 index f334b29bdb..0000000000 --- a/test/soap/calc/test_calc2.rb +++ /dev/null @@ -1,53 +0,0 @@ -require 'test/unit' -require 'soap/rpc/driver' -require 'server2.rb' - - -module SOAP -module Calc - - -class TestCalc2 < Test::Unit::TestCase - Port = 17171 - - def setup - @server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', Port) - @server.level = Logger::Severity::ERROR - @t = Thread.new { - Thread.current.abort_on_exception = true - @server.start - } - @endpoint = "http://localhost:#{Port}/" - @var = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService') - @var.wiredump_dev = STDERR if $DEBUG - @var.add_method('set_value', 'newValue') - @var.add_method('get_value') - @var.add_method_as('+', 'add', 'rhs') - @var.add_method_as('-', 'sub', 'rhs') - @var.add_method_as('*', 'multi', 'rhs') - @var.add_method_as('/', 'div', 'rhs') - end - - def teardown - @server.shutdown - @t.kill - @t.join - @var.reset_stream - end - - def test_calc2 - assert_equal(1, @var.set_value(1)) - assert_equal(3, @var + 2) - assert_equal(-1.2, @var - 2.2) - assert_equal(2.2, @var * 2.2) - assert_equal(0, @var / 2) - assert_equal(0.5, @var / 2.0) - assert_raises(ZeroDivisionError) do - @var / 0 - end - end -end - - -end -end diff --git a/test/soap/calc/test_calc_cgi.rb b/test/soap/calc/test_calc_cgi.rb deleted file mode 100644 index dc701978c4..0000000000 --- a/test/soap/calc/test_calc_cgi.rb +++ /dev/null @@ -1,69 +0,0 @@ -require 'test/unit' -require 'soap/rpc/driver' -require 'logger' -require 'webrick' -require 'rbconfig' - - -module SOAP -module Calc - - -class TestCalcCGI < Test::Unit::TestCase - # This test shuld be run after installing ruby. - RUBYBIN = File.join( - RbConfig::CONFIG["bindir"], - RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"] - ) - RUBYBIN << " -d" if $DEBUG - - Port = 17171 - - def setup - logger = Logger.new(STDERR) - logger.level = Logger::Severity::ERROR - @server = WEBrick::HTTPServer.new( - :BindAddress => "0.0.0.0", - :Logger => logger, - :Port => Port, - :AccessLog => [], - :DocumentRoot => File.dirname(File.expand_path(__FILE__)), - :CGIPathEnv => ENV['PATH'], - :CGIInterpreter => RUBYBIN - ) - @t = Thread.new { - Thread.current.abort_on_exception = true - @server.start - } - @endpoint = "http://localhost:#{Port}/server.cgi" - @calc = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService') - @calc.wiredump_dev = STDERR if $DEBUG - @calc.add_method('add', 'lhs', 'rhs') - @calc.add_method('sub', 'lhs', 'rhs') - @calc.add_method('multi', 'lhs', 'rhs') - @calc.add_method('div', 'lhs', 'rhs') - end - - def teardown - @server.shutdown - @t.kill - @t.join - @calc.reset_stream - end - - def test_calc_cgi - assert_equal(3, @calc.add(1, 2)) - assert_equal(-1.1, @calc.sub(1.1, 2.2)) - assert_equal(2.42, @calc.multi(1.1, 2.2)) - assert_equal(2, @calc.div(5, 2)) - assert_equal(2.5, @calc.div(5.0, 2)) - assert_equal(1.0/0.0, @calc.div(1.1, 0)) - assert_raises(ZeroDivisionError) do - @calc.div(1, 0) - end - end -end - - -end -end |