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