diff options
author | 2018-10-08 18:09:21 +0200 | |
---|---|---|
committer | 2018-10-08 18:09:21 +0200 | |
commit | 438c76457b55926e94c510f1c441670df50c404b (patch) | |
tree | 53277de465cb3a50a195796ff0b38c14c13ec142 /Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/hu/bme/mit/inf/dslreasoner/application | |
parent | Updated progress monitor for huge amount instance generation processes (diff) | |
download | VIATRA-Generator-438c76457b55926e94c510f1c441670df50c404b.tar.gz VIATRA-Generator-438c76457b55926e94c510f1c441670df50c404b.tar.zst VIATRA-Generator-438c76457b55926e94c510f1c441670df50c404b.zip |
Example standalone runs
Diffstat (limited to 'Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/hu/bme/mit/inf/dslreasoner/application')
-rw-r--r-- | Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/hu/bme/mit/inf/dslreasoner/application/FAMTest/StandaloneScriptExecutionTests.xtend | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/hu/bme/mit/inf/dslreasoner/application/FAMTest/StandaloneScriptExecutionTests.xtend b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/hu/bme/mit/inf/dslreasoner/application/FAMTest/StandaloneScriptExecutionTests.xtend new file mode 100644 index 00000000..1768cd7f --- /dev/null +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/src/hu/bme/mit/inf/dslreasoner/application/FAMTest/StandaloneScriptExecutionTests.xtend | |||
@@ -0,0 +1,42 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.application.FAMTest | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor | ||
4 | import org.junit.Test | ||
5 | import org.junit.Assert | ||
6 | |||
7 | class StandaloneScriptExecutionTests { | ||
8 | private def runWithPath(String path, String expectedMessage) { | ||
9 | val message = StandaloneScriptExecutor.executeScript(path) | ||
10 | Assert.assertEquals(expectedMessage,message) | ||
11 | } | ||
12 | private def runWithPathCheckingPrefix(String path, String prefix) { | ||
13 | val message = StandaloneScriptExecutor.executeScript(path) | ||
14 | Assert.assertTrue(message.startsWith(prefix)) | ||
15 | } | ||
16 | private def runWithPath(String path) { | ||
17 | runWithPath(path,null) | ||
18 | } | ||
19 | |||
20 | @Test | ||
21 | def void invalidExtension() { | ||
22 | runWithPath("invalid","Unsupported file extension: invalid") | ||
23 | } | ||
24 | @Test | ||
25 | def void nonexistingFile() { | ||
26 | runWithPathCheckingPrefix("invalid.vsconfig","Unable to load Configuration Script!") | ||
27 | } | ||
28 | @Test | ||
29 | def void errorousImports() { | ||
30 | runWithPath("configs/ErrorousImports.vsconfig",''' | ||
31 | The Configuration Script contains 4 errors: | ||
32 | Couldn't resolve reference to EPackage 'error'. | ||
33 | Couldn't resolve reference to PatternModel 'error'. | ||
34 | Couldn't resolve reference to EPackage 'functionalarchitecture'. | ||
35 | Couldn't resolve reference to PatternModel 'hu.bme.mit.inf.dslreasoner.domains.fam'. | ||
36 | ''') | ||
37 | } | ||
38 | @Test | ||
39 | def void generateFAM() { | ||
40 | runWithPath("configs/generation.vsconfig") | ||
41 | } | ||
42 | } \ No newline at end of file | ||