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:43:33 UTC
cvs commit: jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/transactions txnProppatchAbort.xml txnProppatchCommit.xml txnPutAbort.xml txnPutCommit.xml
luetzkendorf 2004/09/12 09:43:33
Added: testsuite/testsuite/junit/xmltestcases/functional/lock/transactions
txnProppatchAbort.xml txnProppatchCommit.xml
txnPutAbort.xml txnPutCommit.xml
Log:
some testcases for external transactions
Revision Changes Path
1.1 jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/transactions/txnProppatchAbort.xml
Index: txnProppatchAbort.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract>Tests PROPFIND inside external transaction that is aborted</abstract>
<description>
put file
proppatch (sets displayname to XXX)
lock (begin txn)
proppatch (sets displayname to YYY)
propfind (tests displayname == YYY)
unlock (commit txn)
propfind (tests displayname == XXX)
delete file
</description>
<expectedResult>the property should have the value set BEFORE txn after rollback</expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<body>ABCDEFGHIJKLMNOPQRSTUVWXYZ</body>
</request>
<response>
<command>HTTP/1.0 201 Created</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPPATCH /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header>Content-Type: text/xml</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<D:propertyupdate xmlns:D="DAV:">
<D:set>
<D:prop>
<D:displayname>Before Transaction</D:displayname>
</D:prop>
</D:set>
</D:propertyupdate>
]]></body>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV">
<d:response>
<d:href>/%globalVariableServerName%/%globalVariableCollection%/file.html</d:href>
<d:propstat>
<d:prop><d:displayname/></d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/ HTTP/1.1</command>
<header>Timeout: Second-120</header>
<header>Content-Type: text/xml</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:transaction/></A:locktype>
<A:locktype><A:transaction><A:groupoperation/></A:transaction></A:locktype>
<A:lockscope><A:local/></A:lockscope>
<A:owner>some owner</A:owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body varUsage="globalVariableUserPath,globalVariableServerName,user,host"
varDefinition="txnId" 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:transaction><d:groupoperation/></d:transaction></d:locktype>
<d:lockscope><d:local/></d:lockscope>
<d:depth>0</d:depth>
<d:timeout>Second-120</d:timeout>
<d:locktoken><d:href/></d:locktoken>
<d:principal-URL><d:href>%globalVariableUserPath%</d:href></d:principal-URL>
<d:owner>some owner</d:owner>
</d:activelock>
</d:lockdiscovery>
</d:prop>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPPATCH /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header>Content-Type: text/xml</header>
<header varUsage="txnId"><![CDATA[Transaction: <%txnId%>]]></header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<D:propertyupdate xmlns:D="DAV:" xmlns:R="http://www.com/">
<D:set>
<D:prop>
<D:displayname>Inside Transaction</D:displayname>
</D:prop>
</D:set>
</D:propertyupdate>
]]></body>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV">
<d:response>
<d:href>/%globalVariableServerName%/%globalVariableCollection%/file.html</d:href>
<d:propstat>
<d:prop><displayname/></d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header>Content-Type: text/xml</header>
<header varUsage="txnId"><![CDATA[Transaction: <%txnId%>]]></header>
<header>Depth: 1</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:">
<prop><displayname/></prop>
</propfind>
]]></body>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<multistatus xmlns="DAV:" xmlns:S="http://jakarta.apache.org/slide/">
<response>
<href>/%globalVariableServerName%/%globalVariableCollection%/file.html</href>
<propstat>
<prop><displayname>Inside Transaction</displayname></prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">UNLOCK /%globalVariableServerName%/%globalVariableCollection% HTTP/1.1</command>
<header varUsage="txnId">Lock-Token: %txnId%</header>
<body><![CDATA[<?xml version="1.0"?>
<d:transactioninfo xmlns:d="DAV:">
<d:transactionstatus><d:abort/></d:transactionstatus>
</d:transactioninfo>
]]>
</body>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header>Content-Type: text/xml</header>
<header>Depth: 1</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:">
<prop><displayname/></prop>
</propfind>
]]></body>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<multistatus xmlns="DAV:" xmlns:S="http://jakarta.apache.org/slide/">
<response>
<href>/%globalVariableServerName%/%globalVariableCollection%/file.html</href>
<propstat>
<prop><displayname>Before Transaction</displayname></prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">DELETE /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
</test>
1.1 jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/transactions/txnProppatchCommit.xml
Index: txnProppatchCommit.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract>Tests PROPFIND inside external transaction that is commited</abstract>
<description>
put file
proppatch (sets displayname to XXX)
lock (begin txn)
proppatch (sets displayname to YYY)
propfind (tests displayname == YYY)
unlock (commit txn)
propfind (tests displayname == YYY)
delete file
</description>
<expectedResult>the property should have the value set inside txn after commit</expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<body>ABCDEFGHIJKLMNOPQRSTUVWXYZ</body>
</request>
<response>
<command>HTTP/1.0 201 Created</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPPATCH /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header>Content-Type: text/xml</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<D:propertyupdate xmlns:D="DAV:">
<D:set>
<D:prop>
<D:displayname>Before Transaction</D:displayname>
</D:prop>
</D:set>
</D:propertyupdate>
]]></body>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV">
<d:response>
<d:href>/%globalVariableServerName%/%globalVariableCollection%/file.html</d:href>
<d:propstat>
<d:prop><d:displayname/></d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/ HTTP/1.1</command>
<header>Timeout: Second-120</header>
<header>Content-Type: text/xml</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:transaction/></A:locktype>
<A:locktype><A:transaction><A:groupoperation/></A:transaction></A:locktype>
<A:lockscope><A:local/></A:lockscope>
<A:owner>some owner</A:owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body varUsage="globalVariableUserPath,globalVariableServerName,user,host"
varDefinition="txnId" 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:transaction><d:groupoperation/></d:transaction></d:locktype>
<d:lockscope><d:local/></d:lockscope>
<d:depth>0</d:depth>
<d:timeout>Second-120</d:timeout>
<d:locktoken><d:href/></d:locktoken>
<d:principal-URL><d:href>%globalVariableUserPath%</d:href></d:principal-URL>
<d:owner>some owner</d:owner>
</d:activelock>
</d:lockdiscovery>
</d:prop>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPPATCH /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header>Content-Type: text/xml</header>
<header varUsage="txnId"><![CDATA[Transaction: <%txnId%>]]></header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<D:propertyupdate xmlns:D="DAV:" xmlns:R="http://www.com/">
<D:set>
<D:prop>
<D:displayname>Inside Transaction</D:displayname>
</D:prop>
</D:set>
</D:propertyupdate>
]]></body>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV">
<d:response>
<d:href>/%globalVariableServerName%/%globalVariableCollection%/file.html</d:href>
<d:propstat>
<d:prop><displayname/></d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header>Content-Type: text/xml</header>
<header varUsage="txnId"><![CDATA[Transaction: <%txnId%>]]></header>
<header>Depth: 1</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:">
<prop><displayname/></prop>
</propfind>
]]></body>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<multistatus xmlns="DAV:" xmlns:S="http://jakarta.apache.org/slide/">
<response>
<href>/%globalVariableServerName%/%globalVariableCollection%/file.html</href>
<propstat>
<prop><displayname>Inside Transaction</displayname></prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">UNLOCK /%globalVariableServerName%/%globalVariableCollection% HTTP/1.1</command>
<header varUsage="txnId">Lock-Token: %txnId%</header>
<body><![CDATA[<?xml version="1.0"?>
<d:transactioninfo xmlns:d="DAV:">
<d:transactionstatus><d:commit/></d:transactionstatus>
</d:transactioninfo>
]]>
</body>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header>Content-Type: text/xml</header>
<header>Depth: 1</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:">
<prop><displayname/></prop>
</propfind>
]]></body>
</request>
<response>
<command>HTTP/1.0 207 Multi-Status</command>
<body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<multistatus xmlns="DAV:" xmlns:S="http://jakarta.apache.org/slide/">
<response>
<href>/%globalVariableServerName%/%globalVariableCollection%/file.html</href>
<propstat>
<prop><displayname>Inside Transaction</displayname></prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">DELETE /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
</test>
1.1 jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/transactions/txnPutAbort.xml
Index: txnPutAbort.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract>tests PUT in external transaction that is aborted</abstract>
<description>
lock (begin txn)
put
get (test that the file exists inside txn)
unlock (rollback)
delete (returns "404 Not Found"; test that the file does not exist after abortion)
</description>
<expectedResult>file should NOT exist after transaction</expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/ HTTP/1.1</command>
<header>Timeout: Second-120</header>
<header>Content-Type: text/xml</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:transaction><A:groupoperation/></A:transaction></A:locktype>
<A:lockscope><A:local/></A:lockscope>
<A:owner>some owner</A:owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body varUsage="globalVariableUserPath,globalVariableServerName,user,host"
varDefinition="txnId" 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:transaction><d:groupoperation/></d:transaction></d:locktype>
<d:lockscope><d:local/></d:lockscope>
<d:depth>0</d:depth>
<d:timeout>Second-120</d:timeout>
<d:locktoken><d:href/></d:locktoken>
<d:principal-URL><d:href>%globalVariableUserPath%</d:href></d:principal-URL>
<d:owner>some owner</d:owner>
</d:activelock>
</d:lockdiscovery>
</d:prop>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header varUsage="txnId"><![CDATA[Transaction: <%txnId%>]]></header>
<body>ABCDEFGHIJKLMNOPQRSTUVWXYZ</body>
</request>
<response>
<command>HTTP/1.0 201 Created</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header varUsage="txnId"><![CDATA[Transaction: <%txnId%>]]></header>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body>ABCDEFGHIJKLMNOPQRSTUVWXYZ</body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">UNLOCK /%globalVariableServerName%/%globalVariableCollection% HTTP/1.1</command>
<header varUsage="txnId">Lock-Token: %txnId%</header>
<body><![CDATA[<?xml version="1.0"?>
<d:transactioninfo xmlns:d="DAV:">
<d:transactionstatus><d:abort/></d:transactionstatus>
</d:transactioninfo>
]]>
</body>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">DELETE /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
</request>
<response>
<command>HTTP/1.0 404 Not Found</command>
</response>
</step>
</test>
1.1 jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/transactions/txnPutCommit.xml
Index: txnPutCommit.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract>tests PUT in external transaction that is commited</abstract>
<description>
lock (begin txn)
put
get
unlock (commit)
delete (test that the file exists after commit)
</description>
<expectedResult>file should exist after transaction</expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/ HTTP/1.1</command>
<header>Timeout: Second-120</header>
<header>Content-Type: text/xml</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<A:lockinfo xmlns:A="DAV:">
<A:locktype><A:transaction/></A:locktype>
<A:locktype><A:transaction><A:groupoperation/></A:transaction></A:locktype>
<A:lockscope><A:local/></A:lockscope>
<A:owner>some owner</A:owner>
</A:lockinfo>
]]></body>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body varUsage="globalVariableUserPath,globalVariableServerName,user,host"
varDefinition="txnId" 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:transaction><d:groupoperation/></d:transaction></d:locktype>
<d:lockscope><d:local/></d:lockscope>
<d:depth>0</d:depth>
<d:timeout>Second-120</d:timeout>
<d:locktoken><d:href/></d:locktoken>
<d:principal-URL><d:href>%globalVariableUserPath%</d:href></d:principal-URL>
<d:owner>some owner</d:owner>
</d:activelock>
</d:lockdiscovery>
</d:prop>
]]></body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header varUsage="txnId"><![CDATA[Transaction: <%txnId%>]]></header>
<body>ABCDEFGHIJKLMNOPQRSTUVWXYZ</body>
</request>
<response>
<command>HTTP/1.0 201 Created</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">GET /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
<header varUsage="txnId"><![CDATA[Transaction: <%txnId%>]]></header>
</request>
<response>
<command>HTTP/1.0 200 OK</command>
<body>ABCDEFGHIJKLMNOPQRSTUVWXYZ</body>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">UNLOCK /%globalVariableServerName%/%globalVariableCollection% HTTP/1.1</command>
<header varUsage="txnId">Lock-Token: %txnId%</header>
<body><![CDATA[<?xml version="1.0"?>
<d:transactioninfo xmlns:d="DAV:">
<d:transactionstatus><d:commit/></d:transactionstatus>
</d:transactioninfo>
]]>
</body>
</request>
<response>
<command>HTTP/1.0 204 No Content</command>
</response>
</step>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">DELETE /%globalVariableServerName%/%globalVariableCollection%/file.html HTTP/1.1</command>
</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