You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by lu...@apache.org on 2004/09/12 18:44:33 UTC
cvs commit: jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/conditional lockConditionalByETag.xml lockConditionalByETag2.xml
luetzkendorf 2004/09/12 09:44:33
Added: testsuite/testsuite/junit/xmltestcases/functional/get/conditional
getConditionalByTime2.xml
testsuite/testsuite/junit/xmltestcases/functional/lock/conditional
lockConditionalByETag.xml
lockConditionalByETag2.xml
Log:
some testcases for conditional lock (tests If-Match/If-None-Match header)
Revision Changes Path
1.1 jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/get/conditional/getConditionalByTime2.xml
Index: getConditionalByTime2.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 with non existing resources </abstract>
<description>
</description>
<expectedResult>all GETs should return 404</expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET /%globalVariableServerName%/%globalVariableCollection%/get.html HTTP/1.1</command>
<header>If-Modified-Since: Wed, 08 Sep 2004 18:34:22 GMT</header>
</request>
<response>
<command>HTTP/1.0 404 Not Found</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET /%globalVariableServerName%/%globalVariableCollection%/get.html HTTP/1.1</command>
<header>If-Unmodified-Since: Wed, 08 Sep 2004 18:34:22 GMT</header>
</request>
<response>
<command>HTTP/1.0 404 Not Found</command>
</response>
</step>
</test>
1.1 jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/conditional/lockConditionalByETag.xml
Index: lockConditionalByETag.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract>checks that LOCK works with If-Match and If-None-Match</abstract>
<description>
put file
get file (i.e. retrieve and store ETag)
lock If-None-Match --> 412
lock If-Match --> 200
unlock
put (modify --> changes ETag, but for next steps we use the old one)
lock If-Match ETag --> 412
lock If-None-Match --> 200
delete
</description>
<expectedResult></expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/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%/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">LOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header>Timeout: Second-604800</header>
<header>Content-Type: text/xml</header>
<header varUsage="varETag">If-None-Match: %varETag%</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:write/></A:locktype>
<A:lockscope><A:exclusive/></A:lockscope>
<owner xmlns="DAV:">some owner</owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 412 Precondition Failed</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header>Timeout: Second-604800</header>
<header>Content-Type: text/xml</header>
<header varUsage="varETag">If-Match: %varETag%</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:write/></A:locktype>
<A:lockscope><A:exclusive/></A:lockscope>
<owner xmlns="DAV:">some owner</owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body varUsage="globalVariableUserPath,globalVariableServerName,user,host" varDefinition="locktoken" varPath="prop/lockdiscovery/activelock/locktoken/href">
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<d:prop xmlns:d="DAV:">
<d:lockdiscovery>
<d:activelock>
<d:locktype><d:write/></d:locktype>
<d:lockscope><d:exclusive/></d:lockscope>
<d:depth>infinity</d:depth>
<d:timeout>Second-604800</d:timeout>
<d:locktoken><d:href /></d:locktoken>
<d:principal-URL><d:href>%globalVariableUserPath%</d:href></d:principal-URL>
<owner xmlns="DAV:">some owner</owner>
</d:activelock>
</d:lockdiscovery>
</d:prop>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">UNLOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header varUsage="locktoken">Lock-Token: %locktoken%</header>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/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">LOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header>Timeout: Second-604800</header>
<header>Content-Type: text/xml</header>
<header varUsage="varETag">If-Match: %varETag%</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:write/></A:locktype>
<A:lockscope><A:exclusive/></A:lockscope>
<owner xmlns="DAV:">some owner</owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 412 Precondition Failed</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header>Timeout: Second-604800</header>
<header>Content-Type: text/xml</header>
<header varUsage="varETag">If-None-Match: %varETag%</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:write/></A:locktype>
<A:lockscope><A:exclusive/></A:lockscope>
<owner xmlns="DAV:">some owner</owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body varUsage="globalVariableUserPath,globalVariableServerName,user,host" varDefinition="locktoken" varPath="prop/lockdiscovery/activelock/locktoken/href">
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<d:prop xmlns:d="DAV:">
<d:lockdiscovery>
<d:activelock>
<d:locktype><d:write/></d:locktype>
<d:lockscope><d:exclusive/></d:lockscope>
<d:depth>infinity</d:depth>
<d:timeout>Second-604800</d:timeout>
<d:locktoken><d:href /></d:locktoken>
<d:principal-URL><d:href>%globalVariableUserPath%</d:href></d:principal-URL>
<owner xmlns="DAV:">some owner</owner>
</d:activelock>
</d:lockdiscovery>
</d:prop>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">DELETE /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header varUsage="locktoken"><![CDATA[If: (<%locktoken%>)]]></header>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
</test>
1.1 jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/conditional/lockConditionalByETag2.xml
Index: lockConditionalByETag2.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract>checks that LOCK works with If-Match: * and If-None-Match: *</abstract>
<description>
(file does not exist)
lock file If-Match: * (412)
lock file If-None-Match: * (200)
unlock
put file (it now exists)
lock file If-None-Match: * (412)
lock file If-Match: * (200)
delete
</description>
<expectedResult></expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header>Timeout: Second-604800</header>
<header>Content-Type: text/xml</header>
<header>If-Match: *</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:write/></A:locktype>
<A:lockscope><A:exclusive/></A:lockscope>
<owner xmlns="DAV:">some owner</owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 412 Precondition Failed</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header>Timeout: Second-604800</header>
<header>Content-Type: text/xml</header>
<header>If-None-Match: *</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:write/></A:locktype>
<A:lockscope><A:exclusive/></A:lockscope>
<owner xmlns="DAV:">some owner</owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body varUsage="globalVariableUserPath,globalVariableServerName,user,host" varDefinition="locktoken" varPath="prop/lockdiscovery/activelock/locktoken/href">
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<d:prop xmlns:d="DAV:">
<d:lockdiscovery>
<d:activelock>
<d:locktype><d:write/></d:locktype>
<d:lockscope><d:exclusive/></d:lockscope>
<d:depth>infinity</d:depth>
<d:timeout>Second-604800</d:timeout>
<d:locktoken><d:href /></d:locktoken>
<d:principal-URL><d:href>%globalVariableUserPath%</d:href></d:principal-URL>
<owner xmlns="DAV:">some owner</owner>
</d:activelock>
</d:lockdiscovery>
</d:prop>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">UNLOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header varUsage="locktoken">Lock-Token: %locktoken%</header>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/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">LOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header>Timeout: Second-604800</header>
<header>Content-Type: text/xml</header>
<header>If-None-Match: *</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:write/></A:locktype>
<A:lockscope><A:exclusive/></A:lockscope>
<owner xmlns="DAV:">some owner</owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 412 Precondition Failed</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header>Timeout: Second-604800</header>
<header>Content-Type: text/xml</header>
<header>If-Match: *</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:write/></A:locktype>
<A:lockscope><A:exclusive/></A:lockscope>
<owner xmlns="DAV:">some owner</owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body varUsage="globalVariableUserPath,globalVariableServerName,user,host" varDefinition="locktoken" varPath="prop/lockdiscovery/activelock/locktoken/href">
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<d:prop xmlns:d="DAV:">
<d:lockdiscovery>
<d:activelock>
<d:locktype><d:write/></d:locktype>
<d:lockscope><d:exclusive/></d:lockscope>
<d:depth>infinity</d:depth>
<d:timeout>Second-604800</d:timeout>
<d:locktoken><d:href /></d:locktoken>
<d:principal-URL><d:href>%globalVariableUserPath%</d:href></d:principal-URL>
<owner xmlns="DAV:">some owner</owner>
</d:activelock>
</d:lockdiscovery>
</d:prop>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">DELETE /%globalVariableServerName%/%globalVariableCollection%/doc.html HTTP/1.1</command>
<header varUsage="locktoken"><![CDATA[If: (<%locktoken%>)]]></header>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
</test>
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org