httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r554456 - in /httpd/mod_wombat/branches/rework_object_wrappers/test: ./ htdocs/ htdocs/request/ htdocs/server/
Date Sun, 08 Jul 2007 22:12:16 GMT
Author: brianm
Date: Sun Jul  8 15:12:12 2007
New Revision: 554456

URL: http://svn.apache.org/viewvc?view=rev&rev=554456
Log:
Strip tests down

Added:
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/hi.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/request/
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/request/hi.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/server/
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/server/hi.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/http.lua
      - copied unchanged from r554393, httpd/mod_wombat/branches/rework_object_wrappers/test/helpers.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/http_helpers.lua
      - copied, changed from r554393, httpd/mod_wombat/branches/rework_object_wrappers/test/helpers.lua
Removed:
    httpd/mod_wombat/branches/rework_object_wrappers/test/helpers.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/config_tests.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/filters.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/find_me.txt
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/hooks.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/other.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/simple.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/test.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/httpd_config.lua
Modified:
    httpd/mod_wombat/branches/rework_object_wrappers/test/test.lua
    httpd/mod_wombat/branches/rework_object_wrappers/test/test_httpd.conf

Added: httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/hi.lua
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/hi.lua?view=auto&rev=554456
==============================================================================
--- httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/hi.lua (added)
+++ httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/hi.lua Sun Jul  8 15:12:12
2007
@@ -0,0 +1,3 @@
+function handle(r)
+    r:puts("H" .. "i!")
+end

Added: httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/request/hi.lua
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/request/hi.lua?view=auto&rev=554456
==============================================================================
--- httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/request/hi.lua (added)
+++ httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/request/hi.lua Sun Jul  8
15:12:12 2007
@@ -0,0 +1,6 @@
+
+-- Request Scoped Stuff
+
+function handle(r)
+    r:puts("H" .. "i!")
+end

Added: httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/server/hi.lua
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/server/hi.lua?view=auto&rev=554456
==============================================================================
--- httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/server/hi.lua (added)
+++ httpd/mod_wombat/branches/rework_object_wrappers/test/htdocs/server/hi.lua Sun Jul  8
15:12:12 2007
@@ -0,0 +1,6 @@
+
+-- Server Scoped Stuff
+
+function handle(r)
+    r:puts("H" .. "i!")
+end

Copied: httpd/mod_wombat/branches/rework_object_wrappers/test/http_helpers.lua (from r554393,
httpd/mod_wombat/branches/rework_object_wrappers/test/helpers.lua)
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/branches/rework_object_wrappers/test/http_helpers.lua?view=diff&rev=554456&p1=httpd/mod_wombat/branches/rework_object_wrappers/test/helpers.lua&r1=554393&p2=httpd/mod_wombat/branches/rework_object_wrappers/test/http_helpers.lua&r2=554456
==============================================================================
--- httpd/mod_wombat/branches/rework_object_wrappers/test/helpers.lua (original)
+++ httpd/mod_wombat/branches/rework_object_wrappers/test/http_helpers.lua Sun Jul  8 15:12:12
2007
@@ -1,4 +1,4 @@
-module("helpers", package.seeall)
+module("http_helpers", package.seeall)
 
 local io = require("io")
 local http = require("socket.http")

Modified: httpd/mod_wombat/branches/rework_object_wrappers/test/test.lua
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/branches/rework_object_wrappers/test/test.lua?view=diff&rev=554456&r1=554455&r2=554456
==============================================================================
--- httpd/mod_wombat/branches/rework_object_wrappers/test/test.lua (original)
+++ httpd/mod_wombat/branches/rework_object_wrappers/test/test.lua Sun Jul  8 15:12:12 2007
@@ -16,128 +16,139 @@
 -- limitations under the License.
 
 local mu = require "moonunit" 
-local http = require "helpers"
+local http = require "http_helpers"
 
 http.base_url = "http://localhost:8000"
 
 local test = mu.TestCase:new{}
