public void testWorkflowJobSelectorsOr() {
JMSJobEventListener wfEventListener = new JMSJobEventListener();
wfEventListener.init(conf);
WorkflowJobEvent wfe = new WorkflowJobEvent("wfId1", "caId1", WorkflowJob.Status.FAILED, "user1",
"wf-app-name1", new Date(), new Date());
ConnectionContext jmsContext = getConnectionContext();
try {
Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
// Pass a selector using OR condition
String selector = JMSHeaderConstants.USER + "='Non_matching_user' OR " + JMSHeaderConstants.APP_NAME
+ "='wf-app-name1'";
MessageConsumer consumer = jmsContext.createConsumer(session, wfEventListener.getTopic(wfe), selector);
wfEventListener.onWorkflowJobEvent(wfe);
TextMessage message = (TextMessage) consumer.receive(5000);
WorkflowJobMessage wfFailMessage = JMSMessagingUtils.getEventMessage(message);
Assert.assertEquals(WorkflowJob.Status.FAILED, wfFailMessage.getStatus());
assertEquals("user1", wfFailMessage.getUser());