1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.webdav.test; |
21 |
|
|
22 |
|
import org.apache.jackrabbit.webdav.DavServletResponse; |
23 |
|
import org.junit.After; |
24 |
|
import org.junit.Test; |
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
@version |
30 |
|
@since |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (19) |
Complexity: 4 |
Complexity Density: 0.27 |
|
32 |
|
public class TempFileTest extends AbstractWebDAVTest |
33 |
|
{ |
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
public static final String TEMP_ROOT = ROOT + "/.temp"; |
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
39 |
2 |
@Override... |
40 |
|
public void setUp() throws Exception |
41 |
|
{ |
42 |
2 |
super.setUp(); |
43 |
2 |
mkCol(TEMP_ROOT, DavServletResponse.SC_CREATED); |
44 |
|
} |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
49 |
1 |
@Test... |
50 |
|
public void testTempCollectionOperations() throws Exception |
51 |
|
{ |
52 |
1 |
String tempCollectionUrl = TEMP_ROOT + "/temp"; |
53 |
|
|
54 |
1 |
mkCol(tempCollectionUrl, DavServletResponse.SC_CREATED); |
55 |
|
|
56 |
1 |
move(tempCollectionUrl, "/xwiki/webdav/.temp/temp2", DavServletResponse.SC_FORBIDDEN); |
57 |
|
|
58 |
1 |
delete(tempCollectionUrl, DavServletResponse.SC_NO_CONTENT); |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
64 |
1 |
@Test... |
65 |
|
public void testTempFileOperations() throws Exception |
66 |
|
{ |
67 |
1 |
String tempFileUrl = TEMP_ROOT + "/temp.txt"; |
68 |
1 |
String destinationUrl = TEMP_ROOT + "/temp2.txt"; |
69 |
1 |
String relativeDestinationUrl = "/xwiki/webdav/.temp/temp2.txt"; |
70 |
|
|
71 |
1 |
put(tempFileUrl, "Content", DavServletResponse.SC_CREATED); |
72 |
|
|
73 |
1 |
get(tempFileUrl, DavServletResponse.SC_OK); |
74 |
|
|
75 |
1 |
move(tempFileUrl, relativeDestinationUrl, DavServletResponse.SC_CREATED); |
76 |
|
|
77 |
1 |
get(destinationUrl, DavServletResponse.SC_OK); |
78 |
|
|
79 |
1 |
delete(destinationUrl, DavServletResponse.SC_NO_CONTENT); |
80 |
|
} |
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
82 |
2 |
@After... |
83 |
|
public void tearDown() throws Exception |
84 |
|
{ |
85 |
2 |
delete(TEMP_ROOT, DavServletResponse.SC_NO_CONTENT); |
86 |
|
} |
87 |
|
} |