-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe2de09
commit cf2ce90
Showing
7 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...work/tests/dsl/project/validator/modelElementPackageCongruence/controllerInController.md2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package TestProject.controllers | ||
|
||
remoteConnection testConnection { | ||
uri "test" | ||
} |
5 changes: 5 additions & 0 deletions
5
...mework/tests/dsl/project/validator/modelElementPackageCongruence/controllerInWorkflow.md2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package TestProject.workflows | ||
|
||
remoteConnection testConnection { | ||
uri "test" | ||
} |
5 changes: 5 additions & 0 deletions
5
...2/framework/tests/dsl/project/validator/modelElementPackageCongruence/modelInWorkflow.md2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package TestProject.workflows | ||
|
||
entity Test { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...u/md2/framework/tests/dsl/project/validator/modelElementPackageCongruence/viewInModel.md2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package TestProject.models | ||
|
||
FlowLayoutPane MediaCapturingView2 (vertical) { | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...2/framework/tests/dsl/project/validator/modelElementPackageCongruence/workflowInModel.md2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package TestProject.models | ||
|
||
WorkflowElement LocationDetection | ||
fires LocationDetectionEvent { | ||
start LocationDetection | ||
} | ||
|
||
App CurrentStateProjectApp { | ||
WorkflowElements { | ||
LocationDetection (startable: "Start Controller 1") | ||
} | ||
appName "functionTestApp" | ||
} |
56 changes: 56 additions & 0 deletions
56
.../de/wwu/md2/framework/tests/dsl/project/validator/ModelElementPackageCongruenceTest.xtend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package de.wwu.md2.framework.tests.dsl.project.validator | ||
|
||
import org.eclipse.xtext.junit4.InjectWith | ||
import de.wwu.md2.framework.MD2InjectorProvider | ||
import org.junit.runner.RunWith | ||
import org.eclipse.xtext.junit4.XtextRunner | ||
import javax.inject.Inject | ||
import org.eclipse.xtext.junit4.util.ParseHelper | ||
import de.wwu.md2.framework.mD2.MD2Model | ||
import org.junit.Before | ||
import static extension de.wwu.md2.framework.tests.utils.ModelProvider.* | ||
|
||
import org.junit.Test | ||
import org.eclipse.xtext.junit4.validation.ValidationTestHelper | ||
|
||
import de.wwu.md2.framework.mD2.MD2Package | ||
import de.wwu.md2.framework.validation.ProjectValidator | ||
|
||
@InjectWith(typeof(MD2InjectorProvider)) | ||
@RunWith(typeof(XtextRunner)) | ||
|
||
class ModelElementPackageCongruenceTest { | ||
@Inject extension ParseHelper<MD2Model> | ||
@Inject extension ValidationTestHelper | ||
|
||
MD2Model controllerModel; | ||
MD2Model modelModel; | ||
MD2Model viewModel; | ||
MD2Model workflowModel | ||
MD2Model testModel | ||
|
||
@Before | ||
def void setUp() { | ||
controllerModel = PROJECT_VALIDATOR_MEC_CIW.load.parse | ||
modelModel = PROJECT_VALIDATOR_MEC_MIW.load.parse | ||
viewModel = PROJECT_VALIDATOR_MEC_VIM.load.parse | ||
workflowModel = PROJECT_VALIDATOR_MEC_WIM.load.parse | ||
testModel = PROJECT_VALIDATOR_MEC_CIC.load.parse | ||
} | ||
|
||
/** | ||
* Test whether the correct error is thrown when model elements are declared in the wrong file. | ||
*/ | ||
@Test | ||
def checkModelElementCompliesWithPackageTest() { | ||
controllerModel.assertError(MD2Package::eINSTANCE.MD2Model, ProjectValidator::MODELELEMENT_PACKAGE) | ||
modelModel.assertError(MD2Package::eINSTANCE.MD2Model, ProjectValidator::MODELELEMENT_PACKAGE) | ||
viewModel.assertError(MD2Package::eINSTANCE.MD2Model, ProjectValidator::MODELELEMENT_PACKAGE) | ||
workflowModel.assertError(MD2Package::eINSTANCE.MD2Model, ProjectValidator::MODELELEMENT_PACKAGE) | ||
} | ||
|
||
@Test | ||
def checkNoErrorForCorrectPackage(){ | ||
testModel.assertNoError(ProjectValidator::MODELELEMENT_PACKAGE) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters