luetzkendorf 2004/09/17 08:33:38
Added: testsuite/testsuite/junit/xmltestcases/functional/lock/null-resources
lockNullFile_Timeout.xml lockNullFile_Timeout2.xml
Log:
test cases to Lock-Null resources that are timed out to reproduce bug 31156
Revision Changes Path
1.1
jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/null-resources/lockNullFile_Timeout.xml
Index: lockNullFile_Timeout.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract>checks that a lock null resource disapears after timeout</abstract>
<description>
LOCK (with timeout: 1 sec)
wait 3 sec
PROPFIND
</description>
<expectedResult>last PROPFIND sould return 404 because the lock is timed
out</expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK
/%globalVariableServerName%/%globalVariableCollection%/testLockNullFile.xml
HTTP/1.1</command>
<header>Timeout: Second-1</header>
<header>Content-Type: text/xml</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<D:lockinfo xmlns:D="DAV:">
<D:locktype><D:write/></D:locktype>
<D:lockscope><D:exclusive/></D:lockscope>
<owner xmlns="DAV:">some owner</owner>
</D: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-1</d:timeout>
<d:locktoken><d:href>*</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>
<wait time="3000"/>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND
/%globalVariableServerName%/%globalVariableCollection%/testLockNullFile.xml
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 404 Not Found</command>
</response>
</step>
</test>
1.1
jakarta-slide/testsuite/testsuite/junit/xmltestcases/functional/lock/null-resources/lockNullFile_Timeout2.xml
Index: lockNullFile_Timeout2.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../../Tprocessor.dtd">
<test>
<specification>
<abstract>checks that a lock null resource is no longer listed as member (of it
parent collection) after timeout</abstract>
<description>
LOCK (with timeout: 1 sec)
wait 3 sec
PROPFIND (on parent collection)
</description>
<expectedResult>last PROPFIND sould return 207 but should not contain the
lock-null resource because the lock is timed out</expectedResult>
</specification>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">LOCK
/%globalVariableServerName%/%globalVariableCollection%/testLockNullFile.xml
HTTP/1.1</command>
<header>Timeout: Second-1</header>
<header>Content-Type: text/xml</header>
<body><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<D:lockinfo xmlns:D="DAV:">
<D:locktype><D:write/></D:locktype>
<D:lockscope><D:exclusive/></D:lockscope>
<owner xmlns="DAV:">some owner</owner>
</D: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-1</d:timeout>
<d:locktoken><d:href>*</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>
<wait time="3000"/>
<step>
<request>
<command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND
/%globalVariableServerName%/%globalVariableCollection% 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"?>
<d:multistatus xmlns:d="DAV">
<d:response>
<d:href>/%globalVariableServerName%/%globalVariableCollection%</d:href>
<d:propstat>
<d:prop><displayname>files</displayname></d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
]]></body>
</response>
</step>
</test>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]