1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.filter.type; |
21 |
|
|
22 |
|
import org.junit.Assert; |
23 |
|
import org.junit.Test; |
24 |
|
|
25 |
|
|
26 |
|
@link |
27 |
|
|
28 |
|
@version |
29 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (28) |
Complexity: 6 |
Complexity Density: 0.27 |
|
30 |
|
public class FilterStreamTypeTest |
31 |
|
{ |
32 |
|
|
33 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
34 |
1 |
@Test... |
35 |
|
public void testSerializeWithDataAndVersion() |
36 |
|
{ |
37 |
1 |
FilterStreamType type = new FilterStreamType(new SystemType("type"), "data", "version"); |
38 |
|
|
39 |
1 |
Assert.assertEquals("type+data/version", type.serialize()); |
40 |
|
} |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
42 |
1 |
@Test... |
43 |
|
public void testUnserializeWithDataAndVersion() |
44 |
|
{ |
45 |
1 |
FilterStreamType type = FilterStreamType.unserialize("type+data/version"); |
46 |
|
|
47 |
1 |
Assert.assertEquals("type", type.getType().getId()); |
48 |
1 |
Assert.assertEquals("data", type.getDataFormat()); |
49 |
1 |
Assert.assertEquals("version", type.getVersion()); |
50 |
|
} |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
52 |
1 |
@Test... |
53 |
|
public void testUnserializeWithData() |
54 |
|
{ |
55 |
1 |
FilterStreamType type = FilterStreamType.unserialize("type+data"); |
56 |
|
|
57 |
1 |
Assert.assertEquals("type", type.getType().getId()); |
58 |
1 |
Assert.assertEquals("data", type.getDataFormat()); |
59 |
1 |
Assert.assertNull(type.getVersion()); |
60 |
|
} |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
62 |
1 |
@Test... |
63 |
|
public void testUnserializeWithEmptyData() |
64 |
|
{ |
65 |
1 |
FilterStreamType type = FilterStreamType.unserialize("type+"); |
66 |
|
|
67 |
1 |
Assert.assertEquals("type", type.getType().getId()); |
68 |
1 |
Assert.assertEquals("", type.getDataFormat()); |
69 |
1 |
Assert.assertNull(type.getVersion()); |
70 |
|
} |
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
72 |
1 |
@Test... |
73 |
|
public void testUnserializeWithVersion() |
74 |
|
{ |
75 |
1 |
FilterStreamType type = FilterStreamType.unserialize("type/version"); |
76 |
|
|
77 |
1 |
Assert.assertEquals("type", type.getType().getId()); |
78 |
1 |
Assert.assertNull(type.getDataFormat()); |
79 |
1 |
Assert.assertEquals("version", type.getVersion()); |
80 |
|
} |
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
82 |
1 |
@Test... |
83 |
|
public void testUnserializeWithEmptyVersion() |
84 |
|
{ |
85 |
1 |
FilterStreamType type = FilterStreamType.unserialize("type/"); |
86 |
|
|
87 |
1 |
Assert.assertEquals("type", type.getType().getId()); |
88 |
1 |
Assert.assertNull(type.getDataFormat()); |
89 |
1 |
Assert.assertEquals("", type.getVersion()); |
90 |
|
} |
91 |
|
} |