use of com.adaptris.core.MetadataElement in project interlok by adaptris.
the class ConfiguredXpathQueryTest method testResolveXpath_EmptyResults_NotAllowed.
@Test
public void testResolveXpath_EmptyResults_NotAllowed() throws Exception {
ConfiguredXpathQuery query = init(create(), "//@MissingAttribute");
Document doc = XmlHelper.createDocument(XML);
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(XML);
try {
MetadataElement result = query.resolveXpath(doc, new XPath(), query.createXpathQuery(msg));
fail();
} catch (CoreException expected) {
}
}
use of com.adaptris.core.MetadataElement in project interlok by adaptris.
the class MockRequestReplyProducer method doRequest.
@Override
protected AdaptrisMessage doRequest(AdaptrisMessage msg, String endpoint, long timeout) throws ProduceException {
Args.notNull(msg, "message");
AdaptrisMessage rm = defaultIfNull(getMessageFactory()).newMessage();
log.trace("Produced [" + msg.getUniqueId() + "]");
producedMessages.add(msg);
rm.setPayload(msg.getPayload());
rm.addMetadata(new MetadataElement(REPLY_METADATA_KEY, REPLY_METADATA_VALUE));
return rm;
}
use of com.adaptris.core.MetadataElement in project interlok by adaptris.
the class MetadataHelperTest method testConvertFromKeyValuePairs.
@Test
public void testConvertFromKeyValuePairs() {
KeyValuePairCollection elements = new KeyValuePairCollection();
elements.add(new KeyValuePair("test", "value"));
assertNotNull(convertFromKeyValuePairs(elements));
assertTrue(convertFromKeyValuePairs(elements).contains(new MetadataElement("test", "")));
}
use of com.adaptris.core.MetadataElement in project interlok by adaptris.
the class MetadataHelperTest method testToSet.
@Test
public void testToSet() {
Set<MetadataElement> elements = new HashSet<>();
elements.add(new MetadataElement("test", "value"));
MetadataCollection c = new MetadataCollection(elements);
assertEquals(elements, c.toSet());
}
use of com.adaptris.core.MetadataElement in project interlok by adaptris.
the class MetadataHelperTest method testConvertFromProperties.
@Test
public void testConvertFromProperties() throws Exception {
Properties c = new Properties();
c.setProperty("test", "value");
assertNotNull(convertFromProperties(c));
assertTrue(convertFromProperties(c).contains(new MetadataElement("test", "")));
}
Aggregations