From: Stephen D. <sd...@us...> - 2005-07-21 10:44:42
|
Update of /cvsroot/naviserver/naviserver/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14639/tests Added Files: http_chunked.test Removed Files: ns_adp_chunked.test Log Message: * tests/ns_adp_chunked.test: * tests/http_chunked.test: Rename tests which handle both Tcl and ADP. Add some more tests which highlight a few bugs. * tests/testserver/pages/ns_adp_chunked.tcl: * tests/testserver/pages/http_chunked.adp: Rename file. Handle streaming and non-streaming situations, and actually write out the data in two goes. Add a workaround for a bug in the ns_conn chunked switch: detect whether client is HTTP/1.1 and therefore handles chunked encoding. This needs to disappear altogether. * tests/testserver/pages/ns_tcl_chunked.tcl: Incorporate code directly into test file using ns_register_proc. --- NEW FILE: http_chunked.test --- # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://mozilla.org/. # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. # # The Original Code is AOLserver Code and related documentation # distributed by AOL. # # The Initial Developer of the Original Code is America Online, # Inc. Portions created by AOL are Copyright (C) 1999 America Online, # Inc. All Rights Reserved. # # Alternatively, the contents of this file may be used under the terms # of the GNU General Public License (the "GPL"), in which case the # provisions of GPL are applicable instead of those above. If you wish # to allow use of your version of this file only under the terms of the # GPL and not to allow others to use your version of this file under the # License, indicate your decision by deleting the provisions above and # replace them with the notice and other provisions required by the GPL. # If you do not delete the provisions above, a recipient may use your # version of this file under either the License or the GPL. # # # $Header: /cvsroot/naviserver/naviserver/tests/http_chunked.test,v 1.1 2005/07/21 10:43:09 sdeasey Exp $ # package require tcltest 2.2 namespace import -force ::tcltest::* eval ::tcltest::configure $argv if {[ns_config test listenport]} { testConstraint serverListen true } test http_chunked-1.1 {adp streaming w/chunks to HTTP/1.1 client} -constraints serverListen -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody t \ GET /http_chunked.adp?stream=1 } -result "200 chunked {} {a\r\n0123456789\r\n5\r\n01234\r\n0\r\n\r\n}" test http_chunked-1.2 {adp with buffered response} -constraints { serverListen knownBug } -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody t \ GET /http_chunked.adp?stream=0 } -result {200 {} 15 012345678901234} test http_chunked-1.3 {adp streaming to HTTP/1.0 client} -constraints serverListen -body { nstest_http -setheaders {Connection keep-alive} \ -getheaders {Transfer-Encoding Connection Content-Length} -getbody t \ GET /http_chunked.adp?stream=1 } -result {200 {} close {} 012345678901234} test http_chunked-2.1 {Tcl streaming w/chunks to HTTP/1.1 client} -constraints serverListen -setup { ns_register_proc GET /tclchunked { ns_conn chunked 1 ;# remove this explicit call ns_headers 200 text/plain ns_write 0123456789 ns_write 01234 ;#} } -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody 1 \ GET /tclchunked } -cleanup { ns_unregister_proc GET /tclchunked } -result "200 chunked {} {a\r\n0123456789\r\n5\r\n01234\r\n0\r\n\r\n}" test http_chunked-2.2 {Tcl streaming to HTTP/1.0 client} -constraints serverListen -setup { ns_register_proc GET /tclchunked { ns_headers 200 text/plain ns_write 0123456789 ns_write 01234 ;#} } -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody 1 \ GET /tclchunked } -cleanup { ns_unregister_proc GET /tclchunked } -result {200 {} {} 012345678901234} test http_chunked-2.3 {Tcl response of known size to HTTP/1.1 client} -constraints serverListen -setup { ns_register_proc GET /tclchunked {ns_return 200 text/plain 01234 ;#} } -body { nstest_http -http 1.1 -getheaders {Transfer-Encoding Content-Length} -getbody 1 \ GET /tclchunked } -cleanup { ns_unregister_proc GET /tclchunked } -result {200 {} 5 01234} cleanupTests --- ns_adp_chunked.test DELETED --- |