<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test SYSTEM "../../../Tprocessor.dtd">
<test>
  <specification>
    <abstract>Sequence of requests Mac OS X issues when it tries to upload a file</abstract>
    <description>Does a series of requests to upload a file into a WebDAV server.</description>
    <expectedResult>Everything should just work out fine</expectedResult>
  </specification>
  <step>
    <request>
      <command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>

      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
      <header>Content-Type: text/xml</header>
      <header>Depth: 0</header>
      <body><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:getlastmodified/>
<D:getcontentlength/>
<D:resourcetype/>
</D:prop>
</D:propfind>

 ]]></body>
    </request>
    <response>
      <command>HTTP/1.1 404 Not Found</command>
    </response>
  </step>
  <step>
    <request>
      <command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>
      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
      <body></body>
    </request>
    <response>
      <command>HTTP/1.0 201 Created</command>
      <body />
    </response>
  </step>
  <step>
    <request>
      <command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>

      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
      <header>Content-Type: text/xml</header>
      <header>Depth: 0</header>
      <body><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:getlastmodified/>
<D:getcontentlength/>
<D:resourcetype/>
</D:prop>
</D:propfind>

 ]]></body>
    </request>
    <response>
      <command>HTTP/1.1 207 Etat Multiple</command>
      <body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
     <D:response>
         <D:href>/%globalVariableServerName%/%globalVariableCollection%/test.txt</D:href>
         <D:propstat>
             <D:prop>
                 <D:getlastmodified>*</D:getlastmodified>
                 <D:getcontentlength>0</D:getcontentlength>
                 <D:resourcetype />
             </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">GET /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>

      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
    </request>
    <response>
      <command>HTTP/1.1 200 OK</command>
      <header>Content-Length: 0</header>
    </response>
  </step>
  <step>
    <request>
      <command varUsage="globalVariableCollection,globalVariableServerName">LOCK /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>

      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
      <header>Content-Type: text/xml; charset="utf-8"</header>
      <header>Timeout: Second-600</header>
      <header>Depth: 0</header>
      <body><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
<D:locktype><D:write/></D:locktype>
<D:owner> <D:href>default-owner</D:href> </D:owner>
</D:lockinfo>
]]></body>
    </request>
    <response>
      <command>HTTP/1.1 200 OK</command>
      <body varUsage="globalVariableCollection,globalVariableServerName"><![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>0</D:depth>
             <D:owner>*</D:owner>
             <D:timeout>Second-599</D:timeout>
             <D:locktoken>*</D:locktoken>
         </D:activelock>
     </D:lockdiscovery>
</D:prop>
]]></body>
    </response>
  </step>
  <step>
    <request>
      <command varUsage="globalVariableCollection,globalVariableServerName">GET /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>
      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
    </request>
    <response>
      <command>HTTP/1.1 304 Non Modifi</command>
    </response>
  </step>
  <step>
    <request>
      <command varUsage="globalVariableCollection,globalVariableServerName">PUT /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>

      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
      <header>Content-Type: text/xml; charset="utf-8"</header>
      <body>Test</body>
    </request>
    <response>
      <command>HTTP/1.1 204 No Content</command>
      <header>Content-Length: 0</header>
    </response>
  </step>
  <step>
    <request>
      <command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>

      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
      <header>Content-Type: */*</header>
      <header>Depth: 0</header>
      <body><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:getlastmodified/>
</D:prop>
</D:propfind>
 ]]></body>
    </request>
    <response>
      <command>HTTP/1.1 207 Etat Multiple</command>
      <body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
     <D:response>
         <D:href>/%globalVariableServerName%/%globalVariableCollection%/test.txt</D:href>
         <D:propstat>
             <D:prop>
                 <D:getlastmodified>*</D:getlastmodified>
             </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">UNLOCK /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>

      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
      <header>Content-Type: text/xml; charset="utf-8"</header>
      <header>Depth: 0</header>
    </request>
    <response>
      <command>HTTP/1.1 204 No Content</command>
    </response>
  </step>
  <step>
    <request>
      <command varUsage="globalVariableCollection,globalVariableServerName">PROPFIND /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>

      <header>User-Agent: WebDAVFS/1.2.7 (01278000) Darwin/7.5.0 (Power Macintosh)</header>
      <header>Accept: */*</header>
      <header>Content-Type: text/xml</header>
      <header>Depth: 0</header>
      <body><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:getlastmodified/>
<D:getcontentlength/>
<D:resourcetype/>
</D:prop>
</D:propfind>

 ]]></body>
    </request>
    <response>
      <command>HTTP/1.1 207 Etat Multiple</command>
      <body varUsage="globalVariableCollection,globalVariableServerName"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
     <D:response>
         <D:href>/%globalVariableServerName%/%globalVariableCollection%/test.txt</D:href>
         <D:propstat>
             <D:prop>
                 <D:getlastmodified>*</D:getlastmodified>
                 <D:getcontentlength>4</D:getcontentlength>
                 <D:resourcetype />
             </D:prop>
             <D:status>HTTP/1.1 200 OK</D:status>
         </D:propstat>
     </D:response>
</D:multistatus>
]]></body>
    </response>
  </step>
  <cleanup>
    <step>
      <request>
        <command varUsage="globalVariableCollection,globalVariableServerName">DELETE /%globalVariableServerName%/%globalVariableCollection%/test.txt HTTP/1.1</command>
      </request>
      <response>
        <command>HTTP/1.0 204 No Content</command>
      </response>
    </step>
  </cleanup>
</test>
