Roxen.git / server / etc / test / modules / TEST.pmod / http.pmod / WebDAV.pmod / TestBase.pike

version» Context lines:

Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:1804:    string child = Stdio.append_path(src, "child");    string dst = Stdio.append_path(this::testcase_dir, "dst");    webdav_mkcol(src_parent, STATUS_CREATED);    webdav_mkcol(src, STATUS_CREATED);    webdav_put(child, "Child content", STATUS_CREATED);    foreach (({src_parent, src, child}), string resource_to_lock) {    mapping(string:string) locks = ([]);    webdav_lock(resource_to_lock, locks, STATUS_OK);    WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_LOCKED);    verify_lock_token(res); -  webdav_unlock(resource_to_lock, locks, STATUS_OK); +  webdav_unlock(resource_to_lock, locks, STATUS_NO_CONTENT);    }    WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_CREATED);    webdav_ls(this::testcase_dir,    ({ this::testcase_dir,    src_parent,    dst,    Stdio.append_path(dst, "child") }));   }      // 423 (Locked) - The source or the destination resource, the source or   // destination resource parent, or some resource within the source or   // destination collection, was locked. This response SHOULD contain the   // 'lock-token-submitted' precondition element.   public void test_move_destination_locked()   {    string child_name = "child";    string src = Stdio.append_path(this::testcase_dir, "src");    string src_child = Stdio.append_path(src, child_name);    string dst_parent = Stdio.append_path(this::testcase_dir, "dst_parent");    string dst = Stdio.append_path(dst_parent, "dst"); -  string dst_child = Stdio.append_path(dst_parent, child_name); // Must be same name as src child! +  string dst_child = Stdio.append_path(dst, child_name); // Must be same name as src child!    foreach (({src, dst_parent, dst}), string col) {    webdav_mkcol(col, STATUS_CREATED);    }    webdav_put(src_child, "src child content", STATUS_CREATED);    webdav_put(dst_child, "dst child content", STATUS_CREATED);    foreach (({dst_parent, dst, dst_child}), string resource_to_lock) {    mapping(string:string) locks = ([]);    webdav_lock(resource_to_lock, locks, STATUS_OK);    WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_LOCKED);    verify_lock_token(res); -  webdav_unlock(resource_to_lock, locks, STATUS_OK); +  webdav_unlock(resource_to_lock, locks, STATUS_NO_CONTENT);    } -  WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_CREATED); +  WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_NO_CONTENT); +  filesystem_check_content(dst_child, "src child content");    webdav_ls(this::testcase_dir,    ({ this::testcase_dir, -  +  dst_parent,    dst,    dst_child }));   }      // 502 (Bad Gateway) - This may occur when the destination is on another   // server and the destination server refuses to accept the resource.   // This could also occur when the destination is on another sub-section   // of the same server namespace.   //   // Skip testing this for now...