Skip to content

Commit

Permalink
use XsemanticsBaseTest
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 28, 2023
1 parent 8f2c072 commit 2220f73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ abstract class XsemanticsBaseTest {

@Inject Provider<XtextResourceSet> resourceSetProvider

@Inject extension ValidationTestHelper
@Inject
protected extension ValidationTestHelper validationTestHelper

// @BeforeClass
// def static void setNewLine() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,13 @@

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xsemantics.dsl.tests.input.FjTypeSystemFiles;
import org.eclipse.xsemantics.dsl.tests.input.XsemanticsTestFiles;
import org.eclipse.xsemantics.dsl.validation.XsemanticsValidator;
import org.eclipse.xsemantics.dsl.validation.testutils.ValidatorTester;
import org.eclipse.xsemantics.dsl.xsemantics.XsemanticsFile;
import org.eclipse.xsemantics.dsl.xsemantics.XsemanticsPackage;
import org.eclipse.xtext.testing.InjectWith;
import org.eclipse.xtext.testing.XtextRunner;
import org.eclipse.xtext.testing.util.ParseHelper;
import org.eclipse.xtext.testing.validation.AssertableDiagnostics;
import org.eclipse.xtext.testing.validation.ValidationTestHelper;
import org.eclipse.xtext.xbase.XbasePackage;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -52,26 +48,16 @@

@InjectWith(XsemanticsInjectorProvider.class)
@RunWith(XtextRunner.class)
public class XsemanticsValidatorTests {
public class XsemanticsValidatorTests extends XsemanticsBaseTest {

private static final String IN_SYSTEM_ORG_ECLIPSE_XSEMANTICS_TEST_TYPE_SYSTEM = ", in system: org.eclipse.xsemantics.test.TypeSystem";

@Inject
private ParseHelper<XsemanticsFile> parser;

@Inject
private XsemanticsValidator validator;

@Inject
private ValidatorTester<XsemanticsValidator> tester;

@Inject
private ValidationTestHelper validationTestHelper;

private XsemanticsTestFiles testFiles = new XsemanticsTestFiles();

private FjTypeSystemFiles fjTSFiles = new FjTypeSystemFiles();

@Before
public void setUp() {
validator.setEnableWarnings(false);
Expand Down Expand Up @@ -188,7 +174,7 @@ public void testRuleConclusionNotSubtypeBoth() throws Exception {

@Test
public void testFjExpressionTypingRules() throws Exception {
assertOk(loadModelAndValidate(fjTSFiles.fjExpressionTypeRules()));
assertOk(loadModelAndValidate(fjTestFiles.fjExpressionTypeRules()));
}

@Test
Expand Down

0 comments on commit 2220f73

Please sign in to comment.