use of com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Document in project mule-migration-assistant by mulesoft.
the class PreprocessNamespacesTest method execute.
@Test
public void execute() throws Exception {
preprocessNamespaces.execute(applicationModel, report.getReport());
Document document = Iterables.get(applicationModel.getApplicationDocuments().values(), 0);
assertThat("The namespace was removed.", document.getRootElement().getAdditionalNamespaces().size(), is(3));
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Document in project mule-migration-assistant by mulesoft.
the class ProcessorChainReferenceTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, processorChain.getAppliedTo().getExpression()).forEach(node -> processorChain.execute(node, report.getReport()));
getElementsFromDocument(doc, processorChainReference.getAppliedTo().getExpression()).forEach(node -> processorChainReference.execute(node, report.getReport()));
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
String xmlString = outputter.outputString(doc);
assertThat(xmlString, isSimilarTo(IOUtils.toString(this.getClass().getClassLoader().getResource(targetPath.toString()).toURI(), UTF_8)).ignoreComments().normalizeWhitespace());
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Document in project mule-migration-assistant by mulesoft.
the class ApplicationModel method getNodes.
/**
* Returns all the nodes in the application documents that match the xpath expression
*
* @param xpathExpression the xpath expression that defines which nodes should be retrieved
* @return all the nodes that match the xpath expression
*/
public List<Element> getNodes(XPathExpression xpathExpression) {
checkArgument(xpathExpression != null, "The Xpath Expression must not be null nor empty");
List<Element> nodes = new LinkedList<>();
for (Document doc : getApplicationDocuments().values()) {
nodes.addAll(getElementsFromDocument(xpathExpression, doc));
}
for (Document doc : getDomainDocuments().values()) {
nodes.addAll(getElementsFromDocument(xpathExpression, doc));
}
return nodes;
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Document in project mule-migration-assistant by mulesoft.
the class XmlToDomTransformerTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, xmlToDomTransformer.getAppliedTo().getExpression()).forEach(node -> xmlToDomTransformer.execute(node, report.getReport()));
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
String xmlString = outputter.outputString(doc);
assertThat(xmlString, isSimilarTo(IOUtils.toString(this.getClass().getClassLoader().getResource(targetPath.toString()).toURI(), UTF_8)).ignoreComments().normalizeWhitespace());
report.expectReportEntry("mulexml.xmlToDom");
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Document in project mule-migration-assistant by mulesoft.
the class AssertFalseTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(MUNIT_SAMPLE_PATH.toString()).toURI().getPath());
node = getElementsFromDocument(doc, assertFalse.getAppliedTo().getExpression()).get(0);
assertFalse.execute(node, report.getReport());
assertThat("The node didn't change", node.getName(), is("assert-that"));
assertThat("The attribute didn't change", node.getAttribute("is"), is(notNullValue()));
assertThat("The attribute didn't change", node.getAttribute("is").getValue(), is("#[MunitTools::equalTo(false)]"));
}
Aggregations