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