use of org.yakindu.sct.model.sgraph.resource.AbstractSCTResource in project statecharts by Yakindu.
the class GroupStatesIntoCompositeRefactoringTest method testSemanticalRefactoring.
@Test
public void testSemanticalRefactoring() {
Statechart initial = models.loadStatechartFromResource(GROUPING_STATES + INITIAL_STATECHART);
List<State> states = getStatesByName(initial, Lists.newArrayList("B", "C", "D"));
GroupStatesIntoCompositeRefactoring refactoring = new GroupStatesIntoCompositeRefactoring();
refactoring.contextStates = Lists.newArrayList(states);
AbstractSCTResource initialRes = (AbstractSCTResource) initial.eResource();
initialRes.setSerializerEnabled(true);
refactoring.doSemanticalRefactoring();
initialRes.setSerializerEnabled(false);
initialRes.linkSpecificationElements();
Statechart expected = models.loadStatechartFromResource(GROUPING_STATES + EXPECTED_STATECHART);
compareStatecharts(initial, expected);
}
use of org.yakindu.sct.model.sgraph.resource.AbstractSCTResource in project statecharts by Yakindu.
the class AbstractRefactoring method parseAndLinkSpecificationElements.
/**
* Parses and links the specification elements of {@link AbstractRefactoring#getResource()}
*/
protected void parseAndLinkSpecificationElements() {
Resource resource = getResource();
if (resource instanceof AbstractSCTResource) {
((AbstractSCTResource) resource).parseSpecificationElements();
((AbstractSCTResource) resource).linkSpecificationElements();
}
}
Aggregations