Search in sources :

Example 1 with TestCase

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

the class TcgXmlWriter method writeSuite.

@Override
public void writeSuite(TestSuite ts) {
    begin(ts.getName(), ts.getDescription(), ts.getSystemImplUnderTest());
    for (TestCase test : ts.getTestCases()) {
        writeTest(test);
    }
    end();
}
Also used : TestCase(com.rockwellcollins.atc.tcg.suite.TestCase)

Example 2 with TestCase

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

the class TestSuiteNameEditingSupport method setValue.

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

Example 3 with TestCase

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

the class TcgXmlReader method constructTests.

public List<TestCase> constructTests(List<Element> testElements) {
    List<TestCase> testCases = new ArrayList<>();
    for (Element elem : testElements) {
        String name = elem.getAttribute("name");
        String description = getTextElement(elem, "Description");
        int length = Integer.parseInt(getTextElement(elem, "Length"));
        Counterexample cex = getCounterexample(elem, length);
        TestCase tc = new TestCase(name, description, cex);
        testCases.add(tc);
    }
    return testCases;
}
Also used : TestCase(com.rockwellcollins.atc.tcg.suite.TestCase) Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) Counterexample(jkind.results.Counterexample)

Example 4 with TestCase

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

the class TestSuiteMenuListener method menuAboutToShow.

@Override
public void menuAboutToShow(IMenuManager manager) {
    IStructuredSelection selection = (IStructuredSelection) table.getViewer().getSelection();
    if (!selection.isEmpty()) {
        TestCase testCase = (TestCase) selection.getFirstElement();
        addLinkedMenus(manager, testCase);
    }
}
Also used : TestCase(com.rockwellcollins.atc.tcg.suite.TestCase) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 5 with TestCase

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

the class TestSuiteNameEditingSupport method getValue.

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

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