-function test:basic_get()
-  local b, c = http.get "/basic"
-  assert(200 == c, "expected status code 200, got " .. c)
-  assert(b:find("hello Lua world"), "'hello Lua world' not found in response")
-end
-
-function test:quietly()
-  local b, c = http.get "/test_quietly"
-  assert(200 == c, "unexpected response code " .. c)
-  assert(b == 'hello!', "unexpected response body [" .. b .. "]")
-end
-
-function test.basic_post()
-  local b, c = http.post "/basic" "hello=7&hello=1"
-  assert(200 == c, "expected status code 200, got " .. c)
-  assert(b:find("complex:%s+hello: 7, 1\n"), "didn't find complex post parsing")
-  assert(b:find("simple:%s+hello: 7\n"), "didn't find simple post parsing")
-end
-
-function test.basic_post_alt()
-  local b, c = http.post("/test_foo", "hello=7&hello=1")
-  assert(201 == c, "expected status code 200, got " .. c)
-  assert(b:find("Handler FOO!"), "unexpected output!")
-end
-
-function test.post_with_table()
-  local b, c = http.post "/basic" { hello = "7" }
-  assert(200 == c, "expected status code 200, got " .. c)
-  assert(b:find("hello: 7"), "didn't get expected post data [" .. b .."]")
-  
-  b, c = http.post "/basic" { hello = "7", goodbye = "8" }
-  
-  assert(200 == c, "expected status code 200, got " .. c)
-  assert(b:find("hello: 7"), "didn't get expected post data [" .. b .."]")
-  assert(b:find("goodbye: 8"), "didn't get expected post data [" .. b .."]")
-end
-
-function test:simple_filter()
-  local b, c = http.get "/filter/simple"
-  assert(200 == c, "expected status code 200, got " .. c)
-end
-
-function test:request_attributes()
-  local r, c = http.get "/test_attributes?yes=no"
-  assert(201 == c, "expected status code 201, got " .. c)
-  
-  assert(r:find("status: 200\nstatus: 201"), "changing status code failed")
-  assert(r:find("method: GET"), "method wasn't reported correctly")
-  assert(r:find("protocol: HTTP/1.1"), "protocol reported incorrectly")
-  assert(r:find("assbackwards: false"), "assbackwards reported incorrectly")
-  assert(r:find("args: yes=no"), "args not reported correctly")
-end
 
-function test:map_regex()
-  local r, c = http.get "/test_regex"
+function test:direct_file_request_scope()
+  local b, c = http.get "/request/hi.lua"
   assert(200 == c, "expected status code 200, got " .. c)
-  assert(r:find("matched in handle_regex"), "didn't find 'matched in handle_regex'")  
+  assert(b:find("Hi!"), "Unable to find 'Hi!' in response")
 end
 
-function test:map_regex2()
-  local r, c = http.get "/test_regex?a=8"
+function test:direct_file_server_scope()
+  local b, c = http.get "/server/hi.lua"
   assert(200 == c, "expected status code 200, got " .. c)
-  assert(r:find("matched in handle_regex"), "didn't find 'matched in handle_regex'")  
+  assert(b:find("Hi!"), "Unable to find 'Hi!' in response")
 end
 
-function test:translate_name_hook()
-  local r, c = http.get "/translate-name"
-  assert(200 == c, "expected 200 got " .. c)
-  assert(r:find("please find me"), "didn't get expected static file :-(, instead got " ..
r)
-end
 
-function test:translate_name_hook2()
-  local r, c = http.get "/translate-name2"
-  assert(200 == c, "expected 200 got " .. c)
-  assert(r:find("please find me"), "didn't get expected static file :-(, instead got " ..
r)
-end
-
-function test:server_version()
-  local r, c = http.get "/test_serverversion"
-  assert(200 == c)
-  assert(r:find("Apache/2"), "version isn't Apache/2, but is " .. r)
-end
-
-function test:fixups_hook()
-  local r, c = http.get "/test_fixupstest"
-  assert(201 == c, "incorrect status code returned, expected 201 got " .. c)
-  assert(r:find("status is 201"), "handler sees incorrect status")
-end
-
-function test:simple()
-    local r, c = http.get "/simple.lua"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("Hi"), "Didn't find 'Hi'")
-end
-
-function test:simple_mapped()
-    local r, c = http.get "/simple"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("Hi"), "Didn't find 'Hi'")
-end
-
-function test:super_basic_config() 
-    local r, c = http.get "/super-basic-config"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("success in handle"), "Didn't find 'success in handle'")
-end
+test:run()
 
-function test:server_says_hi()
-    local r, c = http.get "/server-says-hi"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("hello from server scope"), "Didn't find expected text in response")  
 
-end
+-- 
+-- function test:quietly()
+--   local b, c = http.get "/test_quietly"
+--   assert(200 == c, "unexpected response code " .. c)
+--   assert(b == 'hello!', "unexpected response body [" .. b .. "]")
+-- end
+-- 
+-- function test.basic_post()
+--   local b, c = http.post "/basic" "hello=7&hello=1"
+--   assert(200 == c, "expected status code 200, got " .. c)
+--   assert(b:find("complex:%s+hello: 7, 1\n"), "didn't find complex post parsing")
+--   assert(b:find("simple:%s+hello: 7\n"), "didn't find simple post parsing")
+-- end
+-- 
+-- function test.basic_post_alt()
+--   local b, c = http.post("/test_foo", "hello=7&hello=1")
+--   assert(201 == c, "expected status code 200, got " .. c)
+--   assert(b:find("Handler FOO!"), "unexpected output!")
+-- end
+-- 
+-- function test.post_with_table()
+--   local b, c = http.post "/basic" { hello = "7" }
+--   assert(200 == c, "expected status code 200, got " .. c)
+--   assert(b:find("hello: 7"), "didn't get expected post data [" .. b .."]")
+--   
+--   b, c = http.post "/basic" { hello = "7", goodbye = "8" }
+--   
+--   assert(200 == c, "expected status code 200, got " .. c)
+--   assert(b:find("hello: 7"), "didn't get expected post data [" .. b .."]")
+--   assert(b:find("goodbye: 8"), "didn't get expected post data [" .. b .."]")
+-- end
+-- 
+-- function test:simple_filter()
+--   local b, c = http.get "/filter/simple"
+--   assert(200 == c, "expected status code 200, got " .. c)
+-- end
+-- 
+-- function test:request_attributes()
+--   local r, c = http.get "/test_attributes?yes=no"
+--   assert(201 == c, "expected status code 201, got " .. c)
+--   
+--   assert(r:find("status: 200\nstatus: 201"), "changing status code failed")
+--   assert(r:find("method: GET"), "method wasn't reported correctly")
+--   assert(r:find("protocol: HTTP/1.1"), "protocol reported incorrectly")
+--   assert(r:find("assbackwards: false"), "assbackwards reported incorrectly")
+--   assert(r:find("args: yes=no"), "args not reported correctly")
+-- end
+-- 
+-- function test:map_regex()
+--   local r, c = http.get "/test_regex"
+--   assert(200 == c, "expected status code 200, got " .. c)
+--   assert(r:find("matched in handle_regex"), "didn't find 'matched in handle_regex'") 

