1 /*******************************************************************************
2 * Copyright (c) 2010 Ericsson
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
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.tests
.control
;
14 import org
.eclipse
.linuxtools
.lttng
.event
.LttngEvent
;
15 import org
.eclipse
.linuxtools
.lttng
.tests
.LttngTestPreparation
;
16 import org
.eclipse
.linuxtools
.tmf
.experiment
.TmfExperiment
;
17 import org
.eclipse
.linuxtools
.tmf
.request
.TmfEventRequest
;
19 @SuppressWarnings("nls")
20 public class LTTngSyntheticEventProviderTest
extends LttngTestPreparation
{
21 // ========================================================================
23 // ========================================================================
25 public void testPlainDataRequest() {
28 TmfExperiment
<LttngEvent
> experiment
= prepareExperimentToTest();
29 TmfEventRequest
<LttngEvent
> request
= prepareEventRequest(
30 LttngEvent
.class, 0, 31);
33 experiment
.sendRequest(request
);
35 request
.waitForCompletion();
36 } catch (InterruptedException e
) {
41 assertEquals("Unexpected eventCount", 15316, feventCount
);
42 boolean expected
= true;
43 assertEquals("Events received out of expected order", expected
,
47 public void testSyntheticEventRequest() {
48 System
.out
.println("testSyntheticEventRequest: test removed");
50 // // Create a new Experiment manager context
51 // IStateExperimentManager expManager = prepareExperimentContext(false);
53 // // make sure a TmfExperiment instance is registered as provider and
54 // // selected as current
55 // TmfExperiment<LttngEvent> experiment = prepareExperimentToTest();
57 // // experiment selected, build experiment selection context and trigger
58 // // check point creation
59 // expManager.experimentSelected_prep(experiment);
60 // // builds check points in parallel
61 // expManager.experimentSelected(this, experiment);
63 // // Obtain the singleton event provider
64 // LttngSyntheticEventProvider synProvider = LttngCoreProviderFactory
65 // .getEventProvider();
67 // // prepare synthetic event requests
68 // boolean printExpectedEvents = false;
69 // TmfEventRequest<LttngSyntheticEvent> request1 = prepareEventRequest(LttngSyntheticEvent.class, 5, 9,
70 // printExpectedEvents); /* 2001 events */
71 // TmfEventRequest<LttngSyntheticEvent> request2 = prepareEventRequest(LttngSyntheticEvent.class, 11, 13,
72 // printExpectedEvents); /* 1001 events */
75 // synProvider.sendRequest(request1);
77 // request1.waitForCompletion();
78 // } catch (InterruptedException e) {
79 // e.printStackTrace();
81 // System.out.println("EventCount " + feventCount);
83 // synProvider.sendRequest(request2);
85 // request2.waitForCompletion();
86 // } catch (InterruptedException e) {
87 // e.printStackTrace();
89 // System.out.println("EventCount " + feventCount);
92 // assertEquals("Unexpected eventCount", 3002, feventCount);