summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/test-protocol-http.rb58
1 files changed, 3 insertions, 55 deletions
diff --git a/t/test-protocol-http.rb b/t/test-protocol-http.rb
index cc8421c..422415c 100755
--- a/t/test-protocol-http.rb
+++ b/t/test-protocol-http.rb
@@ -2,7 +2,6 @@
require 'test/unit'
-require 'webrick'
require 'custodian/protocol-tests/http.rb'
@@ -14,32 +13,17 @@ require 'custodian/protocol-tests/http.rb'
#
class TestHTTPProtocolProbe < Test::Unit::TestCase
-
- #
- # Holder for the new thread we launch, and the servr
- # we run within it.
- #
- attr_reader :server, :server_thread
-
-
#
- # Create the test suite environment: Launch a HTTP server in a new thread.
+ # Create the test suite environment: NOP.
#
def setup
- @server_thread = Thread.new do
- @server = WEBrick::HTTPServer.new( :Port => 12000,
- :DocumentRoot => "/tmp",
- :AccessLog => [])
- @server.start
- end
end
#
- # Destroy the test suite environment: Kill the HTTP-Server
+ # Destroy the test suite environment: NOP.
#
def teardown
- @server_thread.kill!
end
@@ -47,6 +31,7 @@ class TestHTTPProtocolProbe < Test::Unit::TestCase
# Test we can create a new HTTPTest object.
#
def test_init
+
test_data_good = {
"target_host" => "http://www.steve.org.uk/",
"test_type" => "http",
@@ -107,44 +92,7 @@ class TestHTTPProtocolProbe < Test::Unit::TestCase
assert_raise ArgumentError do
bad = HTTPTest.new( test_data_bad_two )
end
-
end
-
- #
- # Test we can make a HTTP fetch, and retrieve the status code
- # against our stub-Webbrick server.
- #
- def test_http_fetch
-
- test_probe = {
- "target_host" => "http://localhost:12000/",
- "test_type" => "http",
- "verbose" => 1,
- "test_port" => 12000,
- "http_status" => "200"
- }
-
- #
- # Create a new HTTPTest object. This should succeed
- #
- test = HTTPTest.new( test_probe )
- assert( test )
-
-
- #
- # Make the test - ensure that:
- #
- # a. There is no error before it is tested.
- #
- # b. The test method "run_test" returns true.
- #
- # c. There is no error logged after completion.
- #
- assert( test.error().nil? )
- assert( test.run_test() )
- assert( test.error().nil? )
- end
-
end