Skip to content

Commit 067c50b

Browse files
committed
Added testcases, thnx @joe !
1 parent 87bf0b4 commit 067c50b

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
(:
2+
: eXist-db Open Source Native XML Database
3+
: Copyright (C) 2001 The eXist-db Authors
4+
:
5+
6+
: http://www.exist-db.org
7+
:
8+
: This library is free software; you can redistribute it and/or
9+
: modify it under the terms of the GNU Lesser General Public
10+
: License as published by the Free Software Foundation; either
11+
: version 2.1 of the License, or (at your option) any later version.
12+
:
13+
: This library is distributed in the hope that it will be useful,
14+
: but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
: Lesser General Public License for more details.
17+
:
18+
: You should have received a copy of the GNU Lesser General Public
19+
: License along with this library; if not, write to the Free Software
20+
: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
:)
22+
xquery version "3.1";
23+
24+
module namespace guest="http://exist-db.org/xquery/guest";
25+
declare namespace test="http://exist-db.org/xquery/xqsuite";
26+
27+
declare
28+
%test:setUp
29+
function guest:setup() {
30+
xmldb:create-collection("/db", "test"),
31+
xmldb:store("/db/test", "test.xml", <foo/>)
32+
};
33+
declare
34+
%test:tearDown
35+
function guest:tearDown() {
36+
xmldb:remove("/db/test")
37+
};
38+
declare
39+
%test:user("guest", "guest")
40+
%test:assertError("java:org.xmldb.api.base.XMLDBException")
41+
function guest:create-collection() {
42+
xmldb:create-collection("/db", "guest-collection")
43+
};
44+
declare
45+
%test:user("guest", "guest")
46+
%test:assertError("java:org.xmldb.api.base.XMLDBException")
47+
function guest:store-document() {
48+
xmldb:store("/db/test", "test2.xml", <guest-was-here/>)
49+
};
50+
declare
51+
%test:user("guest", "guest")
52+
%test:assertError("java:org.xmldb.api.base.XMLDBException")
53+
function guest:overwrite-document() {
54+
xmldb:store("/db/test", "test.xml", <guest-was-here/>)
55+
};
56+
declare
57+
%test:user("guest", "guest")
58+
%test:assertError("java:org.xmldb.api.base.XMLDBException")
59+
function guest:remove-document() {
60+
xmldb:remove("/db/test", "test.xml")
61+
};
62+
declare
63+
%test:user("guest", "guest")
64+
%test:assertError("java:org.xmldb.api.base.XMLDBException")
65+
function guest:remove-collection() {
66+
xmldb:remove("/db/test")
67+
};

0 commit comments

Comments
 (0)