use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep in project mule-migration-assistant by mulesoft.
the class AfterExceptionMigrationStepTestCase method convertBeforeTagWithContent.
@Test
public void convertBeforeTagWithContent() {
final AfterExceptionTagMigrationStep step = new AfterExceptionTagMigrationStep();
step.setApplicationModel(appModel);
Element element = getTestElement().addContent(new Element(GENERIC_TAG_NAME).setText(GENERIC_TAG_VALUE).setAttribute(GENERIC_TAG_ATTRIBUTE_NAME, GENERIC_TAG_ATTRIBUTE_VALUE));
step.execute(element, reportMock);
assertProxyAndSourceElements(element, 1);
final Element source = (Element) element.getContent(0);
final Element tryElement = (Element) source.getContent(0);
assertThat(tryElement.getName(), is(TRY_TAG_NAME));
assertThat(tryElement.getContent().size(), is(2));
assertExecuteNextElement(tryElement, 0);
assertErrorHandlerElement(tryElement, 1);
final Element errorHandlerElement = (Element) tryElement.getContent(1);
final Element onErrorContinueElement = (Element) errorHandlerElement.getContent(0);
final Element contentElement = (Element) onErrorContinueElement.getContent(0);
assertThat(contentElement.getParentElement().getName(), is(ON_ERROR_CONTINUE_TAG_NAME));
assertThat(contentElement.getValue(), is(GENERIC_TAG_VALUE));
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep in project mule-migration-assistant by mulesoft.
the class AfterExceptionMigrationStepTestCase method convertRawBeforeTag.
@Test
public void convertRawBeforeTag() {
final AfterExceptionTagMigrationStep step = new AfterExceptionTagMigrationStep();
step.setApplicationModel(appModel);
Element element = getTestElement();
step.execute(element, reportMock);
assertProxyAndSourceElements(element, 1);
final Element source = (Element) element.getContent(0);
final Element tryElement = (Element) source.getContent(0);
assertThat(tryElement.getName(), is(TRY_TAG_NAME));
assertThat(tryElement.getContent().size(), is(2));
assertExecuteNextElement(tryElement, 0);
assertErrorHandlerElement(tryElement, 0);
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep in project mule-migration-assistant by mulesoft.
the class BasicStructureMigrationTask method getSteps.
@Override
public List<MigrationStep> getSteps() {
PolicyFileRenameMigrationStep policyFileRenameMigrationStep = new PolicyFileRenameMigrationStep();
policyFileRenameMigrationStep.setApplicationModel(getApplicationModel());
List<MigrationStep> steps = new ArrayList<>();
steps.add(new PolicyTagMigrationStep());
steps.add(new BeforeTagMigrationStep());
steps.add(new AfterTagMigrationStep());
steps.add(new BeforeExceptionTagMigrationStep());
steps.add(new AfterExceptionTagMigrationStep());
steps.add(new PointcutTagMigrationStep());
steps.add(new DataTagMigrationStep());
steps.add(new CleanupAttributesMigrationStep());
steps.add(policyFileRenameMigrationStep);
return steps;
}
Aggregations