From 1e55457923ac3b0733848aab2d0ed74beff87cc7 Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Tue, 28 Nov 2023 18:44:39 +0100 Subject: [PATCH] adapted XsemanticsGeneratorRunnerTests --- .../XsemanticsGeneratorRunnerTests.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/org.eclipse.xsemantics.dsl.tests/src/org/eclipse/xsemantics/dsl/tests/generator/XsemanticsGeneratorRunnerTests.java b/tests/org.eclipse.xsemantics.dsl.tests/src/org/eclipse/xsemantics/dsl/tests/generator/XsemanticsGeneratorRunnerTests.java index 7d8d9a502..665ad3ecb 100644 --- a/tests/org.eclipse.xsemantics.dsl.tests/src/org/eclipse/xsemantics/dsl/tests/generator/XsemanticsGeneratorRunnerTests.java +++ b/tests/org.eclipse.xsemantics.dsl.tests/src/org/eclipse/xsemantics/dsl/tests/generator/XsemanticsGeneratorRunnerTests.java @@ -13,6 +13,7 @@ import org.eclipse.xsemantics.dsl.generator.XsemanticsOutputConfigurationProvider; import org.eclipse.xsemantics.dsl.tests.XsemanticsAbstractTests; +import org.eclipse.xsemantics.dsl.tests.XsemanticsInjectorProvider; import java.io.BufferedInputStream; import java.io.File; @@ -22,28 +23,29 @@ import java.util.List; import org.eclipse.xtext.resource.XtextResourceSet; +import org.eclipse.xtext.testing.InjectWith; +import org.eclipse.xtext.testing.XtextRunner; import org.eclipse.xtext.validation.Issue; import org.junit.Test; +import org.junit.runner.RunWith; +import com.google.inject.Inject; + +@InjectWith(XsemanticsInjectorProvider.class) +@RunWith(XtextRunner.class) public class XsemanticsGeneratorRunnerTests extends XsemanticsAbstractTests { protected static final String VALIDATION_SUBDIR = "validation/"; - GeneratorForTests generator; - - XtextResourceSet resourceSet; + @Inject + private GeneratorForTests generator; + + @Inject + private XtextResourceSet resourceSet; // static { // System.setProperty("line.separator", "\n"); // } - @Override - public void setUp() throws Exception { - super.setUp(); - generator = get(GeneratorForTests.class); - generator.setOutputPath(null); - resourceSet = get(XtextResourceSet.class); - } - protected void setGeneratorOutputPath(String outputPath) { generator.setOutputPath(outputPath); }