Commit | Line | Data |
---|---|---|
03c71d1e ASL |
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 | *******************************************************************************/ | |
29465de6 | 12 | package org.eclipse.linuxtools.lttng.tests.control; |
03c71d1e | 13 | |
f9673903 | 14 | import org.eclipse.linuxtools.lttng.event.LttngEvent; |
29465de6 | 15 | import org.eclipse.linuxtools.lttng.tests.LttngTestPreparation; |
f9673903 FC |
16 | import org.eclipse.linuxtools.tmf.experiment.TmfExperiment; |
17 | import org.eclipse.linuxtools.tmf.request.TmfEventRequest; | |
03c71d1e | 18 | |
3b38ea61 | 19 | @SuppressWarnings("nls") |
03c71d1e ASL |
20 | public class LTTngSyntheticEventProviderTest extends LttngTestPreparation { |
21 | // ======================================================================== | |
22 | // Tests | |
23 | // ======================================================================== | |
24 | ||
3d62f8b7 | 25 | public void testPlainDataRequest() { |
f9673903 FC |
26 | // prepare |
27 | init(); | |
28 | TmfExperiment<LttngEvent> experiment = prepareExperimentToTest(); | |
29 | TmfEventRequest<LttngEvent> request = prepareEventRequest( | |
30 | LttngEvent.class, 0, 31); | |
31 | ||
32 | // execute | |
33 | experiment.sendRequest(request); | |
34 | try { | |
35 | request.waitForCompletion(); | |
36 | } catch (InterruptedException e) { | |
37 | e.printStackTrace(); | |
38 | } | |
39 | ||
40 | // finish | |
41 | assertEquals("Unexpected eventCount", 15316, feventCount); | |
42 | boolean expected = true; | |
43 | assertEquals("Events received out of expected order", expected, | |
44 | validSequence); | |
3d62f8b7 | 45 | } |
9b635e61 | 46 | |
f9673903 FC |
47 | // /** |
48 | // * | |
49 | // */ | |
50 | // public void testSyntheticEventRequest() { | |
f6b14ce2 FC |
51 | // init(); |
52 | // // Create a new Experiment manager context | |
53 | // IStateExperimentManager expManager = prepareExperimentContext(false); | |
54 | // | |
55 | // // make sure a TmfExperiment instance is registered as provider and | |
56 | // // selected as current | |
57 | // TmfExperiment<LttngEvent> experiment = prepareExperimentToTest(); | |
58 | // | |
59 | // // experiment selected, build experiment selection context and trigger | |
60 | // // check point creation | |
61 | // expManager.experimentSelected_prep(experiment); | |
62 | // // builds check points in parallel | |
63 | // expManager.experimentSelected(this, experiment); | |
64 | // | |
65 | // // Obtain the singleton event provider | |
f9673903 FC |
66 | // LttngSyntheticEventProvider synProvider = LttngCoreProviderFactory |
67 | // .getEventProvider(); | |
f6b14ce2 FC |
68 | // |
69 | // // prepare synthetic event requests | |
70 | // boolean printExpectedEvents = false; | |
71 | // TmfEventRequest<LttngSyntheticEvent> request1 = prepareEventRequest(LttngSyntheticEvent.class, 5, 9, | |
72 | // printExpectedEvents); /* 2001 events */ | |
f9673903 | 73 | // TmfEventRequest<LttngSyntheticEvent> request2 = prepareEventRequest(LttngSyntheticEvent.class, 11, 13, |
f6b14ce2 FC |
74 | // printExpectedEvents); /* 1001 events */ |
75 | // | |
76 | // // execute | |
77 | // synProvider.sendRequest(request1); | |
f6b14ce2 FC |
78 | // try { |
79 | // request1.waitForCompletion(); | |
80 | // } catch (InterruptedException e) { | |
81 | // e.printStackTrace(); | |
82 | // } | |
f9673903 | 83 | // System.out.println("EventCount " + feventCount); |
f6b14ce2 FC |
84 | // |
85 | // synProvider.sendRequest(request2); | |
f6b14ce2 FC |
86 | // try { |
87 | // request2.waitForCompletion(); | |
88 | // } catch (InterruptedException e) { | |
89 | // e.printStackTrace(); | |
90 | // } | |
f9673903 | 91 | // System.out.println("EventCount " + feventCount); |
f6b14ce2 FC |
92 | // |
93 | // // finish | |
94 | // assertEquals("Unexpected eventCount", 3002, feventCount); | |
f9673903 | 95 | // } |
03c71d1e ASL |
96 | |
97 | } |