use of org.adempiere.pipo2.Element in project mule-migration-assistant by mulesoft.
the class AfterExceptionMigrationStepTestCase method assertErrorHandlerElement.
private void assertErrorHandlerElement(Element tryElement, int expectedOnErrorContinueContentSize) {
final Element errorHandlerElement = (Element) tryElement.getContent(1);
assertThat(errorHandlerElement.getName(), is(ERROR_HANDLER_TAG_NAME));
assertThat(errorHandlerElement.getContent().size(), is(1));
final Element onErrorContinueElement = (Element) errorHandlerElement.getContent(0);
assertThat(onErrorContinueElement.getName(), is(ON_ERROR_CONTINUE_TAG_NAME));
assertThat(onErrorContinueElement.getContent().size(), is(expectedOnErrorContinueContentSize));
}
use of org.adempiere.pipo2.Element 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 org.adempiere.pipo2.Element in project mule-migration-assistant by mulesoft.
the class BasicPolicyStructureMigrationTestCase method assertExecuteNextElement.
protected void assertExecuteNextElement(Element source, int expectedExecuteNextPosition) {
final Element executeNext = (Element) source.getContent(expectedExecuteNextPosition);
assertThat(executeNext.getName(), is(EXECUTE_NEXT_TAG_NAME));
assertThat(executeNext.getNamespacePrefix(), is(HTTP_POLICY_NAMESPACE_PREFIX));
assertThat(executeNext.getContent().size(), is(0));
}
use of org.adempiere.pipo2.Element in project mule-migration-assistant by mulesoft.
the class BeforeExceptionMigrationStepTestCase method convertRawBeforeTag.
@Test
public void convertRawBeforeTag() {
final BeforeExceptionTagMigrationStep step = new BeforeExceptionTagMigrationStep();
step.setApplicationModel(appModel);
Element element = getTestElement();
step.execute(element, reportMock);
assertProxyAndSourceElements(element, 1);
assertExecuteNextElement((Element) element.getContent(0), 0);
}
use of org.adempiere.pipo2.Element in project mule-migration-assistant by mulesoft.
the class BeforeExceptionMigrationStepTestCase method convertBeforeTagWithContent.
@Test
public void convertBeforeTagWithContent() {
final BeforeExceptionTagMigrationStep step = new BeforeExceptionTagMigrationStep();
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);
assertExecuteNextElement((Element) element.getContent(0), 0);
}
Aggregations