本文整理汇总了Java中jkind.api.results.JKindResult类的典型用法代码示例。如果您正苦于以下问题:Java JKindResult类的具体用法?Java JKindResult怎么用?Java JKindResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JKindResult类属于jkind.api.results包,在下文中一共展示了JKindResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setInput
import jkind.api.results.JKindResult; //导入依赖的package包/类
public void setInput(JKindResult result, AgreeRenaming renaming) {
for (Control control : composite.getChildren()) {
control.dispose();
}
table = new Table(composite, SWT.FULL_SELECTION);
List<String> raw = candidates(result, renaming);
createColumns(raw, renaming);
createContent(result, raw);
packColumns();
table.setHeaderVisible(true);
table.setLinesVisible(true);
composite.layout(true);
}
示例2: showView
import jkind.api.results.JKindResult; //导入依赖的package包/类
private void showView(final JKindResult result, final Layout layout) {
window.getShell().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
try {
JKindResultsView page = (JKindResultsView) window.getActivePage().showView(
JKindResultsView.ID);
page.setInput(result, layout);
} catch (PartInitException e) {
e.printStackTrace();
}
}
});
}
示例3: executeOnEditor
import jkind.api.results.JKindResult; //导入依赖的package包/类
@Override
protected Object executeOnEditor(ExecutionEvent event) {
window = HandlerUtil.getActiveWorkbenchWindow(event);
if (window == null) {
return null;
}
final XtextEditor xtextEditor = EditorUtils.getActiveXtextEditor(event);
if (xtextEditor == null) {
return null;
}
FileEditorInput input = (FileEditorInput) xtextEditor.getEditorInput();
final java.io.File fileOnDisk = input.getFile().getLocation().toFile();
if (xtextEditor.isDirty()) {
if (MessageDialog.openConfirm(window.getShell(), "Save and Run JKind", "The file "
+ input.getName() + " has unsaved changes. Save file and continue?")) {
xtextEditor.doSave(null);
} else {
return null;
}
}
WorkspaceJob job = new WorkspaceJob("JKind Analysis") {
@Override
public IStatus runInWorkspace(final IProgressMonitor monitor) {
activateTerminateHandler(monitor, this);
JKindResult result = initializeJKindResult(xtextEditor);
if (result == null) {
return errorStatus("Lustre file contains errors");
}
return runJob(fileOnDisk, result, monitor);
}
};
job.schedule();
return null;
}
示例4: initializeJKindResult
import jkind.api.results.JKindResult; //导入依赖的package包/类
private JKindResult initializeJKindResult(XtextEditor xtextEditor) {
return xtextEditor.getDocument().readOnly(new IUnitOfWork<JKindResult, XtextResource>() {
@Override
public JKindResult exec(XtextResource resource) throws Exception {
File file = (File) resource.getContents().get(0);
return initializeJKindResult(file);
}
});
}
示例5: testSuiteFromJKindResult
import jkind.api.results.JKindResult; //导入依赖的package包/类
public static TestSuite testSuiteFromJKindResult(JKindResult result, String implUnderTest, String name, String description) {
List<TestCase> tests = new ArrayList<>();
for (PropertyResult pr : result.getPropertyResults()) {
if (pr.getProperty() instanceof InvalidProperty) {
InvalidProperty invalidProp = (InvalidProperty)pr.getProperty();
tests.add(new TestCase(pr.getName(), "", invalidProp.getCounterexample()));
}
}
return new TestSuite(implUnderTest, name, description, tests, TestSuite.State.INSTANTIATED);
}
示例6: setInput
import jkind.api.results.JKindResult; //导入依赖的package包/类
public void setInput(TestSuite suite, final AgreeResultsLinker linker, final JKindResult result) {
this.suite = suite;
table.setInput(suite);
menuListener.setLinker(linker);
menuListener.setAnalysisResult(result);
this.setPartName("Test Suite: " + result.getName() + " [" + suite.getSystemImplUnderTest() + "]");
}
示例7: addOpenTestSuiteViewMenu
import jkind.api.results.JKindResult; //导入依赖的package包/类
private void addOpenTestSuiteViewMenu(IMenuManager manager, AnalysisResult result) {
if (result instanceof JKindResult) {
JKindResult jresult = (JKindResult)result;
manager.add(new Action("View/Modify Test Suite") {
@Override
public void run() {
viewTestSuite(jresult, linker);
}
});
}
}
示例8: viewTestSuite
import jkind.api.results.JKindResult; //导入依赖的package包/类
private void viewTestSuite(JKindResult result, AgreeResultsLinker linker) {
TestSuite testSuite = TestSuiteUtils.
testSuiteFromJKindResult(result,
linker.getComponent(result).getQualifiedName(), result.getName(), result.getText());
try {
TestSuiteView tcView = (TestSuiteView) window.getActivePage().showView(
TestSuiteView.ID);
tcView.setInput(testSuite, linker, result);
tcView.setFocus();
} catch (PartInitException e) {
e.printStackTrace();
}
}
示例9: extractJKindResult
import jkind.api.results.JKindResult; //导入依赖的package包/类
protected JKindResult extractJKindResult(AnalysisResult result) {
if (result instanceof JKindResult) {
return (JKindResult)result;
} else if (result instanceof CompositeAnalysisResult) {
CompositeAnalysisResult comp = (CompositeAnalysisResult)result;
if (comp.getChildren().size() == 1) {
return extractJKindResult(comp.getChildren().get(0));
}
}
throw new TcgException("Unexpected jkind 'result' type when opening test suite");
}
示例10: showSuiteView
import jkind.api.results.JKindResult; //导入依赖的package包/类
private void showSuiteView(final TestSuite suite, final AgreeResultsLinker linker, final JKindResult result) {
syncExec(() -> {
try {
TestSuiteView page = (TestSuiteView) getWindow().getActivePage()
.showView(TestSuiteView.ID);
page.setInput(suite, linker, result);
} catch (PartInitException e) {
e.printStackTrace();
}
});
}
示例11: getMultiStatus
import jkind.api.results.JKindResult; //导入依赖的package包/类
public static TcgMultiStatus getMultiStatus(AnalysisResult result) {
if (result instanceof CompositeAnalysisResult) {
return new TcgMultiStatus(((CompositeAnalysisResult) result).getMultiStatus());
} else if (result instanceof JKindResult) {
return new TcgMultiStatus(((JKindResult) result).getMultiStatus());
} else {
return null;
}
}
示例12: addTraceabilityMatrixMenu
import jkind.api.results.JKindResult; //导入依赖的package包/类
private void addTraceabilityMatrixMenu(IMenuManager manager, AnalysisResult result) {
IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
if (prefs.getString(PreferenceConstants.PREF_MODEL_CHECKER)
.equals(PreferenceConstants.MODEL_CHECKER_JKIND) &&
prefs.getBoolean(PreferenceConstants.PREF_SUPPORT) &&
result instanceof JKindResult) {
JKindResult jresult = (JKindResult)result;
Set<String> reqs = new HashSet<String>();
for (PropertyResult pr : jresult.getPropertyResults()) {
if (pr.getProperty() instanceof ValidProperty) {
ValidProperty vp = (ValidProperty) pr.getProperty();
Set<String> ivc = vp.getIvc();
if (ivc != null && !ivc.isEmpty()) {
reqs.addAll(ivc);
}
}
}
String nodeName = linker.getComponent(result).getName();
manager.add(
new Action("View traceability matrix for " + nodeName) {
public void run() {
viewTraceabilityMatrix(jresult, reqs);
}
});
}
}
示例13: viewTraceabilityMatrix
import jkind.api.results.JKindResult; //导入依赖的package包/类
private void viewTraceabilityMatrix(
JKindResult result,
Set<String> reqs) {
try {
AgreeTraceabilityMatrixView matrix =
(AgreeTraceabilityMatrixView) window.getActivePage().showView(
AgreeTraceabilityMatrixView.ID);
matrix.setInput(result, (AgreeRenaming)linker.getRenaming(result));
matrix.setFocus();
} catch (PartInitException e) {
e.printStackTrace();
}
}
示例14: usedCandidates
import jkind.api.results.JKindResult; //导入依赖的package包/类
public List<String> usedCandidates(JKindResult result) {
Set<String> reqs = new HashSet<String>();
for (PropertyResult pr : result.getPropertyResults()) {
if (pr.getProperty() instanceof ValidProperty) {
ValidProperty vp = (ValidProperty) pr.getProperty();
Set<String> ivc = vp.getIvc();
if (ivc != null && !ivc.isEmpty()) {
reqs.addAll(ivc);
}
}
}
return reqs.stream().collect(Collectors.toList());
}
示例15: candidates
import jkind.api.results.JKindResult; //导入依赖的package包/类
public List<String> candidates(JKindResult result, AgreeRenaming renaming) {
if (showUnused) {
return renaming.getSupportRefStrings().keySet().stream().collect(Collectors.toList());
} else {
return usedCandidates(result);
}
}