Search in sources :

Example 1 with TcgLinkerFactory

use of com.rockwellcollins.atc.tcg.views.TcgLinkerFactory in project AGREE by loonwerks.

the class OpenHandler method doAnalysis.

protected IStatus doAnalysis(final IProgressMonitor monitor) {
    try {
        System.out.println("Loading test suite...");
        TestSuite testSuite = loadTests();
        if (testSuite != null) {
            ComponentImplementation ci = getComponentImplFromString(testSuite.getSystemImplUnderTest());
            TcgLinkerFactory linkerFactory = new TcgLinkerFactory(ci, false, false);
            showSuiteView(testSuite, linkerFactory.getLinker(), extractJKindResult(linkerFactory.getAnalysisResult()));
        }
    } catch (Exception e) {
        System.out.println("Error" + e.toString());
        throw e;
    } finally {
        System.out.println("Test suite loading complete");
    }
    return Status.OK_STATUS;
}
Also used : ComponentImplementation(org.osate.aadl2.ComponentImplementation) TestSuite(com.rockwellcollins.atc.tcg.suite.TestSuite) TcgLinkerFactory(com.rockwellcollins.atc.tcg.views.TcgLinkerFactory) TcgException(com.rockwellcollins.atc.tcg.TcgException) PartInitException(org.eclipse.ui.PartInitException) IOException(java.io.IOException)

Example 2 with TcgLinkerFactory

use of com.rockwellcollins.atc.tcg.views.TcgLinkerFactory in project AGREE by loonwerks.

the class VerifyHandler method runJob.

@Override
protected final IStatus runJob(Element root, IProgressMonitor monitor) {
    handlerService = getWindow().getService(IHandlerService.class);
    if (!(root instanceof ComponentImplementation)) {
        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Must select an AADL Component Implementation");
    }
    if (isRecursive() && AgreeUtils.usingKind2()) {
        throw new AgreeException("Kind2 only supports monolithic verification");
    }
    try {
        TcgLinkerFactory factory = new TcgLinkerFactory((ComponentImplementation) root, isMonolithic(), isRecursive());
        AnalysisResult result = factory.getAnalysisResult();
        linker = factory.getLinker();
        queue = factory.getWorkQueue();
        showView(result, linker);
        return doAnalysis(root, monitor);
    } catch (Throwable e) {
        String messages = getNestedMessages(e);
        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, messages, e);
    }
}
Also used : ComponentImplementation(org.osate.aadl2.ComponentImplementation) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) IHandlerService(org.eclipse.ui.handlers.IHandlerService) AgreeException(com.rockwellcollins.atc.agree.analysis.AgreeException) TcgLinkerFactory(com.rockwellcollins.atc.tcg.views.TcgLinkerFactory) AnalysisResult(jkind.api.results.AnalysisResult) CompositeAnalysisResult(jkind.api.results.CompositeAnalysisResult)

Aggregations

TcgLinkerFactory (com.rockwellcollins.atc.tcg.views.TcgLinkerFactory)2 ComponentImplementation (org.osate.aadl2.ComponentImplementation)2 AgreeException (com.rockwellcollins.atc.agree.analysis.AgreeException)1 TcgException (com.rockwellcollins.atc.tcg.TcgException)1 TestSuite (com.rockwellcollins.atc.tcg.suite.TestSuite)1 IOException (java.io.IOException)1 AnalysisResult (jkind.api.results.AnalysisResult)1 CompositeAnalysisResult (jkind.api.results.CompositeAnalysisResult)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 PartInitException (org.eclipse.ui.PartInitException)1 IHandlerService (org.eclipse.ui.handlers.IHandlerService)1