Robot Framework JMS Library

Java version 8 based Robot Framework library for MQ based application testing. Provides basic JMS operations as keywords and supports JMS API version 1.1 and 2.x implemented libraries. Tested against ActiveMQ, ActiveMQ Artemis, and IBM MQ. Used MQ provider libraries must be provided separately for the Robot framework execution. When testing against ActiveMQ provider then client.jar or activemq-all.jar need to be added into class path.

This was my first open source project to publish under Relaysoft domain. The idea for this came from the work where I was using Robot framework to test integration system where the other end worked behind IBM MQ. There was a need to simulate applications behind the IBM MQ to test different possible scenarios for the integration platform. I didn’t find any ready JMS Robot Framework libraries for my need and that point those particular MQ tests where discarded due to strict timetable. A little later I decided to try build my own Robot Framework library for MQ integration testing. I chose Java and JMS because I was already very familiar with them. This project also become good opportunity for me to try out JMS version 2.0 API and test it’s capabilities against previous version. As a result I became to implement JMS client Robot library which support both JMS versions although it does not provide any actual functional differences, but it was nice play out with two different APIs.

Check Robot keyword documentation from libdoc. Project sources are available from GitLab.

Maven dependency

<dependency>
<groupid>net.relaysoft.robotframework</groupid>
<artifactid>jms-library</artifactid>
<version>1.0.0</version>
</dependency>

Simple example how JMS library can be used.

*** Settings ***
Library JMS

*** Variables ***
${INITIAL_CONTEXT_FACTORY} org.apache.activemq.jndi.ActiveMQInitialContextFactory
${PROVIDER_URL} tcp://localhost:61616
${CLIENT_ID} client
${QUEUE} QUEUE.ROBOT.TEST
${CONNECTION_PARAMETERS} java.naming.factory.initial=${INITIAL_CONTEXT_FACTORY} java.naming.provider.url=${PROVIDER_URL}

*** Test Cases ***
Test Queue
Initialize Client ${CLIENT_ID} ${CONNECTION_PARAMETERS}
Open Connection
Write Into Queue queueName=${QUEUE} content=Test data
Read From Queue queueName=${QUEUE}
${content} = Get Message Text Content
# Do something with the content...

Alternatively JMS client can be initialised for specific provider like IBM MQ

*** Settings ***
Library JMS

*** Variables ***
&amp;{CONNECTION_PARAMETERS} hostName=localhost channel=DEV.APP.SVRCONN port=${11414} queueManager=QM1 transportType=${1}
${CLIENT_ID} client

*** Test Cases ***
Test Queue
Initialize Client ${CLIENT_ID} ${CONNECTION_PARAMETERS} ${1} IBMMQ
# Do something with the client...