Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced verification result json #156

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms2G -Xmx2G"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<stringAttribute key="product" value="hu.bme.mit.gamma.sysml.headless.sysmlProduct"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
<booleanAttribute key="useProduct" value="true"/>
<booleanAttribute key="useProduct" value="false"/>
<booleanAttribute key="usefeatures" value="false"/>
</launchConfiguration>
26 changes: 13 additions & 13 deletions plugins/core/hu.bme.mit.gamma.statechart.language.ui/.classpath
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry excluding="**/.gitignore" kind="src" path="xtend-gen"/>
<classpathentry excluding="**/.gitignore" kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is strange here: everything is the same...

<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry excluding="**/.gitignore" kind="src" path="xtend-gen"/>
<classpathentry excluding="**/.gitignore" kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Gamma Statechart Language UI
Bundle-Vendor: BME-FTSRG
Bundle-Version: 2.9.0.qualifier
Bundle-SymbolicName: hu.bme.mit.gamma.statechart.language.ui; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: hu.bme.mit.gamma.statechart.language,
hu.bme.mit.gamma.statechart.language.ide,
hu.bme.mit.gamma.statechart.model,
org.eclipse.xtext.ui,
org.eclipse.xtext.ui.shared,
org.eclipse.xtext.ui.codetemplates.ui,
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
org.eclipse.ui,
org.eclipse.compare,
org.eclipse.xtext.builder,
hu.bme.mit.gamma.action.language.ui,
hu.bme.mit.gamma.expression.language.ui,
hu.bme.mit.gamma.language.util,
org.eclipse.jdt.core,
org.eclipse.xtend.lib,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.pde.core,
org.eclipse.ui.forms
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: hu.bme.mit.gamma.statechart.language.ui.contentassist,
hu.bme.mit.gamma.statechart.language.ui.internal,
hu.bme.mit.gamma.statechart.language.ui.quickfix,
hu.bme.mit.gamma.statechart.language.ui.serializer,
hu.bme.mit.gamma.statechart.language.ui.wizard
Bundle-Activator: hu.bme.mit.gamma.statechart.language.ui.internal.LanguageActivator
Automatic-Module-Name: hu.bme.mit.gamma.statechart.language.ui
Manifest-Version: 1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is strange here: everything is the same...

Bundle-ManifestVersion: 2
Bundle-Name: Gamma Statechart Language UI
Bundle-Vendor: BME-FTSRG
Bundle-Version: 2.9.0.qualifier
Bundle-SymbolicName: hu.bme.mit.gamma.statechart.language.ui; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: hu.bme.mit.gamma.statechart.language,
hu.bme.mit.gamma.statechart.language.ide,
hu.bme.mit.gamma.statechart.model,
org.eclipse.xtext.ui,
org.eclipse.xtext.ui.shared,
org.eclipse.xtext.ui.codetemplates.ui,
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
org.eclipse.ui,
org.eclipse.compare,
org.eclipse.xtext.builder,
hu.bme.mit.gamma.action.language.ui,
hu.bme.mit.gamma.expression.language.ui,
hu.bme.mit.gamma.language.util,
org.eclipse.jdt.core,
org.eclipse.xtend.lib,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.pde.core,
org.eclipse.ui.forms
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: hu.bme.mit.gamma.statechart.language.ui.contentassist,
hu.bme.mit.gamma.statechart.language.ui.internal,
hu.bme.mit.gamma.statechart.language.ui.quickfix,
hu.bme.mit.gamma.statechart.language.ui.serializer,
hu.bme.mit.gamma.statechart.language.ui.wizard
Bundle-Activator: hu.bme.mit.gamma.statechart.language.ui.internal.LanguageActivator
Automatic-Module-Name: hu.bme.mit.gamma.statechart.language.ui
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@

public class VerificationHandler extends TaskHandler {

public final List<VerificationResult> retrievedVerificationResults = new ArrayList<>();

protected boolean serializeTraces; // Denotes whether traces are serialized
protected boolean serializeTest; // Denotes whether test code is generated
protected String testFolderUri;
Expand Down Expand Up @@ -160,7 +162,6 @@ public void execute(Verification verification) throws IOException, InterruptedEx
boolean isOptimize = verification.isOptimize();

// Retrieved traces
List<VerificationResult> retrievedVerificationResults = new ArrayList<VerificationResult>();
List<ExecutionTrace> retrievedTraces = new ArrayList<ExecutionTrace>();

// Map for collecting both supported property representations
Expand Down Expand Up @@ -237,13 +238,16 @@ public void execute(Verification verification) throws IOException, InterruptedEx
traceUtil.addComment(trace, serializedFormula);
}

TimeUnit timeUnit = TimeUnit.MILLISECONDS;
long elapsed = stopwatch.elapsed(timeUnit);
String elapsedString = elapsed + " " + timeUnit;
long elapsedMS = stopwatch.elapsed(TimeUnit.MILLISECONDS);

VerificationResult resultTemp = new VerificationResult();
resultTemp.query = serializedFormula;
resultTemp.result = verificationResult;
resultTemp.parameters = arguments;
resultTemp.executionTimeMS = elapsedMS;
resultTemp.traceSvgPath = targetFolderUri + "/" + svgFileName + retrievedVerificationResults.size() + ".svg";

retrievedVerificationResults.add(
new VerificationResult(
serializedFormula, verificationResult, arguments, elapsedString));
retrievedVerificationResults.add(resultTemp);

// Checking if some of the unchecked properties are already covered
if (isOptimize) {
Expand Down Expand Up @@ -460,26 +464,12 @@ public void serialize(String resultFolderUri, String resultFileName,
fileUtil.saveString(resultFolderUri + File.separator + fileName, jsonResult);
}

@SuppressWarnings("unused")
public static class VerificationResult {

private String query;
private ThreeStateBoolean result;
private String[] parameters;
private String executionTime;

public VerificationResult(String query, ThreeStateBoolean result) {
this(query, result, null, null);
}

public VerificationResult(String query, ThreeStateBoolean result,
String[] parameters, String executionTime) {
this.query = query;
this.result = result;
this.parameters = parameters;
this.executionTime = executionTime;
}

public static class VerificationResult {
public String traceSvgPath = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rationale of the public attributes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is simpler to use, and allows access to the results in code as well.

public long executionTimeMS = -1;
public String query = "";
public ThreeStateBoolean result = ThreeStateBoolean.UNDEF;
public String[] parameters = { };
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class JavaUtil {
return last
}

def <T> Iterable<T> exceptLast(Collection<T> collection) {
return collection.take(collection.size - 1)
}

def <T> T removeLast(List<T> list) {
return list.remove(list.size - 1)
}
Expand Down
10 changes: 7 additions & 3 deletions plugins/core/hu.bme.mit.gamma.validation/.classpath
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="src" path="src-gen/"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Gamma Low-level Statechart To XSTS Transformation Traceability Metamodel
Bundle-Name: %pluginName
Bundle-SymbolicName: hu.bme.mit.gamma.lowlevel.xsts.transformation.traceability;singleton:=true
Bundle-Version: 2.9.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: BME-FTSRG
Bundle-Vendor: %providerName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these modifications

Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: hu.bme.mit.gamma.lowlevel.xsts.transformation.traceability,
Expand Down