Search in sources :

Example 6 with TestCase

use of com.rockwellcollins.atc.tcg.suite.TestCase in project AGREE by loonwerks.

the class TestSuiteDescriptionEditingSupport method getValue.

@Override
protected Object getValue(Object element) {
    if (element instanceof TestCase) {
        TestCase tc = (TestCase) element;
        String desc = tc.getDescription();
        return (Object) desc;
    }
    return null;
}
Also used : TestCase(com.rockwellcollins.atc.tcg.suite.TestCase)

Example 7 with TestCase

use of com.rockwellcollins.atc.tcg.suite.TestCase in project AGREE by loonwerks.

the class TestSuiteDescriptionEditingSupport method setValue.

@Override
protected void setValue(Object element, Object value) {
    if (element instanceof TestCase) {
        TestCase tc = (TestCase) element;
        tc.setDescription((String) value);
        viewer.update(element, null);
    }
}
Also used : TestCase(com.rockwellcollins.atc.tcg.suite.TestCase)

Example 8 with TestCase

use of com.rockwellcollins.atc.tcg.suite.TestCase in project AGREE by loonwerks.

the class TcgXmlReader method readSuite.

public void readSuite(TestSuite ts) {
    try {
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.parse(xmlStream);
        Element docElement = doc.getDocumentElement();
        System.out.println("Root element :" + docElement.getNodeName());
        ts.setName(getTextElement(docElement, "SuiteName"));
        ts.setDescription(getTextElement(docElement, "SuiteDescription"));
        ts.setSystemImplUnderTest(getTextElement(docElement, "ImplementationUnderTest"));
        List<Element> testElements = getElements(docElement, "Test");
        List<TestCase> tests = constructTests(testElements);
        ts.setTestCases(tests);
        ts.setState(TestSuite.State.LOADED);
    } catch (Exception e) {
        throw new TcgException("Error parsing XML test suite.", e);
    }
}
Also used : DocumentBuilder(javax.xml.parsers.DocumentBuilder) TestCase(com.rockwellcollins.atc.tcg.suite.TestCase) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document) TcgException(com.rockwellcollins.atc.tcg.TcgException) TcgException(com.rockwellcollins.atc.tcg.TcgException)

Aggregations

TestCase (com.rockwellcollins.atc.tcg.suite.TestCase)8 Element (org.w3c.dom.Element)2 TcgException (com.rockwellcollins.atc.tcg.TcgException)1 ArrayList (java.util.ArrayList)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 Counterexample (jkind.results.Counterexample)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 Document (org.w3c.dom.Document)1