use of org.contextmapper.dsl.refactoring.SemanticCMLRefactoring in project context-mapper-dsl by ContextMapper.
the class SplitAggregateByEntitiesRefactoringHandler method executeRefactoring.
@Override
protected void executeRefactoring(CMLResource resource, ExecutionEvent event) {
Aggregate aggregate = (Aggregate) getSelectedElement();
SemanticCMLRefactoring ar = new SplitAggregateByEntitiesRefactoring(aggregate.getName());
ar.refactor(resource, getAllResources());
ar.persistChanges(serializer);
}
use of org.contextmapper.dsl.refactoring.SemanticCMLRefactoring in project context-mapper-dsl by ContextMapper.
the class SplitBoundedContextByOwnerRefactoringHandler method executeRefactoring.
@Override
protected void executeRefactoring(CMLResource resource, ExecutionEvent event) {
BoundedContext bc = (BoundedContext) getSelectedElement();
SemanticCMLRefactoring ar = new SplitBoundedContextByOwner(bc.getName());
ar.refactor(resource, getAllResources());
ar.persistChanges(serializer);
}
use of org.contextmapper.dsl.refactoring.SemanticCMLRefactoring in project context-mapper-dsl by ContextMapper.
the class SwitchFromPartnershipToSharedKernelRefactoringHandler method executeRefactoring.
@Override
protected void executeRefactoring(CMLResource resource, ExecutionEvent event) {
Partnership partnership = (Partnership) getSelectedElement();
SemanticCMLRefactoring ar = new SwitchFromPartnershipToSharedKernelRefactoring(partnership.getParticipant1().getName(), partnership.getParticipant2().getName());
ar.refactor(resource);
ar.persistChanges(serializer);
}
use of org.contextmapper.dsl.refactoring.SemanticCMLRefactoring in project context-mapper-dsl by ContextMapper.
the class AbstractRefactoringCommand method executeCommand.
@Override
public void executeCommand(CMLResource cmlResource, Document document, ILanguageServerAccess access, ExecuteCommandParams params) {
access.getLanguageClient().applyEdit(new ApplyWorkspaceEditParams(editRecorder.recordWorkspaceEdit(access, cmlResource.getURI(), document, (Resource copiedResource) -> {
CMLResource copiedCMLResource = new CMLResource(copiedResource);
SemanticCMLRefactoring ar = getRefactoring(params);
ar.refactor(copiedCMLResource);
}), "Apply Architectural Refactoring (AR)"));
}
use of org.contextmapper.dsl.refactoring.SemanticCMLRefactoring in project context-mapper-dsl by ContextMapper.
the class RefactoringSerializationExceptionTest method canHandleNoEObjectDescriptionSerializationError.
@Test
public void canHandleNoEObjectDescriptionSerializationError() throws IOException {
// given
CMLResource cmlResource = getResourceCopyOfTestCML("NoEObjectDescriptionExceptionTest.cml");
Set<String> userStories = Sets.newHashSet();
userStories.add("UC1Ads");
SemanticCMLRefactoring ar = new DeriveSubdomainFromUserRequirements("TestDomain", "TestSubdomain", userStories);
// when, then
assertThrows(RefactoringSerializationException.class, () -> {
ar.refactor(cmlResource);
ar.persistChanges(serializer);
});
}
Aggregations