1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
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 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.ui
.tests
.module
;
12 import static org
.junit
.Assert
.assertEquals
;
13 import static org
.junit
.Assert
.assertNotNull
;
14 import static org
.junit
.Assert
.assertTrue
;
16 import java
.util
.Iterator
;
18 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.module
.TmfXmlAnalysisOutputSource
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.analysis
.IAnalysisModule
;
20 import org
.eclipse
.tracecompass
.tmf
.core
.analysis
.IAnalysisOutput
;
21 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfTraceOpenedSignal
;
22 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfTrace
;
23 import org
.eclipse
.tracecompass
.tmf
.tests
.stubs
.trace
.xml
.TmfXmlTraceStub
;
24 import org
.junit
.Test
;
27 * Test that XML-defined outputs are added to the analysis modules they are for
29 * @author Geneviève Bastien
31 public class XmlAnalysisOutputSourceTest
{
33 private static final String BUILTIN_MODULE
= "test.builtin.sp";
34 private static final String BUILTIN_OUTPUT
= "Test output of XML builtin module";
38 * {@link TmfXmlAnalysisOutputSource#moduleCreated(IAnalysisModule)} method
41 public void testBuiltinOutput() {
43 TmfTrace trace
= new TmfXmlTraceStub();
45 trace
.traceOpened(new TmfTraceOpenedSignal(this, trace
, null));
47 IAnalysisModule module
= trace
.getAnalysisModule(BUILTIN_MODULE
);
48 assertNotNull(module
);
50 Iterator
<IAnalysisOutput
> iterator
= module
.getOutputs().iterator();
51 assertTrue(iterator
.hasNext());
52 IAnalysisOutput output
= iterator
.next();
53 assertEquals(BUILTIN_OUTPUT
, output
.getName());