diff options
Diffstat (limited to 'language-to-store/src')
2 files changed, 55 insertions, 0 deletions
diff --git a/language-to-store/src/main/java/org/eclipse/viatra/solver/language/mapping/PartialModelMapper.java b/language-to-store/src/main/java/org/eclipse/viatra/solver/language/mapping/PartialModelMapper.java new file mode 100644 index 00000000..7eae4361 --- /dev/null +++ b/language-to-store/src/main/java/org/eclipse/viatra/solver/language/mapping/PartialModelMapper.java | |||
@@ -0,0 +1,11 @@ | |||
1 | package org.eclipse.viatra.solver.language.mapping; | ||
2 | |||
3 | import org.eclipse.viatra.solver.data.model.Model; | ||
4 | import org.eclipse.viatra.solver.language.model.problem.Problem; | ||
5 | |||
6 | public class PartialModelMapper { | ||
7 | public Model transformProblem(Problem problem) { | ||
8 | // TODO @Marci Implement this | ||
9 | throw new UnsupportedOperationException(); | ||
10 | } | ||
11 | } | ||
diff --git a/language-to-store/src/test/java/org/eclipse/viatra/solver/language/mapping/tests/PartialModelMapperTest.xtend b/language-to-store/src/test/java/org/eclipse/viatra/solver/language/mapping/tests/PartialModelMapperTest.xtend new file mode 100644 index 00000000..a769ae20 --- /dev/null +++ b/language-to-store/src/test/java/org/eclipse/viatra/solver/language/mapping/tests/PartialModelMapperTest.xtend | |||
@@ -0,0 +1,44 @@ | |||
1 | package org.eclipse.viatra.solver.language.mapping.tests | ||
2 | |||
3 | import com.google.inject.Inject | ||
4 | import org.eclipse.viatra.solver.language.mapping.PartialModelMapper | ||
5 | import org.eclipse.viatra.solver.language.model.problem.Problem | ||
6 | import org.eclipse.viatra.solver.language.tests.ProblemInjectorProvider | ||
7 | import org.eclipse.xtext.testing.InjectWith | ||
8 | import org.eclipse.xtext.testing.extensions.InjectionExtension | ||
9 | import org.eclipse.xtext.testing.util.ParseHelper | ||
10 | import org.junit.jupiter.api.BeforeEach | ||
11 | import org.junit.jupiter.api.Disabled | ||
12 | import org.junit.jupiter.api.Test | ||
13 | import org.junit.jupiter.api.^extension.ExtendWith | ||
14 | |||
15 | import static org.hamcrest.MatcherAssert.assertThat | ||
16 | import static org.hamcrest.Matchers.* | ||
17 | |||
18 | @ExtendWith(InjectionExtension) | ||
19 | @InjectWith(ProblemInjectorProvider) | ||
20 | class PartialModelMapperTest { | ||
21 | @Inject | ||
22 | ParseHelper<Problem> parseHelper | ||
23 | |||
24 | PartialModelMapper mapper | ||
25 | |||
26 | @BeforeEach | ||
27 | def void beforeEach() { | ||
28 | mapper = new PartialModelMapper | ||
29 | } | ||
30 | |||
31 | @Test | ||
32 | @Disabled("Method not yet implemented") | ||
33 | def void exampleTest() { | ||
34 | val problem = parseHelper.parse(''' | ||
35 | class Person { | ||
36 | Person[0..*] friend | ||
37 | } | ||
38 | |||
39 | friend(a, b). | ||
40 | ''') | ||
41 | val model = mapper.transformProblem(problem) | ||
42 | assertThat(model, notNullValue()) | ||
43 | } | ||
44 | } | ||