-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stakeholders & Values: Transformations (#357)
- Loading branch information
Showing
40 changed files
with
1,615 additions
and
37 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...r.dsl.ide.tests/src/org/contextmapper/dsl/ide/tests/actions/StakeholdersActionsTest.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,44 @@ | ||
/* | ||
* Copyright 2024 The Context Mapper Project Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.contextmapper.dsl.ide.tests.actions | ||
|
||
import org.junit.jupiter.api.Test | ||
|
||
class StakeholdersActionsTest extends AbstractBoundedContextCodeActionTest { | ||
|
||
@Test | ||
def void canOfferActionsOnStakeholder() { | ||
testCodeAction [ | ||
model = ''' | ||
Stakeholders { | ||
Stakeholder Tester | ||
} | ||
''' | ||
line = 1 | ||
expectedCodeActions = ''' | ||
command : cml.ar.moveStakeholderToGroup.proxy | ||
title : Move Stakeholder To New Group | ||
args : | ||
file://«this.root»/MyModel.cml,Tester | ||
command : cml.ar.createValueForStakeholder.proxy | ||
title : Create Value For Stakeholder | ||
args : | ||
file://«this.root»/MyModel.cml,Tester | ||
''' | ||
] | ||
} | ||
|
||
} |
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
40 changes: 40 additions & 0 deletions
40
...xtmapper.dsl.ide.tests/src/org/contextmapper/dsl/ide/tests/actions/ValueActionsTest.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,40 @@ | ||
/* | ||
* Copyright 2024 The Context Mapper Project Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.contextmapper.dsl.ide.tests.actions | ||
|
||
import org.junit.jupiter.api.Test | ||
|
||
class ValueActionsTest extends AbstractBoundedContextCodeActionTest { | ||
|
||
@Test | ||
def void canOfferActionsOnValue() { | ||
testCodeAction [ | ||
model = ''' | ||
ValueRegister TestRegister { | ||
Value TestValue | ||
} | ||
''' | ||
line = 1 | ||
expectedCodeActions = ''' | ||
command : cml.ar.wrapValueInCluster.proxy | ||
title : Wrap Value In Cluster | ||
args : | ||
file://«this.root»/MyModel.cml,TestValue | ||
''' | ||
] | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...ntextmapper/dsl/ide/tests/commands/refactoring/AddEthicalValueAssessmentCommandTest.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,49 @@ | ||
/* | ||
* Copyright 2024 The Context Mapper Project Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.contextmapper.dsl.ide.tests.commands.refactoring | ||
|
||
import com.google.gson.JsonArray | ||
import com.google.gson.JsonPrimitive | ||
import org.contextmapper.dsl.ide.commands.CMLCommandService | ||
import org.contextmapper.dsl.ide.tests.commands.AbstractCMLCommandTest | ||
import org.eclipse.lsp4j.ExecuteCommandParams | ||
import org.junit.jupiter.api.Test | ||
|
||
class AddEthicalValueAssessmentCommandTest extends AbstractCMLCommandTest { | ||
|
||
@Test | ||
def void testARCommandExecution() { | ||
// given | ||
initializeCommandsDynamically() | ||
val model = ''' | ||
UserStory SameDayDelivery_1 { | ||
As a "Shopper" I want to "instantly receive" an "Order" so that "I am efficient" | ||
} | ||
''' | ||
val fileURI = 'test.cml'.writeFile(model) | ||
|
||
// when | ||
val refactoringParams = new JsonArray | ||
refactoringParams.add("SameDayDelivery_1") | ||
val result = languageServer.executeCommand( | ||
new ExecuteCommandParams("cml.ar.addEthicalValueAssessment", #[new JsonPrimitive(fileURI), refactoringParams])) | ||
val resultVal = result.get as String | ||
|
||
// then | ||
CMLCommandService.COMMAND_EXECUTED_RETURN_VALUE.assertEquals(resultVal) | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...contextmapper/dsl/ide/tests/commands/refactoring/CreateValue4StakeholderCommandTest.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,49 @@ | ||
/* | ||
* Copyright 2024 The Context Mapper Project Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.contextmapper.dsl.ide.tests.commands.refactoring | ||
|
||
import com.google.gson.JsonArray | ||
import com.google.gson.JsonPrimitive | ||
import org.contextmapper.dsl.ide.commands.CMLCommandService | ||
import org.contextmapper.dsl.ide.tests.commands.AbstractCMLCommandTest | ||
import org.eclipse.lsp4j.ExecuteCommandParams | ||
import org.junit.jupiter.api.Test | ||
|
||
class CreateValue4StakeholderCommandTest extends AbstractCMLCommandTest { | ||
|
||
@Test | ||
def void testARCommandExecution() { | ||
// given | ||
initializeCommandsDynamically() | ||
val model = ''' | ||
Stakeholders { | ||
Stakeholder Tester | ||
} | ||
''' | ||
val fileURI = 'test.cml'.writeFile(model) | ||
|
||
// when | ||
val refactoringParams = new JsonArray | ||
refactoringParams.add("Tester") | ||
val result = languageServer.executeCommand( | ||
new ExecuteCommandParams("cml.ar.createValueForStakeholder", #[new JsonPrimitive(fileURI), refactoringParams])) | ||
val resultVal = result.get as String | ||
|
||
// then | ||
CMLCommandService.COMMAND_EXECUTED_RETURN_VALUE.assertEquals(resultVal) | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
.../contextmapper/dsl/ide/tests/commands/refactoring/MoveStakeholderToGroupCommandTest.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,49 @@ | ||
/* | ||
* Copyright 2024 The Context Mapper Project Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.contextmapper.dsl.ide.tests.commands.refactoring | ||
|
||
import com.google.gson.JsonArray | ||
import com.google.gson.JsonPrimitive | ||
import org.contextmapper.dsl.ide.commands.CMLCommandService | ||
import org.contextmapper.dsl.ide.tests.commands.AbstractCMLCommandTest | ||
import org.eclipse.lsp4j.ExecuteCommandParams | ||
import org.junit.jupiter.api.Test | ||
|
||
class MoveStakeholderToGroupCommandTest extends AbstractCMLCommandTest { | ||
|
||
@Test | ||
def void testARCommandExecution() { | ||
// given | ||
initializeCommandsDynamically() | ||
val model = ''' | ||
Stakeholders { | ||
Stakeholder Tester | ||
} | ||
''' | ||
val fileURI = 'test.cml'.writeFile(model) | ||
|
||
// when | ||
val refactoringParams = new JsonArray | ||
refactoringParams.add("Tester") | ||
val result = languageServer.executeCommand( | ||
new ExecuteCommandParams("cml.ar.moveStakeholderToGroup", #[new JsonPrimitive(fileURI), refactoringParams])) | ||
val resultVal = result.get as String | ||
|
||
// then | ||
CMLCommandService.COMMAND_EXECUTED_RETURN_VALUE.assertEquals(resultVal) | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
.../org/contextmapper/dsl/ide/tests/commands/refactoring/WrapValueInClusterCommandTest.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,49 @@ | ||
/* | ||
* Copyright 2024 The Context Mapper Project Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.contextmapper.dsl.ide.tests.commands.refactoring | ||
|
||
import com.google.gson.JsonArray | ||
import com.google.gson.JsonPrimitive | ||
import org.contextmapper.dsl.ide.commands.CMLCommandService | ||
import org.contextmapper.dsl.ide.tests.commands.AbstractCMLCommandTest | ||
import org.eclipse.lsp4j.ExecuteCommandParams | ||
import org.junit.jupiter.api.Test | ||
|
||
class WrapValueInClusterCommandTest extends AbstractCMLCommandTest { | ||
|
||
@Test | ||
def void testARCommandExecution() { | ||
// given | ||
initializeCommandsDynamically() | ||
val model = ''' | ||
ValueRegister TestRegister { | ||
Value TestValue | ||
} | ||
''' | ||
val fileURI = 'test.cml'.writeFile(model) | ||
|
||
// when | ||
val refactoringParams = new JsonArray | ||
refactoringParams.add("TestValue") | ||
val result = languageServer.executeCommand( | ||
new ExecuteCommandParams("cml.ar.wrapValueInCluster", #[new JsonPrimitive(fileURI), refactoringParams])) | ||
val resultVal = result.get as String | ||
|
||
// then | ||
CMLCommandService.COMMAND_EXECUTED_RETURN_VALUE.assertEquals(resultVal) | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.