~ubuntu-branches/ubuntu/vivid/eclipse-linuxtools/vivid-proposed

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/views/uml2sd/loader/Uml2SDTestFacility.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam, Jakub Adam, tony mancill
  • Date: 2014-10-11 11:44:05 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20141011114405-yazjvxfzzhmi5sgj
Tags: 3.1.0-1
[ Jakub Adam ]
* New upstream release (Closes: #761524).
* Refreshed d/patches.
* Don't build removed feature org.eclipse.linuxtools.tools.launch
  - merged into org.eclipse.linuxtools.profiling.
* Use javac target 1.7.
* Build new feature org.eclipse.linuxtools.dataviewers.feature
  - required by Valgrind integration.
* Build-depend on eclipse-remote-services-api and eclipse-cdt-autotools.
* Bump Standards-Version to 3.9.6.
* Override incompatible-java-bytecode-format - linuxtools needs Java 7.
* Remove unused codeless-jar override.

[ tony mancill ]
* Tweak short package description to make lintian happy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.FilterListDialog;
38
38
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.load.LoadersManager;
39
39
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.loader.TmfUml2SDSyncLoader;
 
40
import org.eclipse.swt.SWT;
40
41
import org.eclipse.swt.widgets.Display;
41
42
import org.eclipse.ui.IViewPart;
42
43
import org.eclipse.ui.PartInitException;
62
63
    private TmfUml2SDTestTrace    fParser = null;
63
64
    private TmfExperiment fExperiment = null;
64
65
 
65
 
    private boolean fIsInitialized = false;
 
66
    private volatile boolean fIsInitialized = false;
66
67
 
67
68
    // ------------------------------------------------------------------------
68
69
    // Constructors
134
135
            // Create test trace object
135
136
            final URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path("tracesets/sdEvents"), null);
136
137
            final File test = new File(FileLocator.toFileURL(location).toURI());
137
 
            return new TmfTraceStub(test.getPath(), 500, true, parser, null);
 
138
            return new TmfTraceStub(test.getPath(), 500, true, parser);
138
139
        } catch (final TmfTraceException e) {
139
140
            e.printStackTrace();
140
141
            throw new RuntimeException(e);
152
153
     */
153
154
    public void dispose() {
154
155
        if (fIsInitialized) {
155
 
            fTrace.broadcast(new TmfTraceClosedSignal(this, fExperiment));
156
 
            fExperiment.dispose();
 
156
            ITmfTrace trace = fTrace;
 
157
            TmfExperiment experiment = fExperiment;
 
158
            if (trace == null || experiment == null) {
 
159
                throw new IllegalStateException();
 
160
            }
 
161
 
 
162
            trace.broadcast(new TmfTraceClosedSignal(this, experiment));
 
163
            experiment.dispose();
157
164
 
158
165
            // Wait for all Eclipse jobs to finish
159
166
            waitForJobs();
173
180
            final long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
174
181
            while(System.currentTimeMillis() < endTimeMillis) {
175
182
                if (!display.readAndDispatch()) {
 
183
                    if ("cocoa".equals (SWT.getPlatform ())) {
 
184
                        // The display needs to be woken up because it's possible
 
185
                        // to get in a state where nothing will wake up the UI thread
 
186
                        display.asyncExec(null);
 
187
                    }
176
188
                    display.sleep();
177
189
                }
178
190
                display.update();
311
323
     * Disposes the experiment.
312
324
     */
313
325
    public void disposeExperiment() {
314
 
        fTrace.broadcast(new TmfTraceClosedSignal(this, fExperiment));
315
 
        fExperiment.dispose();
 
326
        ITmfTrace trace = fTrace;
 
327
        TmfExperiment experiment = fExperiment;
 
328
        if (trace == null || experiment == null) {
 
329
            throw new IllegalStateException();
 
330
        }
 
331
        trace.broadcast(new TmfTraceClosedSignal(this, experiment));
 
332
        experiment.dispose();
316
333
        delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
317
334
    }
318
335
 
321
338
     */
322
339
    public void createFilterCriteria() {
323
340
        // Create Filter Criteria and save tme
324
 
        final List<FilterCriteria> filterToSave = new ArrayList<FilterCriteria>();
 
341
        final List<FilterCriteria> filterToSave = new ArrayList<>();
325
342
        Criteria criteria = new Criteria();
326
343
        criteria.setLifeLineSelected(true);
327
344
        criteria.setExpression(IUml2SDTestConstants.FIRST_PLAYER_NAME);