Search in sources :

Example 96 with Element

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));
}
Also used : Element(org.jdom2.Element)

Example 97 with Element

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);
}
Also used : AfterExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep) Element(org.jdom2.Element) Test(org.junit.Test)

Example 98 with Element

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));
}
Also used : Element(org.jdom2.Element)

Example 99 with Element

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);
}
Also used : BeforeExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeExceptionTagMigrationStep) Element(org.jdom2.Element) Test(org.junit.Test)

Example 100 with Element

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);
}
Also used : BeforeExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeExceptionTagMigrationStep) Element(org.jdom2.Element) Test(org.junit.Test)

Aggregations

Element (org.jdom2.Element)3601 Document (org.jdom2.Document)589 Test (org.junit.Test)469 ArrayList (java.util.ArrayList)376 IOException (java.io.IOException)317 JDOMException (org.jdom2.JDOMException)230 Attribute (org.jdom2.Attribute)217 SAXBuilder (org.jdom2.input.SAXBuilder)169 Namespace (org.jdom2.Namespace)157 List (java.util.List)148 Element (org.osate.aadl2.Element)143 File (java.io.File)140 XMLOutputter (org.jdom2.output.XMLOutputter)136 Test (org.junit.jupiter.api.Test)134 HashMap (java.util.HashMap)132 XConfiguration (org.apache.oozie.util.XConfiguration)98 Configuration (org.apache.hadoop.conf.Configuration)96 StringReader (java.io.StringReader)85 NamedElement (org.osate.aadl2.NamedElement)77 Iterator (java.util.Iterator)72