use of com.adaptris.core.util.DocumentBuilderFactoryBuilder in project interlok by adaptris.
the class XpathQueryHelperTest method testResolveSingleNode_Missing_AllowEmptyFalse.
@Test(expected = CoreException.class)
public void testResolveSingleNode_Missing_AllowEmptyFalse() throws Exception {
DocumentBuilderFactoryBuilder builder = DocumentBuilderFactoryBuilder.newInstance();
Document doc = XmlHelper.createDocument(XpathQueryCase.XML, builder);
XPath xpathToUse = XPath.newXPathInstance(builder, null);
XpathQueryHelper.resolveSingleNode(doc, xpathToUse, "//@MissingAttribute", false);
}
use of com.adaptris.core.util.DocumentBuilderFactoryBuilder in project interlok by adaptris.
the class XpathQueryHelperTest method testResolveSingleTextItem_Missing_AllowEmptyTrue.
@Test
public void testResolveSingleTextItem_Missing_AllowEmptyTrue() throws Exception {
DocumentBuilderFactoryBuilder builder = DocumentBuilderFactoryBuilder.newInstance();
Document doc = XmlHelper.createDocument(XpathQueryCase.XML, builder);
XPath xpathToUse = XPath.newXPathInstance(builder, null);
assertEquals("", XpathQueryHelper.resolveSingleTextItem(doc, xpathToUse, "//@MissingAttribute", true));
}
use of com.adaptris.core.util.DocumentBuilderFactoryBuilder in project interlok by adaptris.
the class XpathQueryHelperTest method resolveMultipleTextItems_Missing_AllowEmptyTrue.
@Test
public void resolveMultipleTextItems_Missing_AllowEmptyTrue() throws Exception {
DocumentBuilderFactoryBuilder builder = DocumentBuilderFactoryBuilder.newInstance();
Document doc = XmlHelper.createDocument(XpathQueryCase.XML, builder);
XPath xpathToUse = XPath.newXPathInstance(builder, null);
assertEquals("", XpathQueryHelper.resolveMultipleTextItems(doc, xpathToUse, "//@MissingAttribute", true, "|"));
}
use of com.adaptris.core.util.DocumentBuilderFactoryBuilder in project interlok by adaptris.
the class XpathQueryHelperTest method testResolveMultipleNode_Missing_AllowEmptyTrue.
@Test
public void testResolveMultipleNode_Missing_AllowEmptyTrue() throws Exception {
DocumentBuilderFactoryBuilder builder = DocumentBuilderFactoryBuilder.newInstance();
Document doc = XmlHelper.createDocument(XpathQueryCase.XML, builder);
XPath xpathToUse = XPath.newXPathInstance(builder, null);
NodeList nodelist = XpathQueryHelper.resolveNodeList(doc, xpathToUse, "//@MissingAttribute", true);
assertNotNull(nodelist);
assertEquals(0, nodelist.getLength());
}
use of com.adaptris.core.util.DocumentBuilderFactoryBuilder in project interlok by adaptris.
the class XpathQueryHelperTest method testResolveSingleNode.
@Test
public void testResolveSingleNode() throws Exception {
DocumentBuilderFactoryBuilder builder = DocumentBuilderFactoryBuilder.newInstance();
Document doc = XmlHelper.createDocument(XpathQueryCase.XML, builder);
XPath xpathToUse = XPath.newXPathInstance(builder, null);
assertNotNull(XpathQueryHelper.resolveSingleNode(doc, xpathToUse, "//source-id", false));
}
Aggregations