1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.rest; |
21 |
|
|
22 |
|
import org.apache.commons.httpclient.HttpStatus; |
23 |
|
import org.apache.commons.httpclient.methods.GetMethod; |
24 |
|
import org.junit.Assert; |
25 |
|
import org.junit.Test; |
26 |
|
import org.xwiki.rest.model.jaxb.Class; |
27 |
|
import org.xwiki.rest.model.jaxb.Classes; |
28 |
|
import org.xwiki.rest.model.jaxb.Property; |
29 |
|
import org.xwiki.rest.resources.classes.ClassesResource; |
30 |
|
import org.xwiki.test.rest.framework.AbstractHttpTest; |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.14 |
|
32 |
|
public class ClassesResourceTest extends AbstractHttpTest |
33 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
34 |
1 |
@Override... |
35 |
|
@Test |
36 |
|
public void testRepresentation() throws Exception |
37 |
|
{ |
38 |
1 |
GetMethod getMethod = executeGet(buildURI(ClassesResource.class, getWiki()).toString()); |
39 |
1 |
Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode()); |
40 |
|
|
41 |
1 |
Classes classes = (Classes) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream()); |
42 |
|
|
43 |
1 |
for (Class clazz : classes.getClazzs()) { |
44 |
25 |
checkLinks(clazz); |
45 |
|
|
46 |
25 |
for (Property property : clazz.getProperties()) { |
47 |
183 |
checkLinks(property); |
48 |
|
} |
49 |
|
} |
50 |
|
} |
51 |
|
} |