Search in sources :

Example 1 with StringProducerRemote

use of com.robo4j.StringProducerRemote in project robo4j by Robo4J.

the class RemoteContextTests method buildEmitterContext.

private <T> RoboContext buildEmitterContext(Class<T> clazz, String target, String unitName) throws Exception {
    RoboBuilder builder = new RoboBuilder(SystemUtil.getInputStreamByResourceName("testMessageEmitterSystem_8.xml"));
    if (clazz.equals(String.class)) {
        StringProducerRemote<T> remoteTestMessageProducer = new StringProducerRemote<>(clazz, builder.getContext(), unitName);
        remoteTestMessageProducer.initialize(getEmitterConfiguration(REMOTE_CONTEXT_RECEIVER, target));
        builder.add(remoteTestMessageProducer);
    }
    if (clazz.equals(TestMessageType.class)) {
        RemoteTestMessageProducer remoteTestMessageProducer = new RemoteTestMessageProducer(builder.getContext(), unitName);
        remoteTestMessageProducer.initialize(getEmitterConfiguration(REMOTE_CONTEXT_RECEIVER, target));
        builder.add(remoteTestMessageProducer);
    }
    return builder.build();
}
Also used : StringProducerRemote(com.robo4j.StringProducerRemote) RoboBuilder(com.robo4j.RoboBuilder)

Aggregations

RoboBuilder (com.robo4j.RoboBuilder)1 StringProducerRemote (com.robo4j.StringProducerRemote)1