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