2010-06-21 fchouinard@gmail.com Fix for Bug316276
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.tests / src / org / eclipse / linuxtools / lttng / control / LTTngSyntheticEventProviderTextTest.java
1 /*******************************************************************************
2 * Copyright (c) 2010 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org.eclipse.linuxtools.lttng.control;
13
14
15
16 import org.eclipse.linuxtools.lttng.LttngTestPreparation;
17 import org.eclipse.linuxtools.lttng.event.LttngSyntheticEvent;
18 import org.eclipse.linuxtools.tmf.request.TmfEventRequest;
19
20 public class LTTngSyntheticEventProviderTextTest extends LttngTestPreparation {
21
22 // ========================================================================
23 // Tests
24 // ========================================================================
25 /**
26 *
27 */
28 // public void testPlainDataRequest() {
29 // // prepare
30 // init();
31 // TmfExperiment<LttngEvent> experiment = prepareTextExperimentToTest();
32 // TmfEventRequest<LttngEvent> request = prepareEventRequest(
33 // LttngEvent.class, 0, 31);
34 //
35 // // execute
36 // experiment.sendRequest(request);
37 // try {
38 // request.waitForCompletion();
39 // } catch (InterruptedException e) {
40 // e.printStackTrace();
41 // }
42 //
43 // // finish
44 // assertEquals("Unexpected eventCount", 15316, feventCount);
45 // boolean expected = true;
46 // assertEquals("Events received out of expected order", expected,
47 // validSequence);
48 // }
49
50 /**
51 *
52 */
53 public void testSyntheticEventRequest() {
54 init();
55 // make sure a synthetic event provider exists and it's registered
56 LttngSyntheticEventProvider synProvider = LttngCoreProviderFactory
57 .getEventProvider();
58
59 // make sure a TmfExperiment instance is registered as provider and
60 // selected as current
61 prepareTextExperimentToTest();
62
63 // prepare synthetic event request
64 TmfEventRequest<LttngSyntheticEvent> request = prepareEventRequest(
65 LttngSyntheticEvent.class, 0, 31);
66
67 // execute
68 synProvider.sendRequest(request);
69 try {
70 request.waitForCompletion();
71 } catch (InterruptedException e) {
72 e.printStackTrace();
73 }
74
75 // finish
76 assertEquals("Unexpected eventCount", 15316, feventCount);
77 }
78 }
This page took 0.032587 seconds and 5 git commands to generate.