diff options
author | 2021-06-25 17:12:45 +0200 | |
---|---|---|
committer | 2021-06-25 17:12:45 +0200 | |
commit | baba88758a0ea5f671ab4a2aeacec374bed938c4 (patch) | |
tree | 1be30230a0959ce8d22986d91b1ed2460a328148 /org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend | |
parent | Initial commit (diff) | |
download | refinery-baba88758a0ea5f671ab4a2aeacec374bed938c4.tar.gz refinery-baba88758a0ea5f671ab4a2aeacec374bed938c4.tar.zst refinery-baba88758a0ea5f671ab4a2aeacec374bed938c4.zip |
Add initial prototype
Diffstat (limited to 'org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend')
-rw-r--r-- | org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend new file mode 100644 index 00000000..b007cf8b --- /dev/null +++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * generated by Xtext 2.25.0 | ||
3 | */ | ||
4 | package org.eclipse.viatra.solver.language.tests | ||
5 | |||
6 | import com.google.inject.Inject | ||
7 | import org.eclipse.viatra.solver.language.model.problem.Problem | ||
8 | import org.eclipse.xtext.testing.InjectWith | ||
9 | import org.eclipse.xtext.testing.extensions.InjectionExtension | ||
10 | import org.eclipse.xtext.testing.util.ParseHelper | ||
11 | import org.junit.jupiter.api.Assertions | ||
12 | import org.junit.jupiter.api.Test | ||
13 | import org.junit.jupiter.api.^extension.ExtendWith | ||
14 | |||
15 | @ExtendWith(InjectionExtension) | ||
16 | @InjectWith(ProblemInjectorProvider) | ||
17 | class ProblemParsingTest { | ||
18 | @Inject | ||
19 | ParseHelper<Problem> parseHelper | ||
20 | |||
21 | @Test | ||
22 | def void loadModel() { | ||
23 | val result = parseHelper.parse(''' | ||
24 | Hello Xtext! | ||
25 | ''') | ||
26 | Assertions.assertNotNull(result) | ||
27 | val errors = result.eResource.errors | ||
28 | Assertions.assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''') | ||
29 | } | ||
30 | } | ||