luetzkendorf 2004/07/28 05:00:48
Added: testsuite/testsuite/junit/xmltestcases/functional/get/conditional
getConditionalByETag.xml getConditionalByTime.xml
Log:
added testcases to verify conditional GETs
Revision Changes Path
1.1
jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/get/conditional/getConditionalByETag.xml
Index: getConditionalByETag.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract> Checkes whether If-Match and If-None-Match are handled correctly
</abstract>
<description>
put a file
get the file (store the responsed ETag at varETag)
get the file with If-Match: %varETag% (should return 200)
get the file with If-None-Match: %varETag% (should return 304)
put the file again (i.e. modifiy it)
get the file with If-Match: %varETag% (should return 412)
get the file with If-None-Match: %varETag% (should return 200)
</description>
<expectedResult> </expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<body fileReference="../../../contentDirectory/html.html" />
</request>
<response>
<command>HTTP/1.0 201 Created</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<header varDefinition="varETag">ETag: *</header>
<body fileReference="../../../contentDirectory/html.html" />
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<header varUsage="varETag">If-Match: %varETag%</header>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body fileReference="../../../contentDirectory/html.html" />
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<header varUsage="varETag">If-None-Match: %varETag%</header>
</request>
<response>
<command>HTTP/1.0 304 Not Modified</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<body fileReference="../../../contentDirectory/html.html" />
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<header varUsage="varETag">If-Match: %varETag%</header>
</request>
<response>
<command>HTTP/1.0 412 Precondition Failed</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<header varUsage="varETag">If-None-Match: %varETag%</header>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body fileReference="../../../contentDirectory/html.html" />
</response>
</step>
<cleanup>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">DELETE
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
</cleanup>
</test>
1.1
jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/get/conditional/getConditionalByTime.xml
Index: getConditionalByTime.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract> Checkes whether If-Modified-Since and If-Unmodified-Since are handled
correctly </abstract>
<description>
put a file
get the file (store the Last-Modified date at varLastMod)
get the file with If-Modified-Since: %varLastMod% (should return 304)
get the file with If-Unmodified-Since: %varLastMod% (should return 200)
waste some time (at least a second, otherwise the next PUT may not change
the Last-Modified date)
put the file again (i.e. modifiy it)
get the file with If-Modified-Since: %varLastMod% (should return 200)
get the file with If-Unmodified-Since: %varLastMod% (should return 412)
</description>
<expectedResult> </expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<body fileReference="../../../contentDirectory/html.html" />
</request>
<response>
<command>HTTP/1.0 201 Created</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<header varDefinition="varLastMod">Last-Modified: *</header>
<body fileReference="../../../contentDirectory/html.html" />
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<header varUsage="varLastMod">If-Modified-Since: %varLastMod%</header>
</request>
<response>
<command>HTTP/1.0 304 Not Modified</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<header varUsage="varLastMod">If-Unmodified-Since: %varLastMod%</header>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body fileReference="../../../contentDirectory/html.html" />
</response>
</step>
<repeater repeatCount="20">
<step>
<request>
<command
varUsage="globalVariableCollection,globalVariableServerName">PROPFIND
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<body/>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
</response>
</step>
</repeater>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<body fileReference="../../../contentDirectory/html.html" />
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<header varUsage="varLastMod">If-Modified-Since: %varLastMod%</header>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body fileReference="../../../contentDirectory/html.html" />
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
<header varUsage="varLastMod">If-Unmodified-Since: %varLastMod%</header>
</request>
<response>
<command>HTTP/1.0 412 Precondition Failed</command>
</response>
</step>
<cleanup>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">DELETE
/%globalVariableServerName%/%globalVariableCollection%/help-doc.html HTTP/1.1</command>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
</cleanup>
</test>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]