Search in sources :

Example 6 with MessageTarget

use of com.adaptris.interlok.client.MessageTarget in project interlok by adaptris.

the class InterlokJmxClientTest method testProcessAsync_SerializableMessage.

@Test
public void testProcessAsync_SerializableMessage() throws Exception {
    MyMessageProcessor proc = new MyMessageProcessor();
    MessageTarget target = new MessageTarget().withAdapter(testName.getMethodName()).withChannel(testName.getMethodName()).withWorkflow(testName.getMethodName());
    DefaultSerializableMessage msg = new DefaultSerializableMessage().withPayload(testName.getMethodName());
    register(createObjectName(target), proc);
    InterlokJmxClient client = new InterlokJmxClient(jmxConnectorServer.getAddress());
    try {
        client.connect();
        client.processAsync(target, msg);
        assertEquals(msg.getUniqueId(), proc.getMessage().getUniqueId());
        assertEquals(msg.getContent(), proc.getMessage().getContent());
    } finally {
        client.disconnect();
    }
}
Also used : MessageTarget(com.adaptris.interlok.client.MessageTarget) DefaultSerializableMessage(com.adaptris.interlok.types.DefaultSerializableMessage) Test(org.junit.Test)

Aggregations

MessageTarget (com.adaptris.interlok.client.MessageTarget)6 Test (org.junit.Test)6 DefaultSerializableMessage (com.adaptris.interlok.types.DefaultSerializableMessage)5 InterlokException (com.adaptris.interlok.InterlokException)2 SerializableMessage (com.adaptris.interlok.types.SerializableMessage)1