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:926:   // on the deleted resource   public void test_locks_deleted_when_resource_deleted_1()   {    // Test on a file    string path = Stdio.append_path(this::testcase_dir, "myfile.txt");    webdav_put(path, "My content", STATUS_CREATED);    mapping(string:string) locks = ([]);    webdav_lock(path, locks, STATUS_OK);    webdav_put(path, "New content", STATUS_LOCKED);    -  current_locks = locks; +  current_locks = locks + ([]);    webdav_delete(path, locks, STATUS_NO_CONTENT); -  +  +  webdav_put(path, "New content", STATUS_PRECONDITION_FAILED);    current_locks = ([ ]);       webdav_put(path, "New content", STATUS_CREATED);   }      public void test_locks_deleted_when_resource_deleted_2()   {    // Test on a directory    string dir = Stdio.append_path(this::testcase_dir, "mydir");    webdav_mkcol(dir, STATUS_CREATED);    mapping(string:string) locks = ([]);    webdav_lock(dir, locks, STATUS_OK);    string subdir = Stdio.append_path(dir, "subdir");    webdav_mkcol(subdir, STATUS_LOCKED);       current_locks = locks + ([]);    webdav_delete(dir, locks, STATUS_NO_CONTENT);    -  +  webdav_mkcol(dir, STATUS_PRECONDITION_FAILED); +  +  current_locks = locks + ([]);    webdav_mkcol(dir, STATUS_CREATED);    webdav_mkcol(subdir, STATUS_CREATED);   }      public void test_locks_deleted_when_resource_deleted_3()   {    // Test on a file but the delete entire directory and create directory and    // put file.    string dir = Stdio.append_path(this::testcase_dir, "mydir");    string file = Stdio.append_path(dir, "myfile.txt");    webdav_mkcol(dir, STATUS_CREATED);    webdav_put(file, "My content", STATUS_CREATED);    mapping(string:string) locks = ([]);    webdav_lock(file, locks, STATUS_OK);    webdav_put(file, "New content", STATUS_LOCKED);       current_locks = locks + ([]);    webdav_delete(dir, locks, STATUS_NO_CONTENT); -  webdav_ls(this::testcase_dir, ({ this::testcase_dir })); +     -  +  // NB: The PROPFIND and MKCOL don't submit the old lock token, +  // as it is on a sub-path, and such locks should +  // typically not exist for MKCOL... +  webdav_ls(this::testcase_dir, ({ this::testcase_dir }));    webdav_mkcol(dir, STATUS_CREATED); -  +  +  webdav_put(file, "New content", STATUS_PRECONDITION_FAILED); +  current_locks = locks + ([]);    webdav_put(file, "New content", STATUS_CREATED);   }      // A server processing a successful DELETE request must remove the mapping from   // the Request-URI to any resource.   // Thus, after a successful DELETE operation (and in the absence of   // other actions), a subsequent GET/HEAD/PROPFIND request to the target   // Request-URI MUST return 404 (Not Found).   public void test_delete()   {