| 1 | package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor; |
| 2 | |
| 3 | import static org.junit.Assert.assertEquals; |
| 4 | import static org.junit.Assert.assertNotNull; |
| 5 | import static org.junit.Assert.assertNull; |
| 6 | import static org.junit.Assert.assertTrue; |
| 7 | |
| 8 | import org.eclipse.core.resources.IProject; |
| 9 | import org.eclipse.core.resources.IResource; |
| 10 | import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation; |
| 11 | import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent; |
| 12 | import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTimestamp; |
| 13 | import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace; |
| 14 | import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; |
| 15 | import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp; |
| 16 | import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange; |
| 17 | import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp; |
| 18 | import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; |
| 19 | import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest; |
| 20 | import org.eclipse.linuxtools.tmf.core.request.TmfCoalescedEventRequest; |
| 21 | import org.eclipse.linuxtools.tmf.core.signal.TmfEndSynchSignal; |
| 22 | import org.eclipse.linuxtools.tmf.core.signal.TmfSignal; |
| 23 | import org.eclipse.linuxtools.tmf.core.statesystem.IStateSystemQuerier; |
| 24 | import org.eclipse.linuxtools.tmf.core.trace.ITmfContext; |
| 25 | import org.junit.After; |
| 26 | import org.junit.Before; |
| 27 | import org.junit.Test; |
| 28 | |
| 29 | /** |
| 30 | * The class <code>CtfTmfTraceTest</code> contains tests for the class <code>{@link CtfTmfTrace}</code>. |
| 31 | * |
| 32 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 33 | * @author ematkho |
| 34 | * @version $Revision: 1.0 $ |
| 35 | */ |
| 36 | public class CtfTmfTraceTest { |
| 37 | private static final String PATH = TestParams.getPath(); |
| 38 | |
| 39 | /** |
| 40 | * Run the CtfTmfTrace() constructor test. |
| 41 | * |
| 42 | * @throws Exception |
| 43 | * |
| 44 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 45 | */ |
| 46 | @Test |
| 47 | public void testCtfTmfTrace_1() |
| 48 | throws Exception { |
| 49 | |
| 50 | CtfTmfTrace result = new CtfTmfTrace(); |
| 51 | |
| 52 | // add additional test code here |
| 53 | assertNotNull(result); |
| 54 | assertEquals(null, result.getEventType()); |
| 55 | assertEquals(50000, result.getCacheSize()); |
| 56 | assertEquals(0L, result.getNbEvents()); |
| 57 | assertEquals(0L, result.getStreamingInterval()); |
| 58 | assertEquals(null, result.getStateSystem()); |
| 59 | assertEquals(null, result.getResource()); |
| 60 | assertEquals(1000, result.getQueueSize()); |
| 61 | assertEquals(null, result.getType()); |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Run the ITmfContext armRequest(ITmfDataRequest<CtfTmfEvent>) method test. |
| 66 | * |
| 67 | * @throws Exception |
| 68 | * |
| 69 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 70 | */ |
| 71 | @Test |
| 72 | public void testArmRequest_1() |
| 73 | throws Exception { |
| 74 | CtfTmfTrace fixture = initTrace(); |
| 75 | ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class); |
| 76 | |
| 77 | ITmfContext result = fixture.armRequest(request); |
| 78 | |
| 79 | // add additional test code here |
| 80 | // An unexpected exception was thrown in user code while executing this test: |
| 81 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 82 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 83 | assertNotNull(result); |
| 84 | } |
| 85 | |
| 86 | |
| 87 | /** |
| 88 | * @return |
| 89 | * @throws TmfTraceException |
| 90 | */ |
| 91 | private CtfTmfTrace initTrace() throws TmfTraceException { |
| 92 | CtfTmfTrace fixture = new CtfTmfTrace(); |
| 93 | fixture.initTrace((IResource) null, PATH, CtfTmfEvent.class); |
| 94 | return fixture; |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Run the ITmfContext armRequest(ITmfDataRequest<CtfTmfEvent>) method test. |
| 99 | * |
| 100 | * @throws Exception |
| 101 | * |
| 102 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 103 | */ |
| 104 | @Test |
| 105 | public void testArmRequest_2() |
| 106 | throws Exception { |
| 107 | CtfTmfTrace fixture = initTrace(); |
| 108 | ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class); |
| 109 | |
| 110 | ITmfContext result = fixture.armRequest(request); |
| 111 | |
| 112 | // add additional test code here |
| 113 | // An unexpected exception was thrown in user code while executing this test: |
| 114 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 115 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 116 | assertNotNull(result); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Run the ITmfContext armRequest(ITmfDataRequest<CtfTmfEvent>) method test. |
| 121 | * |
| 122 | * @throws Exception |
| 123 | * |
| 124 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 125 | */ |
| 126 | @Test |
| 127 | public void testArmRequest_3() |
| 128 | throws Exception { |
| 129 | CtfTmfTrace fixture = initTrace(); |
| 130 | ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class); |
| 131 | |
| 132 | ITmfContext result = fixture.armRequest(request); |
| 133 | |
| 134 | // add additional test code here |
| 135 | // An unexpected exception was thrown in user code while executing this test: |
| 136 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 137 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 138 | assertNotNull(result); |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Run the ITmfContext armRequest(ITmfDataRequest<CtfTmfEvent>) method test. |
| 143 | * |
| 144 | * @throws Exception |
| 145 | * |
| 146 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 147 | */ |
| 148 | @Test |
| 149 | public void testArmRequest_4() |
| 150 | throws Exception { |
| 151 | CtfTmfTrace fixture = initTrace(); |
| 152 | ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class); |
| 153 | |
| 154 | ITmfContext result = fixture.armRequest(request); |
| 155 | |
| 156 | // add additional test code here |
| 157 | // An unexpected exception was thrown in user code while executing this test: |
| 158 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 159 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 160 | assertNotNull(result); |
| 161 | } |
| 162 | |
| 163 | |
| 164 | /** |
| 165 | * Run the void broadcast(TmfSignal) method test. |
| 166 | * |
| 167 | * @throws Exception |
| 168 | * |
| 169 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 170 | */ |
| 171 | @Test |
| 172 | public void testBroadcast_1() |
| 173 | throws Exception { |
| 174 | CtfTmfTrace fixture = initTrace(); |
| 175 | TmfSignal signal = new TmfEndSynchSignal(1); |
| 176 | |
| 177 | fixture.broadcast(signal); |
| 178 | |
| 179 | // add additional test code here |
| 180 | // An unexpected exception was thrown in user code while executing this test: |
| 181 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 182 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 183 | } |
| 184 | |
| 185 | |
| 186 | /** |
| 187 | * Run the void dispose() method test. |
| 188 | * |
| 189 | * @throws Exception |
| 190 | * |
| 191 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 192 | */ |
| 193 | @Test |
| 194 | public void testDispose_1() |
| 195 | throws Exception { |
| 196 | CtfTmfTrace fixture = new CtfTmfTrace(); |
| 197 | |
| 198 | fixture.dispose(); |
| 199 | |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * Run the int getCacheSize() method test. |
| 204 | * |
| 205 | * @throws Exception |
| 206 | * |
| 207 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 208 | */ |
| 209 | @Test |
| 210 | public void testGetCacheSize_1() |
| 211 | throws Exception { |
| 212 | CtfTmfTrace fixture = new CtfTmfTrace(); |
| 213 | |
| 214 | int result = fixture.getCacheSize(); |
| 215 | |
| 216 | // add additional test code here |
| 217 | // An unexpected exception was thrown in user code while executing this test: |
| 218 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 219 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 220 | assertEquals(50000, result); |
| 221 | } |
| 222 | |
| 223 | /** |
| 224 | * Run the ITmfLocation<Comparable> getCurrentLocation() method test. |
| 225 | * |
| 226 | * @throws Exception |
| 227 | * |
| 228 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 229 | */ |
| 230 | @Test |
| 231 | public void testGetCurrentLocation_1() |
| 232 | throws Exception { |
| 233 | CtfTmfTrace fixture = initTrace(); |
| 234 | |
| 235 | CtfLocation result = (CtfLocation) fixture.getCurrentLocation(); |
| 236 | |
| 237 | // add additional test code here |
| 238 | // An unexpected exception was thrown in user code while executing this test: |
| 239 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 240 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 241 | assertNull(result); |
| 242 | } |
| 243 | |
| 244 | @Test |
| 245 | public void testSeekEventLoc_1() throws TmfTraceException { |
| 246 | CtfTmfTrace fixture = initTrace(); |
| 247 | CtfLocation loc = null; |
| 248 | fixture.seekEvent(loc); |
| 249 | assertNotNull(fixture); |
| 250 | } |
| 251 | |
| 252 | @Test |
| 253 | public void testSeekEventLoc_2() throws TmfTraceException { |
| 254 | CtfTmfTrace fixture = initTrace(); |
| 255 | CtfLocation loc = new CtfLocation(new CtfTmfTimestamp(0L)); |
| 256 | fixture.seekEvent(loc); |
| 257 | assertNotNull(fixture); |
| 258 | } |
| 259 | |
| 260 | |
| 261 | /** |
| 262 | * Run the ITmfTimestamp getEndTime() method test. |
| 263 | * |
| 264 | * @throws Exception |
| 265 | * |
| 266 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 267 | */ |
| 268 | @Test |
| 269 | public void testGetEndTime_1() |
| 270 | throws Exception { |
| 271 | CtfTmfTrace fixture = initTrace(); |
| 272 | ITmfTimestamp result = fixture.getEndTime(); |
| 273 | assertNotNull(result); |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * Run the String[] getEnvNames() method test. |
| 278 | * |
| 279 | * @throws Exception |
| 280 | * |
| 281 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 282 | */ |
| 283 | @Test |
| 284 | public void testGetEnvNames_1() |
| 285 | throws Exception { |
| 286 | CtfTmfTrace fixture = initTrace(); |
| 287 | |
| 288 | String[] result = fixture.getEnvNames(); |
| 289 | |
| 290 | // add additional test code here |
| 291 | // An unexpected exception was thrown in user code while executing this test: |
| 292 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 293 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 294 | assertNotNull(result); |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * Run the String getEnvValue(String) method test. |
| 299 | * |
| 300 | * @throws Exception |
| 301 | * |
| 302 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 303 | */ |
| 304 | @Test |
| 305 | public void testGetEnvValue_1() |
| 306 | throws Exception { |
| 307 | CtfTmfTrace fixture = initTrace(); |
| 308 | String key = "tracer_name"; //$NON-NLS-1$ |
| 309 | |
| 310 | String result = fixture.getEnvValue(key); |
| 311 | |
| 312 | // add additional test code here |
| 313 | // An unexpected exception was thrown in user code while executing this test: |
| 314 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 315 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 316 | assertEquals("\"lttng-modules\"",result); //$NON-NLS-1$ |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * Run the Class<CtfTmfEvent> getEventType() method test. |
| 321 | * |
| 322 | * @throws Exception |
| 323 | * |
| 324 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 325 | */ |
| 326 | @Test |
| 327 | public void testGetEventType_1() |
| 328 | throws Exception { |
| 329 | CtfTmfTrace fixture = initTrace(); |
| 330 | |
| 331 | Class<CtfTmfEvent> result = fixture.getEventType(); |
| 332 | |
| 333 | // add additional test code here |
| 334 | // An unexpected exception was thrown in user code while executing this test: |
| 335 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 336 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 337 | assertNull(result); |
| 338 | } |
| 339 | |
| 340 | /** |
| 341 | * Run the double getLocationRatio(ITmfLocation<?>) method test. |
| 342 | * |
| 343 | * @throws Exception |
| 344 | * |
| 345 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 346 | */ |
| 347 | @Test |
| 348 | public void testGetLocationRatio_1() |
| 349 | throws Exception { |
| 350 | CtfTmfTrace fixture = initTrace(); |
| 351 | CtfLocation location = new CtfLocation(new Long(1L)); |
| 352 | location.setLocation(new Long(1L)); |
| 353 | |
| 354 | double result = fixture.getLocationRatio(location); |
| 355 | |
| 356 | // add additional test code here |
| 357 | // An unexpected exception was thrown in user code while executing this test: |
| 358 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 359 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 360 | assertEquals(Double.POSITIVE_INFINITY, result, 0.1); |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | * Run the String getName() method test. |
| 365 | * |
| 366 | * @throws Exception |
| 367 | * |
| 368 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 369 | */ |
| 370 | @Test |
| 371 | public void testGetName_1() |
| 372 | throws Exception { |
| 373 | CtfTmfTrace fixture = initTrace(); |
| 374 | |
| 375 | String result = fixture.getName(); |
| 376 | |
| 377 | // add additional test code here |
| 378 | // An unexpected exception was thrown in user code while executing this test: |
| 379 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 380 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 381 | assertNotNull(result); |
| 382 | } |
| 383 | |
| 384 | /** |
| 385 | * Run the String getName() method test. |
| 386 | * |
| 387 | * @throws Exception |
| 388 | * |
| 389 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 390 | */ |
| 391 | @Test |
| 392 | public void testGetName_2() |
| 393 | throws Exception { |
| 394 | CtfTmfTrace fixture = initTrace(); |
| 395 | |
| 396 | String result = fixture.getName(); |
| 397 | |
| 398 | // add additional test code here |
| 399 | // An unexpected exception was thrown in user code while executing this test: |
| 400 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 401 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 402 | assertNotNull(result); |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * Run the String getName() method test. |
| 407 | * |
| 408 | * @throws Exception |
| 409 | * |
| 410 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 411 | */ |
| 412 | @Test |
| 413 | public void testGetName_3() |
| 414 | throws Exception { |
| 415 | CtfTmfTrace fixture = initTrace(); |
| 416 | |
| 417 | String result = fixture.getName(); |
| 418 | |
| 419 | // add additional test code here |
| 420 | // An unexpected exception was thrown in user code while executing this test: |
| 421 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 422 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 423 | assertNotNull(result); |
| 424 | } |
| 425 | |
| 426 | /** |
| 427 | * Run the int getNbEnvVars() method test. |
| 428 | * |
| 429 | * @throws Exception |
| 430 | * |
| 431 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 432 | */ |
| 433 | @Test |
| 434 | public void testGetNbEnvVars_1() |
| 435 | throws Exception { |
| 436 | CtfTmfTrace fixture = initTrace(); |
| 437 | |
| 438 | int result = fixture.getNbEnvVars(); |
| 439 | |
| 440 | // add additional test code here |
| 441 | // An unexpected exception was thrown in user code while executing this test: |
| 442 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 443 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 444 | assertEquals(8, result); |
| 445 | } |
| 446 | |
| 447 | /** |
| 448 | * Run the long getNbEvents() method test. |
| 449 | * |
| 450 | * @throws Exception |
| 451 | * |
| 452 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 453 | */ |
| 454 | @Test |
| 455 | public void testGetNbEvents_1() |
| 456 | throws Exception { |
| 457 | CtfTmfTrace fixture = initTrace(); |
| 458 | |
| 459 | long result = fixture.getNbEvents(); |
| 460 | |
| 461 | // add additional test code here |
| 462 | // An unexpected exception was thrown in user code while executing this test: |
| 463 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 464 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 465 | assertEquals(0L, result); |
| 466 | } |
| 467 | |
| 468 | /** |
| 469 | * Run the CtfTmfEvent getNext(ITmfContext) method test. |
| 470 | * |
| 471 | * @throws Exception |
| 472 | * |
| 473 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 474 | */ |
| 475 | @Test |
| 476 | public void testGetNext_1() |
| 477 | throws Exception { |
| 478 | CtfTmfTrace fixture = initTrace(); |
| 479 | ITmfContext context = fixture.seekEvent(0); |
| 480 | |
| 481 | CtfTmfEvent result = fixture.getNext(context); |
| 482 | |
| 483 | // add additional test code here |
| 484 | // An unexpected exception was thrown in user code while executing this test: |
| 485 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 486 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 487 | assertNotNull(result); |
| 488 | } |
| 489 | |
| 490 | /** |
| 491 | * Run the String getPath() method test. |
| 492 | * |
| 493 | * @throws Exception |
| 494 | * |
| 495 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 496 | */ |
| 497 | @Test |
| 498 | public void testGetPath_1() |
| 499 | throws Exception { |
| 500 | CtfTmfTrace fixture = initTrace(); |
| 501 | |
| 502 | String result = fixture.getPath(); |
| 503 | |
| 504 | // add additional test code here |
| 505 | // An unexpected exception was thrown in user code while executing this test: |
| 506 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 507 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 508 | assertNotNull(result); |
| 509 | } |
| 510 | |
| 511 | /** |
| 512 | * Run the IResource getResource() method test. |
| 513 | * |
| 514 | * @throws Exception |
| 515 | * |
| 516 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 517 | */ |
| 518 | @Test |
| 519 | public void testGetResource_1() |
| 520 | throws Exception { |
| 521 | CtfTmfTrace fixture = initTrace(); |
| 522 | |
| 523 | IResource result = fixture.getResource(); |
| 524 | |
| 525 | // add additional test code here |
| 526 | // An unexpected exception was thrown in user code while executing this test: |
| 527 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 528 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 529 | assertNull(result); |
| 530 | } |
| 531 | |
| 532 | /** |
| 533 | * Run the ITmfTimestamp getStartTime() method test. |
| 534 | * |
| 535 | * @throws Exception |
| 536 | * |
| 537 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 538 | */ |
| 539 | @Test |
| 540 | public void testGetStartTime_1() |
| 541 | throws Exception { |
| 542 | CtfTmfTrace fixture = initTrace(); |
| 543 | |
| 544 | ITmfTimestamp result = fixture.getStartTime(); |
| 545 | |
| 546 | // add additional test code here |
| 547 | // An unexpected exception was thrown in user code while executing this test: |
| 548 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 549 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 550 | assertNotNull(result); |
| 551 | } |
| 552 | |
| 553 | /** |
| 554 | * Run the IStateSystemQuerier getStateSystem() method test. |
| 555 | * |
| 556 | * @throws Exception |
| 557 | * |
| 558 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 559 | */ |
| 560 | @Test |
| 561 | public void testGetStateSystem_1() |
| 562 | throws Exception { |
| 563 | CtfTmfTrace fixture = initTrace(); |
| 564 | IStateSystemQuerier result = fixture.getStateSystem(); |
| 565 | |
| 566 | // add additional test code here |
| 567 | // An unexpected exception was thrown in user code while executing this test: |
| 568 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 569 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 570 | assertNull(result); |
| 571 | } |
| 572 | |
| 573 | /** |
| 574 | * Run the long getStreamingInterval() method test. |
| 575 | * |
| 576 | * @throws Exception |
| 577 | * |
| 578 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 579 | */ |
| 580 | @Test |
| 581 | public void testGetStreamingInterval_1() |
| 582 | throws Exception { |
| 583 | CtfTmfTrace fixture = initTrace(); |
| 584 | |
| 585 | long result = fixture.getStreamingInterval(); |
| 586 | |
| 587 | // add additional test code here |
| 588 | // An unexpected exception was thrown in user code while executing this test: |
| 589 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 590 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 591 | assertEquals(0L, result); |
| 592 | } |
| 593 | |
| 594 | /** |
| 595 | * Run the TmfTimeRange getTimeRange() method test. |
| 596 | * |
| 597 | * @throws Exception |
| 598 | * |
| 599 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 600 | */ |
| 601 | @Test |
| 602 | public void testGetTimeRange_1() |
| 603 | throws Exception { |
| 604 | CtfTmfTrace fixture = initTrace(); |
| 605 | |
| 606 | TmfTimeRange result = fixture.getTimeRange(); |
| 607 | |
| 608 | // add additional test code here |
| 609 | // An unexpected exception was thrown in user code while executing this test: |
| 610 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 611 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 612 | assertNotNull(result); |
| 613 | } |
| 614 | |
| 615 | /** |
| 616 | * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test. |
| 617 | * |
| 618 | * @throws Exception |
| 619 | * |
| 620 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 621 | */ |
| 622 | @Test |
| 623 | public void testInitTrace_1() |
| 624 | throws Exception { |
| 625 | CtfTmfTrace fixture = initTrace(); |
| 626 | |
| 627 | IResource resource = null; |
| 628 | String path = PATH; |
| 629 | Class<CtfTmfEvent> eventType = CtfTmfEvent.class; |
| 630 | |
| 631 | fixture.initTrace(resource, path, eventType); |
| 632 | |
| 633 | assertNotNull(fixture); |
| 634 | } |
| 635 | |
| 636 | /** |
| 637 | * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test. |
| 638 | * |
| 639 | * @throws Exception |
| 640 | * |
| 641 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 642 | */ |
| 643 | @Test |
| 644 | public void testInitTrace_2() |
| 645 | throws Exception { |
| 646 | CtfTmfTrace fixture = initTrace(); |
| 647 | IResource resource = null; |
| 648 | String path = PATH; |
| 649 | Class<CtfTmfEvent> eventType = CtfTmfEvent.class; |
| 650 | |
| 651 | fixture.initTrace(resource, path, eventType); |
| 652 | |
| 653 | assertNotNull(fixture); |
| 654 | } |
| 655 | |
| 656 | /** |
| 657 | * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test. |
| 658 | * |
| 659 | * @throws Exception |
| 660 | * |
| 661 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 662 | */ |
| 663 | @Test |
| 664 | public void testInitTrace_3() |
| 665 | throws Exception { |
| 666 | CtfTmfTrace fixture = initTrace(); |
| 667 | IResource resource = null; |
| 668 | String path = PATH; |
| 669 | Class<CtfTmfEvent> eventType = CtfTmfEvent.class; |
| 670 | |
| 671 | fixture.initTrace(resource, path, eventType); |
| 672 | |
| 673 | assertNotNull(fixture); |
| 674 | } |
| 675 | |
| 676 | /** |
| 677 | * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test. |
| 678 | * |
| 679 | * @throws Exception |
| 680 | * |
| 681 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 682 | */ |
| 683 | @Test |
| 684 | public void testInitTrace_4() |
| 685 | throws Exception { |
| 686 | CtfTmfTrace fixture = initTrace(); |
| 687 | |
| 688 | IResource resource = null; |
| 689 | String path = PATH; |
| 690 | Class<CtfTmfEvent> eventType = CtfTmfEvent.class; |
| 691 | |
| 692 | fixture.initTrace(resource, path, eventType); |
| 693 | |
| 694 | assertNotNull(fixture); |
| 695 | } |
| 696 | |
| 697 | /** |
| 698 | * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test. |
| 699 | * |
| 700 | * @throws Exception |
| 701 | * |
| 702 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 703 | */ |
| 704 | @Test |
| 705 | public void testInitTrace_5() |
| 706 | throws Exception { |
| 707 | CtfTmfTrace fixture = initTrace(); |
| 708 | IResource resource = null; |
| 709 | String path = PATH; |
| 710 | Class<CtfTmfEvent> eventType = CtfTmfEvent.class; |
| 711 | |
| 712 | fixture.initTrace(resource, path, eventType); |
| 713 | |
| 714 | assertNotNull(fixture); |
| 715 | } |
| 716 | |
| 717 | /** |
| 718 | * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test. |
| 719 | * |
| 720 | * @throws Exception |
| 721 | * |
| 722 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 723 | */ |
| 724 | @Test |
| 725 | public void testInitTrace_6() |
| 726 | throws Exception { |
| 727 | CtfTmfTrace fixture = initTrace(); |
| 728 | IResource resource = null; |
| 729 | String path = PATH; |
| 730 | Class<CtfTmfEvent> eventType = CtfTmfEvent.class; |
| 731 | |
| 732 | fixture.initTrace(resource, path, eventType); |
| 733 | |
| 734 | assertNotNull(fixture); |
| 735 | } |
| 736 | |
| 737 | /** |
| 738 | * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test. |
| 739 | * |
| 740 | * @throws Exception |
| 741 | * |
| 742 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 743 | */ |
| 744 | @Test |
| 745 | public void testInitTrace_7() |
| 746 | throws Exception { |
| 747 | CtfTmfTrace fixture = initTrace(); |
| 748 | IResource resource = null; |
| 749 | String path = PATH; |
| 750 | Class<CtfTmfEvent> eventType = CtfTmfEvent.class; |
| 751 | |
| 752 | fixture.initTrace(resource, path, eventType); |
| 753 | |
| 754 | assertNotNull(fixture); |
| 755 | } |
| 756 | |
| 757 | /** |
| 758 | * Run the CtfTmfEvent readNextEvent(ITmfContext) method test. |
| 759 | * |
| 760 | * @throws Exception |
| 761 | * |
| 762 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 763 | */ |
| 764 | @Test |
| 765 | public void testReadNextEvent_1() |
| 766 | throws Exception { |
| 767 | CtfTmfTrace fixture = initTrace(); |
| 768 | ITmfContext context = fixture.seekEvent(0); |
| 769 | |
| 770 | CtfTmfEvent result = fixture.getNext(context); |
| 771 | |
| 772 | // add additional test code here |
| 773 | // An unexpected exception was thrown in user code while executing this test: |
| 774 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 775 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 776 | assertNotNull(result); |
| 777 | } |
| 778 | |
| 779 | /** |
| 780 | * Run the ITmfContext seekEvent(double) method test. |
| 781 | * |
| 782 | * @throws Exception |
| 783 | * |
| 784 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 785 | */ |
| 786 | @Test |
| 787 | public void testSeekEvent_1() |
| 788 | throws Exception { |
| 789 | CtfTmfTrace fixture = initTrace(); |
| 790 | double ratio = 1.0; |
| 791 | |
| 792 | ITmfContext result = fixture.seekEvent(ratio); |
| 793 | |
| 794 | // add additional test code here |
| 795 | // An unexpected exception was thrown in user code while executing this test: |
| 796 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 797 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 798 | assertNotNull(result); |
| 799 | } |
| 800 | |
| 801 | /** |
| 802 | * Run the ITmfContext seekEvent(long) method test. |
| 803 | * |
| 804 | * @throws Exception |
| 805 | * |
| 806 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 807 | */ |
| 808 | @Test |
| 809 | public void testSeekEvent_2() |
| 810 | throws Exception { |
| 811 | CtfTmfTrace fixture = initTrace(); |
| 812 | long rank = 1L; |
| 813 | |
| 814 | ITmfContext result = fixture.seekEvent(rank); |
| 815 | |
| 816 | // add additional test code here |
| 817 | // An unexpected exception was thrown in user code while executing this test: |
| 818 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 819 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 820 | assertNotNull(result); |
| 821 | } |
| 822 | |
| 823 | /** |
| 824 | * Run the ITmfContext seekEvent(ITmfTimestamp) method test. |
| 825 | * |
| 826 | * @throws Exception |
| 827 | * |
| 828 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 829 | */ |
| 830 | @Test |
| 831 | public void testSeekEvent_3() |
| 832 | throws Exception { |
| 833 | CtfTmfTrace fixture = initTrace(); |
| 834 | ITmfTimestamp timestamp = new TmfTimestamp(); |
| 835 | |
| 836 | ITmfContext result = fixture.seekEvent(timestamp); |
| 837 | |
| 838 | // add additional test code here |
| 839 | // An unexpected exception was thrown in user code while executing this test: |
| 840 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 841 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 842 | assertNotNull(result); |
| 843 | } |
| 844 | |
| 845 | // /** |
| 846 | // * Run the ITmfContext seekEvent(ITmfLocation<?>) method test. |
| 847 | // * |
| 848 | // * @throws Exception |
| 849 | // * |
| 850 | // * @generatedBy CodePro at 03/05/12 2:29 PM |
| 851 | // */ |
| 852 | // @Test |
| 853 | // public void testSeekEvent_4() |
| 854 | // throws Exception { |
| 855 | // CtfTmfTrace fixture = initTrace(); |
| 856 | // fixture.setStartTime(new TmfTimestamp()); |
| 857 | // CtfIterator ctfIterator = new CtfIterator(new CtfTmfTrace()); |
| 858 | // CtfLocation ctfLocation = new CtfLocation(new Long(1L)); |
| 859 | // ctfLocation.setLocation(new Long(1L)); |
| 860 | // ctfIterator.setLocation(ctfLocation); |
| 861 | // fixture.iterator = ctfIterator; |
| 862 | // fixture.ss = new StateHistorySystem(new HistoryTreeBackend(new File(PATH)), true); |
| 863 | // fixture.startSynch(new TmfStartSynchSignal(1)); |
| 864 | // fixture.fNbEvents = 1L; |
| 865 | // ITmfLocation<Comparable> location = new CtfLocation(new Long(1L)); |
| 866 | // |
| 867 | // ITmfContext result = fixture.seekEvent(location); |
| 868 | // |
| 869 | // // add additional test code here |
| 870 | // // An unexpected exception was thrown in user code while executing this test: |
| 871 | // // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 872 | // // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 873 | // assertNotNull(result); |
| 874 | // } |
| 875 | // |
| 876 | // /** |
| 877 | // * Run the ITmfContext seekEvent(ITmfLocation<?>) method test. |
| 878 | // * |
| 879 | // * @throws Exception |
| 880 | // * |
| 881 | // * @generatedBy CodePro at 03/05/12 2:29 PM |
| 882 | // */ |
| 883 | // @Test |
| 884 | // public void testSeekEvent_5() |
| 885 | // throws Exception { |
| 886 | // CtfTmfTrace fixture = initTrace(); |
| 887 | // CtfIterator ctfIterator = new CtfIterator(new CtfTmfTrace()); |
| 888 | // CtfLocation ctfLocation = new CtfLocation(new Long(1L)); |
| 889 | // ITmfContext result = fixture.seekEvent(ctfLocation); |
| 890 | // assertNotNull(result); |
| 891 | // } |
| 892 | |
| 893 | |
| 894 | |
| 895 | /** |
| 896 | * Run the boolean validate(IProject,String) method test. |
| 897 | * |
| 898 | * @throws Exception |
| 899 | * |
| 900 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 901 | */ |
| 902 | @Test |
| 903 | public void testValidate_1() |
| 904 | throws Exception { |
| 905 | CtfTmfTrace fixture = initTrace(); |
| 906 | IProject project = null; |
| 907 | String path = PATH; |
| 908 | |
| 909 | boolean result = fixture.validate(project, path); |
| 910 | |
| 911 | // add additional test code here |
| 912 | // An unexpected exception was thrown in user code while executing this test: |
| 913 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 914 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 915 | assertTrue(result); |
| 916 | } |
| 917 | |
| 918 | /** |
| 919 | * Run the boolean validate(IProject,String) method test. |
| 920 | * |
| 921 | * @throws Exception |
| 922 | * |
| 923 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 924 | */ |
| 925 | @Test |
| 926 | public void testValidate_2() |
| 927 | throws Exception { |
| 928 | CtfTmfTrace fixture = initTrace(); |
| 929 | IProject project = null; |
| 930 | String path = PATH; |
| 931 | |
| 932 | boolean result = fixture.validate(project, path); |
| 933 | |
| 934 | // add additional test code here |
| 935 | // An unexpected exception was thrown in user code while executing this test: |
| 936 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 937 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 938 | assertTrue(result); |
| 939 | } |
| 940 | |
| 941 | /** |
| 942 | * Run the boolean validate(IProject,String) method test. |
| 943 | * |
| 944 | * @throws Exception |
| 945 | * |
| 946 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 947 | */ |
| 948 | @Test |
| 949 | public void testValidate_3() |
| 950 | throws Exception { |
| 951 | CtfTmfTrace fixture = initTrace(); |
| 952 | IProject project = null; |
| 953 | String path = PATH; |
| 954 | |
| 955 | boolean result = fixture.validate(project, path); |
| 956 | |
| 957 | // add additional test code here |
| 958 | // An unexpected exception was thrown in user code while executing this test: |
| 959 | // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory |
| 960 | // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98) |
| 961 | assertTrue(result); |
| 962 | } |
| 963 | |
| 964 | /** |
| 965 | * Perform pre-test initialization. |
| 966 | * |
| 967 | * @throws Exception |
| 968 | * if the initialization fails for some reason |
| 969 | * |
| 970 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 971 | */ |
| 972 | @Before |
| 973 | public void setUp() |
| 974 | throws Exception { |
| 975 | // add additional set up code here |
| 976 | } |
| 977 | |
| 978 | /** |
| 979 | * Perform post-test clean-up. |
| 980 | * |
| 981 | * @throws Exception |
| 982 | * if the clean-up fails for some reason |
| 983 | * |
| 984 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 985 | */ |
| 986 | @After |
| 987 | public void tearDown() |
| 988 | throws Exception { |
| 989 | // Add additional tear down code here |
| 990 | } |
| 991 | |
| 992 | /** |
| 993 | * Launch the test. |
| 994 | * |
| 995 | * @param args the command line arguments |
| 996 | * |
| 997 | * @generatedBy CodePro at 03/05/12 2:29 PM |
| 998 | */ |
| 999 | public static void main(String[] args) { |
| 1000 | new org.junit.runner.JUnitCore().run(CtfTmfTraceTest.class); |
| 1001 | } |
| 1002 | } |