use of nl.nn.adapterframework.senders.SenderWrapperBase in project iaf by ibissource.
the class InputOutputSenderWrapperProcessorTest method testBasicPreserve.
@Test
public void testBasicPreserve() throws Exception {
SenderWrapperBase sender = getSenderWrapper();
sender.setPreserveInput(true);
String input = "abc";
String expectedSecondSenderOutput = "Sender 2: [Sender 1: [abc]]";
String expectedWrapperOutput = "abc";
String expectedSessionKeyValue = null;
testInputOutputSenderWrapperProcessor(sender, input, expectedSecondSenderOutput, expectedWrapperOutput, expectedSessionKeyValue);
}
use of nl.nn.adapterframework.senders.SenderWrapperBase in project iaf by ibissource.
the class InputOutputSenderWrapperProcessorTest method testGetInputFromFixedValueStoreResult.
@Test
public void testGetInputFromFixedValueStoreResult() throws Exception {
SenderWrapperBase sender = getSenderWrapper();
sender.setGetInputFromFixedValue("def");
sender.setStoreResultInSessionKey("storedResult");
String input = "abc";
String expectedSecondSenderOutput = "Sender 2: [Sender 1: [def]]";
String expectedWrapperOutput = expectedSecondSenderOutput;
String expectedSessionKeyValue = expectedSecondSenderOutput;
testInputOutputSenderWrapperProcessor(sender, input, expectedSecondSenderOutput, expectedWrapperOutput, expectedSessionKeyValue);
}
use of nl.nn.adapterframework.senders.SenderWrapperBase in project iaf by ibissource.
the class InputOutputSenderWrapperProcessorTest method testGetInputFromFixedValuePreserve.
@Test
public void testGetInputFromFixedValuePreserve() throws Exception {
SenderWrapperBase sender = getSenderWrapper();
sender.setGetInputFromFixedValue("def");
sender.setPreserveInput(true);
String input = "abc";
String expectedSecondSenderOutput = "Sender 2: [Sender 1: [def]]";
String expectedWrapperOutput = "abc";
String expectedSessionKeyValue = null;
testInputOutputSenderWrapperProcessor(sender, input, expectedSecondSenderOutput, expectedWrapperOutput, expectedSessionKeyValue);
}
use of nl.nn.adapterframework.senders.SenderWrapperBase in project iaf by ibissource.
the class InputOutputSenderWrapperProcessorTest method testGetInputFromFixedValue.
@Test
public void testGetInputFromFixedValue() throws Exception {
SenderWrapperBase sender = getSenderWrapper();
sender.setGetInputFromFixedValue("def");
String input = "abc";
String expectedSecondSenderOutput = "Sender 2: [Sender 1: [def]]";
String expectedWrapperOutput = expectedSecondSenderOutput;
String expectedSessionKeyValue = null;
testInputOutputSenderWrapperProcessor(sender, input, expectedSecondSenderOutput, expectedWrapperOutput, expectedSessionKeyValue);
}
use of nl.nn.adapterframework.senders.SenderWrapperBase in project iaf by ibissource.
the class IbisDebuggerAdvice method debugSenderInputOutputAbort.
private <M> M debugSenderInputOutputAbort(ProceedingJoinPoint proceedingJoinPoint, Message message, PipeLineSession session, int messageParamIndex, boolean expectPipeRunResult) throws Throwable {
if (!isEnabled()) {
return (M) proceedingJoinPoint.proceed();
}
ISender sender = (ISender) proceedingJoinPoint.getTarget();
if (!sender.isSynchronous() && sender instanceof JmsSender) {
// Ignore JmsSenders within JmsListeners (calling JmsSender without ParameterResolutionContext) within Receivers.
return (M) proceedingJoinPoint.proceed();
}
String messageId = session == null ? null : session.getMessageId();
message = ibisDebugger.senderInput(sender, messageId, message);
// result can be PipeRunResult (for StreamingSenders) or Message (for all other Senders)
M result = null;
// debugSenderGetInputFrom will be called.
if (!ibisDebugger.stubSender(sender, messageId) || sender instanceof SenderWrapperBase) {
try {
Object[] args = proceedingJoinPoint.getArgs();
args[messageParamIndex] = message;
result = (M) proceedingJoinPoint.proceed(args);
} catch (Throwable throwable) {
throw ibisDebugger.senderAbort(sender, messageId, throwable);
}
} else {
// resolve parameters itself
if (sender instanceof IWithParameters) {
ParameterList parameterList = ((IWithParameters) sender).getParameterList();
if (parameterList != null) {
parameterList.getValues(message, session);
}
}
}
if (sender instanceof SenderWrapperBase && ((SenderWrapperBase) sender).isPreserveInput()) {
// signal in the debugger that the result of the sender has been replaced with the original input
result = (M) ibisDebugger.preserveInput(messageId, (Message) result);
}
if (expectPipeRunResult) {
// Create PipeRunResult when streaming sender is stubbed, this will forward to the next pipe and process the
// message in a streaming.auto=false way (also when at the time of the original report the message was
// processed with streaming.auto=true)
PipeRunResult prr = result != null ? (PipeRunResult) result : new PipeRunResult();
prr.setResult(ibisDebugger.senderOutput(sender, messageId, prr.getResult()));
return (M) prr;
}
return (M) ibisDebugger.senderOutput(sender, messageId, Message.asMessage(result));
}
Aggregations