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

[test] Adapt test helper code to latest api changes #99

Merged
merged 1 commit into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -16,7 +16,8 @@ Require-Bundle: com.google.guava,
org.eclipse.swt;bundle-version="3.105.3",
org.eclipse.ui;bundle-version="3.108.1",
org.eclipse.gemoc.trace.gemoc;bundle-version="2.4.0",
org.eclipse.gemoc.executionframework.engine;bundle-version="2.4.0"
org.eclipse.gemoc.executionframework.engine;bundle-version="2.4.0",
org.eclipse.gemoc.execution.sequential.javaengine;bundle-version="4.0.0"
Export-Package: org.eclipse.gemoc.executionframework.test.lib,
org.eclipse.gemoc.executionframework.test.lib.impl
Automatic-Module-Name: org.eclipse.gemoc.executionframework.test.lib
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TestEngineAddon extends DefaultEngineAddon {
testResult.engineStopped = true
}

override stepExecuted(IExecutionEngine engine, Step<?> stepExecuted) {
override stepExecuted(IExecutionEngine<?> engine, Step<?> stepExecuted) {
testResult.amountOfStepsExecuted++
if (shouldStopAfter != -1 && shouldStopAfter < testResult.amountOfStepsExecuted) {
engine.stop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class TestHelper {
val traceAddon = new GenericTraceEngineAddon()
val testResult = testWithJob(engine, language, #{}, #{traceAddon}, model, cleanup)
// TODO when other PR is merged
//testResult.trace = traceAddon.trace
testResult.trace = traceAddon.trace
return testResult
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import org.eclipse.gemoc.xdsmlframework.api.core.IRunConfiguration
import org.eclipse.gemoc.xdsmlframework.api.extensions.engine_addon.EngineAddonSpecificationExtension
import org.eclipse.gemoc.xdsmlframework.api.extensions.engine_addon.EngineAddonSpecificationExtensionPoint
import org.eclipse.gemoc.executionframework.test.lib.IExecutableModel
import org.eclipse.gemoc.execution.sequential.javaengine.IK3RunConfiguration

class TestRunConfiguration implements IRunConfiguration {
class TestRunConfiguration implements IK3RunConfiguration {
private val ILanguageWrapper language
private val IExecutableModel model
private val Set<String> addonsToLoad
Expand All @@ -34,10 +35,6 @@ class TestRunConfiguration implements IRunConfiguration {
return null;
}

override getDeadlockDetectionDepth() {
return 0;
}

override getEngineAddonExtensions() {
val List<EngineAddonSpecificationExtension> result = new ArrayList<EngineAddonSpecificationExtension>();
val loadedAddons = EngineAddonSpecificationExtensionPoint.getSpecifications()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class TestUtil {

def static public void removeStoppedEngines() {
val registry = Activator.getDefault().gemocRunningEngineRegistry
for (Entry<String, IExecutionEngine> engineEntry : registry.getRunningEngines().entrySet()) {
for (Entry<String, IExecutionEngine<?>> engineEntry : registry.getRunningEngines().entrySet()) {
if (engineEntry.value.runningStatus.equals(EngineStatus.RunStatus.Stopped)) {
registry.unregisterEngine(engineEntry.getKey())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Require-Bundle: com.google.guava,
org.junit;bundle-version="4.12.0",
org.eclipse.gemoc.executionframework.engine;bundle-version="2.4.0",
org.eclipse.gemoc.xdsmlframework.api;bundle-version="2.4.0",
fr.inria.diverse.k3.al.annotationprocessor.plugin;bundle-version="3.2.1"
fr.inria.diverse.k3.al.annotationprocessor.plugin;bundle-version="3.2.1",
org.eclipse.emf.transaction;bundle-version="1.9.1"
Export-Package: org.eclipse.gemoc.execution.sequential.javaengine.tests,
org.eclipse.gemoc.execution.sequential.javaengine.tests.languages,
org.eclipse.gemoc.execution.sequential.javaengine.tests.wrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class JavaEngineWrapper implements IEngineWrapper {
override prepare(ILanguageWrapper wrapper, IExecutableModel model, Set<String> addons, URI uri) {
engine = new PlainK3ExecutionEngine()
val IRunConfiguration runConf = new TestRunConfiguration(model, uri,wrapper,addons)
val IExecutionContext exeContext = new SequentialModelExecutionContext(runConf, ExecutionMode::Run);
val SequentialModelExecutionContext exeContext = new SequentialModelExecutionContext(runConf, ExecutionMode::Run);
exeContext.initializeResourceModel();
engine.initialize(exeContext)
engine.stopOnAddonError = true;
Expand Down