1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.base.io; |
17 |
|
|
18 |
|
import org.qedeq.base.test.QedeqTestCase; |
19 |
|
|
20 |
|
|
21 |
|
@link |
22 |
|
|
23 |
|
@author |
24 |
|
|
|
|
| 95.8% |
Uncovered Elements: 3 (71) |
Complexity: 12 |
Complexity Density: 0.19 |
|
25 |
|
public class SourceAreaTest extends QedeqTestCase { |
26 |
|
|
27 |
|
|
28 |
|
private SourceArea object1; |
29 |
|
|
30 |
|
|
31 |
|
private SourceArea object2; |
32 |
|
|
33 |
|
|
34 |
|
private SourceArea object3; |
35 |
|
|
36 |
|
|
37 |
|
private SourceArea object4; |
38 |
|
|
39 |
|
|
40 |
|
private SourceArea object5; |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
42 |
7
|
protected void setUp() throws Exception {... |
43 |
7
|
super.setUp(); |
44 |
7
|
object1 = new SourceArea("file:///var/opt/qedeq/001/set_theory_v1.qedeq", |
45 |
|
new SourcePosition(12, 17), |
46 |
|
new SourcePosition(13, 19) |
47 |
|
); |
48 |
7
|
object2 = new SourceArea("file:///var/opt/qedeq/001/set_theory_v1.qedeq", |
49 |
|
new SourcePosition(12, 17), |
50 |
|
new SourcePosition(13, 19) |
51 |
|
); |
52 |
7
|
object3 = new SourceArea("file:///var/opt/qedeq/001/set_theory_v2.qedeq", |
53 |
|
new SourcePosition(12, 17), |
54 |
|
new SourcePosition(13, 19) |
55 |
|
); |
56 |
7
|
object4 = new SourceArea("file:///var/opt/qedeq/001/set_theory_v1.qedeq", |
57 |
|
new SourcePosition(13, 17), |
58 |
|
new SourcePosition(13, 19) |
59 |
|
); |
60 |
7
|
object5 = new SourceArea("file:///var/opt/qedeq/001/set_theory_v1.qedeq", |
61 |
|
new SourcePosition(12, 19), |
62 |
|
new SourcePosition(13, 19) |
63 |
|
); |
64 |
|
} |
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
7
|
protected void tearDown() throws Exception {... |
67 |
7
|
super.tearDown(); |
68 |
|
} |
69 |
|
|
|
|
| 66.7% |
Uncovered Elements: 3 (9) |
Complexity: 4 |
Complexity Density: 0.44 |
1
PASS
|
|
70 |
1
|
public void testSourceArea() {... |
71 |
1
|
try { |
72 |
1
|
new SourceArea(null, |
73 |
|
new SourcePosition(12, 17), |
74 |
|
new SourcePosition(13, 19) |
75 |
|
); |
76 |
0
|
fail("RuntimeException expected"); |
77 |
|
} catch (NullPointerException e) { |
78 |
|
|
79 |
|
} |
80 |
1
|
try { |
81 |
1
|
new SourceArea("file:///var/opt/qedeq/001/set_theory_v1.qedeq", |
82 |
|
null, |
83 |
|
new SourcePosition(13, 19) |
84 |
|
); |
85 |
0
|
fail("RuntimeException expected"); |
86 |
|
} catch (NullPointerException e) { |
87 |
|
|
88 |
|
} |
89 |
1
|
try { |
90 |
1
|
new SourceArea("file:///var/opt/qedeq/001/set_theory_v1.qedeq", |
91 |
|
new SourcePosition(12, 17), |
92 |
|
null |
93 |
|
); |
94 |
0
|
fail("RuntimeException expected"); |
95 |
|
} catch (NullPointerException e) { |
96 |
|
|
97 |
|
} |
98 |
|
} |
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
100 |
1
|
public void testGetAddress() {... |
101 |
1
|
assertEquals("file:///var/opt/qedeq/001/set_theory_v1.qedeq", object1.getAddress()); |
102 |
1
|
assertEquals("file:///var/opt/qedeq/001/set_theory_v1.qedeq", object2.getAddress()); |
103 |
1
|
assertEquals("file:///var/opt/qedeq/001/set_theory_v2.qedeq", object3.getAddress()); |
104 |
|
} |
105 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1
PASS
|
|
106 |
1
|
public void testGetStartPosition() {... |
107 |
1
|
assertEquals(new SourcePosition(12, 17), object1.getStartPosition()); |
108 |
1
|
assertEquals(new SourcePosition(12, 17), object2.getStartPosition()); |
109 |
1
|
assertEquals(new SourcePosition(12, 17), object3.getStartPosition()); |
110 |
1
|
assertEquals(new SourcePosition(13, 17), object4.getStartPosition()); |
111 |
|
} |
112 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1
PASS
|
|
113 |
1
|
public void testGetEndPosition() {... |
114 |
1
|
assertEquals(new SourcePosition(13, 19), object1.getEndPosition()); |
115 |
1
|
assertEquals(new SourcePosition(13, 19), object2.getEndPosition()); |
116 |
1
|
assertEquals(new SourcePosition(13, 19), object3.getEndPosition()); |
117 |
1
|
assertEquals(new SourcePosition(13, 19), object5.getEndPosition()); |
118 |
|
} |
119 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1
PASS
|
|
120 |
1
|
public void testHashCode() {... |
121 |
1
|
assertEquals(object1.hashCode(), object2.hashCode()); |
122 |
1
|
assertTrue(object1.hashCode() != object3.hashCode()); |
123 |
1
|
assertTrue(object1.hashCode() != object4.hashCode()); |
124 |
1
|
assertTrue(object1.hashCode() != object5.hashCode()); |
125 |
1
|
assertTrue(object2.hashCode() != object3.hashCode()); |
126 |
1
|
assertTrue(object2.hashCode() != object4.hashCode()); |
127 |
1
|
assertTrue(object2.hashCode() != object5.hashCode()); |
128 |
|
} |
129 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
1
PASS
|
|
130 |
1
|
public void testEqualsObject() {... |
131 |
1
|
assertEquals(object1, object2); |
132 |
1
|
assertEquals(object2, object1); |
133 |
1
|
assertTrue(!object1.equals(object3)); |
134 |
1
|
assertTrue(!object3.equals(object1)); |
135 |
1
|
assertTrue(!object1.equals(object4)); |
136 |
1
|
assertTrue(!object4.equals(object1)); |
137 |
1
|
assertTrue(!object1.equals(object5)); |
138 |
1
|
assertTrue(!object5.equals(object1)); |
139 |
1
|
assertTrue(!object2.equals(object3)); |
140 |
1
|
assertTrue(!object3.equals(object2)); |
141 |
1
|
assertTrue(!object2.equals(object4)); |
142 |
1
|
assertTrue(!object4.equals(object2)); |
143 |
1
|
assertTrue(!object2.equals(object5)); |
144 |
1
|
assertTrue(!object5.equals(object2)); |
145 |
|
} |
146 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
1
PASS
|
|
147 |
1
|
public void testToString() {... |
148 |
1
|
assertEquals(object1.toString(), object2.toString()); |
149 |
1
|
assertEquals(object2.toString(), object1.toString()); |
150 |
1
|
assertTrue(!object1.toString().equals(object3.toString())); |
151 |
1
|
assertTrue(!object3.toString().equals(object1.toString())); |
152 |
1
|
assertTrue(!object1.toString().equals(object4.toString())); |
153 |
1
|
assertTrue(!object4.toString().equals(object1.toString())); |
154 |
1
|
assertTrue(!object1.toString().equals(object5.toString())); |
155 |
1
|
assertTrue(!object5.toString().equals(object1.toString())); |
156 |
1
|
assertTrue(!object2.toString().equals(object3.toString())); |
157 |
1
|
assertTrue(!object3.toString().equals(object2.toString())); |
158 |
1
|
assertTrue(!object2.toString().equals(object4.toString())); |
159 |
1
|
assertTrue(!object4.toString().equals(object2.toString())); |
160 |
1
|
assertTrue(!object2.toString().equals(object5.toString())); |
161 |
1
|
assertTrue(!object5.toString().equals(object2.toString())); |
162 |
|
} |
163 |
|
|
164 |
|
} |