Search in sources :

Example 1 with TmfXmlActionCu

use of org.eclipse.tracecompass.internal.tmf.analysis.xml.core.fsm.compile.TmfXmlActionCu in project tracecompass by tracecompass.

the class TmfXmlActionCuTest method testAction.

/**
 * Test the compilation of a valid action strings
 *
 * @throws SAXException
 *             Exception thrown by parser
 * @throws IOException
 *             Exception thrown by parser
 * @throws ParserConfigurationException
 *             Exception thrown by parser
 */
@Test
public void testAction() throws SAXException, IOException, ParserConfigurationException {
    AnalysisCompilationData data = new AnalysisCompilationData();
    Element xmlElement = TmfXmlTestUtils.getXmlElement(TmfXmlStrings.ACTION, fExpected.getXmlString());
    assertNotNull(xmlElement);
    TmfXmlActionCu compiledAction = TmfXmlActionCu.compileNamedAction(data, xmlElement);
    if (fExpected.getResult() == null) {
        assertNull("Expected null action" + fExpected.getName(), compiledAction);
    } else {
        assertNotNull("Expected non null " + fExpected.getName(), compiledAction);
        assertEquals(fExpected.getName() + " generated", fExpected.getResult(), compiledAction.generate());
    }
}
Also used : Element(org.w3c.dom.Element) AnalysisCompilationData(org.eclipse.tracecompass.internal.tmf.analysis.xml.core.fsm.compile.AnalysisCompilationData) TmfXmlActionCu(org.eclipse.tracecompass.internal.tmf.analysis.xml.core.fsm.compile.TmfXmlActionCu) Test(org.junit.Test)

Aggregations

AnalysisCompilationData (org.eclipse.tracecompass.internal.tmf.analysis.xml.core.fsm.compile.AnalysisCompilationData)1 TmfXmlActionCu (org.eclipse.tracecompass.internal.tmf.analysis.xml.core.fsm.compile.TmfXmlActionCu)1 Test (org.junit.Test)1 Element (org.w3c.dom.Element)1