+-- end
+-- 
+-- function test:map_regex2()
+--   local r, c = http.get "/test_regex?a=8"
+--   assert(200 == c, "expected status code 200, got " .. c)
+--   assert(r:find("matched in handle_regex"), "didn't find 'matched in handle_regex'") 

+-- end
+-- 
+-- function test:translate_name_hook()
+--   local r, c = http.get "/translate-name"
+--   assert(200 == c, "expected 200 got " .. c)
+--   assert(r:find("please find me"), "didn't get expected static file :-(, instead got "
.. r)
+-- end
+-- 
+-- function test:translate_name_hook2()
+--   local r, c = http.get "/translate-name2"
+--   assert(200 == c, "expected 200 got " .. c)
+--   assert(r:find("please find me"), "didn't get expected static file :-(, instead got "
.. r)
+-- end
+-- 
+-- function test:server_version()
+--   local r, c = http.get "/test_serverversion"
+--   assert(200 == c)
+--   assert(r:find("Apache/2"), "version isn't Apache/2, but is " .. r)
+-- end
+-- 
+-- function test:fixups_hook()
+--   local r, c = http.get "/test_fixupstest"
+--   assert(201 == c, "incorrect status code returned, expected 201 got " .. c)
+--   assert(r:find("status is 201"), "handler sees incorrect status")
+-- end
+-- 
+-- function test:simple()
+--     local r, c = http.get "/simple.lua"
+--     assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
+--     assert(r:find("Hi"), "Didn't find 'Hi'")
+-- end
+-- 
+-- function test:simple_mapped()
+--     local r, c = http.get "/simple"
+--     assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
+--     assert(r:find("Hi"), "Didn't find 'Hi'")
+-- end
+-- 
+-- function test:super_basic_config() 
+--     local r, c = http.get "/super-basic-config"
+--     assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
+--     assert(r:find("success in handle"), "Didn't find 'success in handle'")
+-- end
+-- 
+-- function test:server_says_hi()
+--     local r, c = http.get "/server-says-hi"
+--     assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
+--     assert(r:find("hello from server scope"), "Didn't find expected text in response")
   
+-- end
+-- 
+-- function test:request_scope_says_hi()
+--     local r, c = http.get "/request-says-hi"
+--     assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
+--     assert(r:find("hello from request scope"), "Didn't find expected text in response")
+-- end
 
-function test:request_scope_says_hi()
-    local r, c = http.get "/request-says-hi"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("hello from request scope"), "Didn't find expected text in response")
-end
 
-test:run()

Modified: httpd/mod_wombat/branches/rework_object_wrappers/test/test_httpd.conf
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/branches/rework_object_wrappers/test/test_httpd.conf?view=diff&rev=554456&r1=554455&r2=554456
==============================================================================
--- httpd/mod_wombat/branches/rework_object_wrappers/test/test_httpd.conf (original)
+++ httpd/mod_wombat/branches/rework_object_wrappers/test/test_httpd.conf Sun Jul  8 15:12:12
2007
@@ -12,17 +12,6 @@
 
 AddHandler lua-script .lua
 
-LuaConfig httpd_config.lua configure
-
-#MapLuaHandler /basic /Users/brianm/src/wombat/test/htdocs/test.lua
-#MapLuaHandler /filter/simple /Users/brianm/src/wombat/test/htdocs/filters.lua handle_simple
-#MapLuaHandler ^/(\w+)_(\w+)$ /Users/brianm/src/wombat/test/htdocs/$1.lua handle_$2
-
-LuaHookTranslateName htdocs/hooks.lua translate_name
-LuaHookTranslateName htdocs/hooks.lua translate_name2
-
-LuaHookFixups htdocs/hooks.lua fixups_test
-
 LuaPackagePath lib/?.lua
 
 # stat | forever | never



Mime
View raw message