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.state.experiment; | |
13 | ||
14 | import org.eclipse.linuxtools.lttng.LttngTestPreparation; | |
15 | import org.eclipse.linuxtools.lttng.event.LttngEvent; | |
16 | import org.eclipse.linuxtools.lttng.model.LTTngTreeNode; | |
17 | import org.eclipse.linuxtools.lttng.state.trace.StateTraceManager; | |
18 | import org.eclipse.linuxtools.tmf.experiment.TmfExperiment; | |
19 | ||
20 | /** | |
21 | * @author alvaro | |
22 | * | |
23 | */ | |
3b38ea61 | 24 | @SuppressWarnings("nls") |
03c71d1e ASL |
25 | public class StateExperimentManagerTextTest extends LttngTestPreparation { |
26 | ||
27 | /** | |
28 | * Test method for {@link org.eclipse.linuxtools.lttng.state.experiment.StateExperimentManager#experimentSelected_prep(org.eclipse.linuxtools.tmf.experiment.TmfExperiment)}. | |
29 | */ | |
9b635e61 FC |
30 | // public void testExperimentSelected_text() { |
31 | // // make sure a TmfExperiment instance is registered as provider and | |
32 | // // selected as current | |
33 | // TmfExperiment<LttngEvent> experiment = prepareTextExperimentToTest(); | |
34 | // | |
35 | // // Create a new Experiment manager | |
36 | // IStateExperimentManager expManager = StateManagerFactory | |
37 | // .getExperimentManager(); | |
38 | // expManager.waitForCompletion(true); | |
39 | // // Configure the interval to create check points so this can be tested | |
40 | // // with medium size files i.e. default is 50000 events | |
41 | // StateManagerFactory.setTraceCheckPointInterval(1000L); | |
42 | // | |
43 | // // preparation | |
44 | // expManager.experimentSelected_prep(experiment); | |
45 | // // Action trigger | |
46 | // expManager.experimentSelected(this, experiment); | |
47 | // | |
48 | // // Access context tree for Validation | |
49 | // // access to the context tree | |
50 | // LTTngTreeNode experimentNode = expManager.getSelectedExperiment(); | |
51 | // StateTraceManager traceManager = (StateTraceManager) experimentNode | |
52 | // .getChildById(0L); | |
53 | // | |
54 | // // validate | |
55 | // int numProcesses = traceManager.getCheckPointStateModel().getProcesses().length; | |
56 | // assertEquals("Total number of processes created", 276, numProcesses); | |
57 | // | |
58 | // } | |
03c71d1e ASL |
59 | |
60 | /** | |
61 | * Test method for | |
62 | * {@link org.eclipse.linuxtools.lttng.state.experiment.StateExperimentManager#experimentSelected_prep(org.eclipse.linuxtools.tmf.experiment.TmfExperiment)} | |
63 | * . | |
64 | */ | |
65 | public void testExperimentSelected_real() { | |
66 | // Create a new Experiment manager context | |
67 | IStateExperimentManager expManager = prepareExperimentContext(true); | |
68 | expManager.waitForCompletion(true); | |
69 | ||
70 | // make sure a TmfExperiment instance is registered as provider and | |
71 | // selected as current | |
72 | TmfExperiment<LttngEvent> experiment = prepareExperimentToTest(); | |
73 | ||
74 | // preparation | |
75 | expManager.experimentSelected_prep(experiment); | |
76 | // Action trigger | |
77 | expManager.experimentSelected(this, experiment); | |
78 | ||
79 | // Access context tree for Validation | |
80 | // access to the context tree | |
81 | LTTngTreeNode experimentNode = expManager.getSelectedExperiment(); | |
82 | StateTraceManager traceManager = (StateTraceManager) experimentNode | |
83 | .getChildById(0L); | |
84 | ||
85 | // validate | |
550d787e | 86 | int numProcesses = traceManager.getCheckPointStateModel().getProcesses().length; |
03c71d1e ASL |
87 | assertEquals("Total number of processes created", 276, numProcesses); |
88 | ||
89 | } | |
90 | ||
91 | } |