1 | package de.ugoe.cs.quest.jfc.data;
|
---|
2 |
|
---|
3 | import org.junit.*;
|
---|
4 |
|
---|
5 | import de.ugoe.cs.quest.jfc.data.JFCEvent;
|
---|
6 | import de.ugoe.cs.quest.jfc.data.JFCTargetComparator;
|
---|
7 |
|
---|
8 | import static org.junit.Assert.*;
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * The class <code>JFCEventTest</code> contains tests for the class <code>{@link JFCEvent}</code>.
|
---|
12 | *
|
---|
13 | * @author Steffen Herbold
|
---|
14 | * @version 1.0
|
---|
15 | */
|
---|
16 | public class JFCEventTest {
|
---|
17 |
|
---|
18 | @Test
|
---|
19 | public void testTargetEquals_1()
|
---|
20 | throws Exception {
|
---|
21 | JFCEvent event = new JFCEvent("type");
|
---|
22 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
23 | String target2 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
24 | event.setTarget(target1);
|
---|
25 | boolean expected = true;
|
---|
26 |
|
---|
27 | boolean result = event.targetEquals(target2);
|
---|
28 |
|
---|
29 | assertEquals(expected, result);
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Test
|
---|
33 | public void testTargetEquals_2()
|
---|
34 | throws Exception {
|
---|
35 | JFCEvent event = new JFCEvent("type");
|
---|
36 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
37 | String target2 = "['title1','class1','text1','index1','hash1'].['titleOther','class2','text2','index2','hash2']";
|
---|
38 | event.setTarget(target1);
|
---|
39 | boolean expected = true;
|
---|
40 |
|
---|
41 | boolean result = event.targetEquals(target2);
|
---|
42 |
|
---|
43 | assertEquals(expected, result);
|
---|
44 | }
|
---|
45 |
|
---|
46 | @Test
|
---|
47 | public void testTargetEquals_3()
|
---|
48 | throws Exception {
|
---|
49 | JFCEvent event = new JFCEvent("type");
|
---|
50 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
51 | String target2 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hashOther']";
|
---|
52 | event.setTarget(target1);
|
---|
53 | boolean expected = true;
|
---|
54 |
|
---|
55 | boolean result = event.targetEquals(target2);
|
---|
56 |
|
---|
57 | assertEquals(expected, result);
|
---|
58 | }
|
---|
59 |
|
---|
60 | @Test
|
---|
61 | public void testTargetEquals_4()
|
---|
62 | throws Exception {
|
---|
63 | JFCEvent event = new JFCEvent("type");
|
---|
64 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
65 | String target2 = "['titleOther','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
66 | event.setTarget(target1);
|
---|
67 | boolean expected = true;
|
---|
68 |
|
---|
69 | boolean result = event.targetEquals(target2);
|
---|
70 |
|
---|
71 | assertEquals(expected, result);
|
---|
72 | }
|
---|
73 |
|
---|
74 | @Test
|
---|
75 | public void testTargetEquals_5()
|
---|
76 | throws Exception {
|
---|
77 | JFCEvent event = new JFCEvent("type");
|
---|
78 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
79 | String target2 = "['title1','class1','text1','index1','hashOther'].['title2','class2','text2','index2','hash2']";
|
---|
80 | event.setTarget(target1);
|
---|
81 | boolean expected = true;
|
---|
82 |
|
---|
83 | boolean result = event.targetEquals(target2);
|
---|
84 |
|
---|
85 | assertEquals(expected, result);
|
---|
86 | }
|
---|
87 |
|
---|
88 | @Test
|
---|
89 | public void testTargetEquals_6()
|
---|
90 | throws Exception {
|
---|
91 | JFCEvent event = new JFCEvent("type");
|
---|
92 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
93 | String target2 = "['title1','class1','text1','index1','hash1'].['titleOther','class2','text2','index2','hashOther']";
|
---|
94 | event.setTarget(target1);
|
---|
95 | boolean expected = false;
|
---|
96 |
|
---|
97 | boolean result = event.targetEquals(target2);
|
---|
98 |
|
---|
99 | assertEquals(expected, result);
|
---|
100 | }
|
---|
101 |
|
---|
102 | @Test
|
---|
103 | public void testTargetEquals_7()
|
---|
104 | throws Exception {
|
---|
105 | JFCEvent event = new JFCEvent("type");
|
---|
106 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
107 | String target2 = "['titleOther','class1','text1','index1','hashOther'].['title2','class2','text2','index2','hash2']";
|
---|
108 | event.setTarget(target1);
|
---|
109 | boolean expected = false;
|
---|
110 |
|
---|
111 | boolean result = event.targetEquals(target2);
|
---|
112 |
|
---|
113 | assertEquals(expected, result);
|
---|
114 | }
|
---|
115 |
|
---|
116 | @Test
|
---|
117 | public void testTargetEquals_8()
|
---|
118 | throws Exception {
|
---|
119 | JFCEvent event = new JFCEvent("type");
|
---|
120 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
121 | String target2 = "['title1','class1','text1','index1','hash1'].['title2','classOther','text2','index2','hash2']";
|
---|
122 | event.setTarget(target1);
|
---|
123 | boolean expected = false;
|
---|
124 |
|
---|
125 | boolean result = event.targetEquals(target2);
|
---|
126 |
|
---|
127 | assertEquals(expected, result);
|
---|
128 | }
|
---|
129 |
|
---|
130 | @Test
|
---|
131 | public void testTargetEquals_9()
|
---|
132 | throws Exception {
|
---|
133 | JFCEvent event = new JFCEvent("type");
|
---|
134 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
135 | String target2 = "['title1','class1','text1','index1','hash1'].['title2','class2','textOther','index2','hash2']";
|
---|
136 | event.setTarget(target1);
|
---|
137 | boolean expected = false;
|
---|
138 |
|
---|
139 | boolean result = event.targetEquals(target2);
|
---|
140 |
|
---|
141 | assertEquals(expected, result);
|
---|
142 | }
|
---|
143 |
|
---|
144 | @Test
|
---|
145 | public void testTargetEquals_10()
|
---|
146 | throws Exception {
|
---|
147 | JFCEvent event = new JFCEvent("type");
|
---|
148 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
149 | String target2 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','indexOther','hash2']";
|
---|
150 | event.setTarget(target1);
|
---|
151 | boolean expected = false;
|
---|
152 |
|
---|
153 | boolean result = event.targetEquals(target2);
|
---|
154 |
|
---|
155 | assertEquals(expected, result);
|
---|
156 | }
|
---|
157 |
|
---|
158 | @Test
|
---|
159 | public void testTargetEquals_11()
|
---|
160 | throws Exception {
|
---|
161 | JFCEvent event = new JFCEvent("type");
|
---|
162 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
163 | String target2 = "['title1','classOther','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
164 | event.setTarget(target1);
|
---|
165 | boolean expected = false;
|
---|
166 |
|
---|
167 | boolean result = event.targetEquals(target2);
|
---|
168 |
|
---|
169 | assertEquals(expected, result);
|
---|
170 | }
|
---|
171 |
|
---|
172 | @Test
|
---|
173 | public void testTargetEquals_12()
|
---|
174 | throws Exception {
|
---|
175 | JFCEvent event = new JFCEvent("type");
|
---|
176 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
177 | String target2 = "['title1','class1','textOther','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
178 | event.setTarget(target1);
|
---|
179 | boolean expected = false;
|
---|
180 |
|
---|
181 | boolean result = event.targetEquals(target2);
|
---|
182 |
|
---|
183 | assertEquals(expected, result);
|
---|
184 | }
|
---|
185 |
|
---|
186 | @Test
|
---|
187 | public void testTargetEquals_13()
|
---|
188 | throws Exception {
|
---|
189 | JFCEvent event = new JFCEvent("type");
|
---|
190 | String target1 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
191 | String target2 = "['title1','class1','text1','indexOther','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
192 | event.setTarget(target1);
|
---|
193 | boolean expected = false;
|
---|
194 |
|
---|
195 | boolean result = event.targetEquals(target2);
|
---|
196 |
|
---|
197 | assertEquals(expected, result);
|
---|
198 | }
|
---|
199 |
|
---|
200 | @Test
|
---|
201 | public void testTargetEquals_14()
|
---|
202 | throws Exception {
|
---|
203 | JFCEvent event = new JFCEvent("type");
|
---|
204 | String target1 = "['title'1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
205 | String target2 = "['title'1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
206 | event.setTarget(target1);
|
---|
207 | boolean expected = true;
|
---|
208 |
|
---|
209 | boolean result = event.targetEquals(target2);
|
---|
210 |
|
---|
211 | assertEquals(expected, result);
|
---|
212 | }
|
---|
213 |
|
---|
214 | @Test
|
---|
215 | public void testTargetEquals_15()
|
---|
216 | throws Exception {
|
---|
217 | JFCEvent event = new JFCEvent("type");
|
---|
218 | String target1 = "['title]1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
219 | String target2 = "['title]1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
220 | event.setTarget(target1);
|
---|
221 | boolean expected = true;
|
---|
222 |
|
---|
223 | boolean result = event.targetEquals(target2);
|
---|
224 |
|
---|
225 | assertEquals(expected, result);
|
---|
226 | }
|
---|
227 |
|
---|
228 | @Test
|
---|
229 | public void testTargetEquals_16()
|
---|
230 | throws Exception {
|
---|
231 | JFCEvent event = new JFCEvent("type");
|
---|
232 | String target1 = "['title[1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
233 | String target2 = "['title[1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
234 | event.setTarget(target1);
|
---|
235 | boolean expected = true;
|
---|
236 |
|
---|
237 | boolean result = event.targetEquals(target2);
|
---|
238 |
|
---|
239 | assertEquals(expected, result);
|
---|
240 | }
|
---|
241 |
|
---|
242 | @Test
|
---|
243 | public void testTargetEquals_17()
|
---|
244 | throws Exception {
|
---|
245 | JFCEvent event = new JFCEvent("type");
|
---|
246 | String target1 = "['title].1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
247 | String target2 = "['title].1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
248 | event.setTarget(target1);
|
---|
249 | boolean expected = true;
|
---|
250 |
|
---|
251 | boolean result = event.targetEquals(target2);
|
---|
252 |
|
---|
253 | assertEquals(expected, result);
|
---|
254 | }
|
---|
255 |
|
---|
256 | @Test
|
---|
257 | public void testTargetEquals_18()
|
---|
258 | throws Exception {
|
---|
259 | JFCEvent event = new JFCEvent("type");
|
---|
260 | String target1 = "['title.[1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
261 | String target2 = "['title.[1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
262 | event.setTarget(target1);
|
---|
263 | boolean expected = true;
|
---|
264 |
|
---|
265 | boolean result = event.targetEquals(target2);
|
---|
266 |
|
---|
267 | assertEquals(expected, result);
|
---|
268 | }
|
---|
269 |
|
---|
270 | @Test
|
---|
271 | public void testTargetEquals_19()
|
---|
272 | throws Exception {
|
---|
273 | JFCEvent event = new JFCEvent("type");
|
---|
274 | String target1 = "['title1','class1','text1','index1','hash1']";
|
---|
275 | String target2 = "['title1','class1','text1','index1','hash1'].['title2','class2','text2','index2','hash2']";
|
---|
276 | event.setTarget(target1);
|
---|
277 | boolean expected = false;
|
---|
278 |
|
---|
279 | boolean result = event.targetEquals(target2);
|
---|
280 |
|
---|
281 | assertEquals(expected, result);
|
---|
282 | }
|
---|
283 |
|
---|
284 | @Test
|
---|
285 | public void testTargetEquals_20()
|
---|
286 | throws Exception {
|
---|
287 | JFCEvent event = new JFCEvent("type");
|
---|
288 | String target1 = "['title1','class1','text1','index1','hash1']";
|
---|
289 | String target2 = "['title1','class1','text1','index1','hash1']";
|
---|
290 | event.setTarget(target1);
|
---|
291 | boolean expected = true;
|
---|
292 |
|
---|
293 | boolean result = event.targetEquals(target2);
|
---|
294 |
|
---|
295 | assertEquals(expected, result);
|
---|
296 | }
|
---|
297 |
|
---|
298 | @Test
|
---|
299 | public void testTargetEquals_21()
|
---|
300 | throws Exception {
|
---|
301 | JFCEvent event = new JFCEvent("type");
|
---|
302 | String target1 = "['title1','class1','text1','index1','hash1']";
|
---|
303 | String target2 = "['titleOther','class1','text1','index1','hash1']";
|
---|
304 | event.setTarget(target1);
|
---|
305 | boolean expected = true;
|
---|
306 |
|
---|
307 | boolean result = event.targetEquals(target2);
|
---|
308 |
|
---|
309 | assertEquals(expected, result);
|
---|
310 | }
|
---|
311 |
|
---|
312 | @Test
|
---|
313 | public void testTargetEquals_22()
|
---|
314 | throws Exception {
|
---|
315 | JFCEvent event = new JFCEvent("type");
|
---|
316 | String target1 = "['title1','class1','text1','index1','hash1']";
|
---|
317 | String target2 = "['title1','class1','text1','index1','hashOther']";
|
---|
318 | event.setTarget(target1);
|
---|
319 | boolean expected = true;
|
---|
320 |
|
---|
321 | boolean result = event.targetEquals(target2);
|
---|
322 |
|
---|
323 | assertEquals(expected, result);
|
---|
324 | }
|
---|
325 |
|
---|
326 | @Test
|
---|
327 | public void testTargetEquals_23()
|
---|
328 | throws Exception {
|
---|
329 | JFCEvent event = new JFCEvent("type");
|
---|
330 | String target1 = "['title1','class1','text1','index1','hash1']";
|
---|
331 | String target2 = "['titleOther','class1','text1','index1','hashOther']";
|
---|
332 | event.setTarget(target1);
|
---|
333 | boolean expected = false;
|
---|
334 |
|
---|
335 | boolean result = event.targetEquals(target2);
|
---|
336 |
|
---|
337 | assertEquals(expected, result);
|
---|
338 | }
|
---|
339 |
|
---|
340 | @Test
|
---|
341 | public void testTargetEquals_24()
|
---|
342 | throws Exception {
|
---|
343 | JFCEvent event = new JFCEvent("type");
|
---|
344 | String target1 = null;
|
---|
345 | String target2 = "['titleOther','class1','text1','index1','hash1']";
|
---|
346 | event.setTarget(target1);
|
---|
347 | boolean expected = false;
|
---|
348 |
|
---|
349 | boolean result = event.targetEquals(target2);
|
---|
350 |
|
---|
351 | assertEquals(expected, result);
|
---|
352 | }
|
---|
353 |
|
---|
354 | @Test
|
---|
355 | public void testTargetEquals_25()
|
---|
356 | throws Exception {
|
---|
357 | JFCEvent event = new JFCEvent("type");
|
---|
358 | String target1 = "['title1','class1','text1','index1','hash1']";
|
---|
359 | String target2 = null;
|
---|
360 | event.setTarget(target1);
|
---|
361 | boolean expected = false;
|
---|
362 |
|
---|
363 | boolean result = event.targetEquals(target2);
|
---|
364 |
|
---|
365 | assertEquals(expected, result);
|
---|
366 | }
|
---|
367 |
|
---|
368 | @Before
|
---|
369 | public void setUp() {
|
---|
370 | JFCTargetComparator.reset();
|
---|
371 | }
|
---|
372 |
|
---|
373 | public static void main(String[] args) {
|
---|
374 | new org.junit.runner.JUnitCore().run(JFCEventTest.class);
|
---|
375 | }
|
---|
376 | } |
---|