public class NoTransformFunctionalTestComponent extends Object implements Callable
FunctionalTestComponent
is a service that can be used by
functional tests. This service accepts an EventCallback that can be used to
assert the state of the current event.
Also, this service fires FunctionalTestNotification
via Mule for every message received.
Tests can register with Mule to receive these events by implementing
FunctionalTestNotificationListener
.Modifier and Type | Field and Description |
---|---|
protected Log |
logger |
static int |
STREAM_BUFFER_SIZE |
static int |
STREAM_SAMPLE_SIZE |
Constructor and Description |
---|
NoTransformFunctionalTestComponent() |
Modifier and Type | Method and Description |
---|---|
EventCallback |
getEventCallback()
An event callback is called when a message is received by the service.
|
Object |
getReturnMessage()
Often you will may want to return a fixed message payload to simulate and external system call.
|
boolean |
isAppendComponentName()
This will cause the service to append the compoent name to the end of the message
returned from this service.
|
boolean |
isThrowException()
Sometimes you will want the service to always throw an exception, if this is the case you can
set the 'throwException' property to true.
|
Object |
onCall(MuleEventContext context) |
Object |
onReceive(Object data)
Deprecated.
Not sure why we have this duplicate method here. Need to investigate...
|
static String |
received(String contents)
Append " Received" to contents.
|
void |
setAppendComponentName(boolean appendComponentName)
This will cause the service to append the compoent name to the end of the message
returned from this service.
|
void |
setEventCallback(EventCallback eventCallback)
An event callback is called when a message is received by the service.
|
void |
setReturnMessage(Object returnMessage)
Often you will may want to return a fixed message payload to simulate and external system call.
|
void |
setThrowException(boolean throwException)
Sometimes you will want the service to always throw an exception, if this is the case you can
set the 'throwException' property to true.
|
protected transient Log logger
public static final int STREAM_SAMPLE_SIZE
public static final int STREAM_BUFFER_SIZE
public Object onCall(MuleEventContext context) throws Exception
public static String received(String contents)
contents
- public Object onReceive(Object data) throws Exception
data
- the event data receivedException
public EventCallback getEventCallback()
FunctionalTestNotificationListener
with Mule and this
will deleiver a FunctionalTestNotification
for every message received by this serviceFunctionalTestNotification
,
FunctionalTestNotificationListener
public void setEventCallback(EventCallback eventCallback)
FunctionalTestNotificationListener
with Mule and this
will deleiver a FunctionalTestNotification
for every message received by this serviceeventCallback
- the callback to call when a message is receivedFunctionalTestNotification
,
FunctionalTestNotificationListener
public Object getReturnMessage()
public void setReturnMessage(Object returnMessage)
returnMessage
- the message payload to always return from this service instancepublic boolean isThrowException()
returnMessage
property is set and is of type
java.lang.Exception, that exception will be thrown.public void setThrowException(boolean throwException)
throwException
- true if an exception should always be thrown from this instance.
If the returnMessage
property is set and is of type
java.lang.Exception, that exception will be thrown.public boolean isAppendComponentName()
public void setAppendComponentName(boolean appendComponentName)
appendComponentName
- true if the service name will be appended to the return messageCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.