use of com.adaptris.core.CoreException in project interlok by adaptris.
the class AppendinglMessageAggregatorTest method testJoin_WithException.
@Test
public void testJoin_WithException() {
AppendingMessageAggregator aggr = createAggregatorForTests();
AdaptrisMessage original = new DefectiveMessageFactory(EnumSet.of(WhenToBreak.INPUT, WhenToBreak.OUTPUT)).newMessage("Goodbye");
AdaptrisMessage splitMsg1 = AdaptrisMessageFactory.getDefaultInstance().newMessage(" Cruel ");
AdaptrisMessage splitMsg2 = AdaptrisMessageFactory.getDefaultInstance().newMessage("World");
try {
aggr.joinMessage(original, Arrays.asList(new AdaptrisMessage[] { splitMsg1, splitMsg2 }));
fail();
} catch (CoreException expected) {
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class JdbcQueryServiceCaseXmlResults method testDoService_IllegalXmlCharacters.
@Test
public void testDoService_IllegalXmlCharacters() throws Exception {
createDatabase();
List<AdapterTypeVersion> dbItems = generateWithIllegalXmlChars(10);
AdapterTypeVersion entry = dbItems.get(0);
populateDatabase(dbItems, false);
JdbcDataQueryService s = createXmlService();
XmlPayloadTranslatorImpl translator = createPayloadTranslator();
translator.setStripIllegalXmlChars(false);
s.setResultSetTranslator(translator);
AdaptrisMessage msg = createMessage(entry);
execute(s, msg);
logMessage(getName(), msg);
try {
XmlHelper.createXmlUtils(msg, null);
fail();
} catch (CoreException e) {
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class SplittingXmlPayloadTranslatorTest method testDoService_IllegalXmlCharacters.
@Override
public void testDoService_IllegalXmlCharacters() throws Exception {
createDatabase();
List<AdapterTypeVersion> dbItems = generateWithIllegalXmlChars(10);
AdapterTypeVersion entry = dbItems.get(0);
populateDatabase(dbItems, false);
JdbcDataQueryService s = createXmlService();
XmlPayloadTranslatorImpl translator = createPayloadTranslator();
translator.setStripIllegalXmlChars(false);
s.setResultSetTranslator(translator);
AdaptrisMessage msg = createMessage(entry);
execute(s, msg);
AdaptrisMessage outputMessage = producer.getMessages().get(0);
logMessage(getName(), outputMessage);
try {
XmlHelper.createXmlUtils(outputMessage, null);
fail();
} catch (CoreException e) {
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class AdvancedMessageSplitterServiceTest method testInit.
@Override
public void testInit() throws Exception {
AdvancedMessageSplitterService service = createForTests();
try {
service.init();
fail();
} catch (CoreException expected) {
}
service.setSplitter(new LineCountSplitter());
service.setService(new ServiceList());
service.init();
assertNotNull(service.wrappedServices());
assertEquals(1, service.wrappedServices().length);
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class MultiItemConfiguredXpathQueryTest method testResolveXpath_EmptyResults_NotAllowed.
@Test
public void testResolveXpath_EmptyResults_NotAllowed() throws Exception {
MultiItemConfiguredXpathQuery 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) {
}
}
Aggregations