Skip to content

Commit

Permalink
[test] Adapt test helper code to latest api changes (#99)
Browse files Browse the repository at this point in the history
Signed-off-by: Erwan Bousse <erwan.bousse@ls2n.fr>
  • Loading branch information
ebousse committed Jun 7, 2019
1 parent 9c68463 commit 6bad85d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
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 @@ -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

0 comments on commit 6bad85d

Please sign in to comment.