JmsTransportUtils { public static int getMessageType(URI uri) { String deliveryMode = getStringParameter(MESSAGE_TYPE_PATTERN, uri); if ("TEXT_MESSAGE".equals(deliveryMode)) { return JmsTransportConstants.TEXT_MESSAGE_TYPE; } else { return JmsTransportConstants.BYTES_MESSAGE_TYPE; } } private  JmsTransportUtils(); static String headerToJmsProperty(String headerName); static String jmsPropertyToHeader(String propertyName); static URI toUri(Destination destination); static String getDestinationName(URI uri); static void addHeader(Message message, String name, String value); static Iterator<String> getHeaderNames(Message message); static Iterator<String> getHeaders(Message message, String name); static int getDeliveryMode(URI uri); static int getMessageType(URI uri); static long getTimeToLive(URI uri); static int getPriority(URI uri); static String getReplyToName(URI uri);  }
@Test public void getMessageType() throws Exception { URI uri = new URI("jms:RequestQueue?messageType=BYTESMESSAGE"); int messageType = JmsTransportUtils.getMessageType(uri); assertEquals("Invalid messageType", JmsTransportConstants.BYTES_MESSAGE_TYPE, messageType); uri = new URI("jms:RequestQueue?messageType=TEXT_MESSAGE"); messageType = JmsTransportUtils.getMessageType(uri); assertEquals("Invalid messageType", JmsTransportConstants.TEXT_MESSAGE_TYPE, messageType); uri = new URI("jms:RequestQueue?replyToName=RESP_QUEUE"); messageType = JmsTransportUtils.getMessageType(uri); assertEquals("Invalid messageType", JmsTransportConstants.BYTES_MESSAGE_TYPE, messageType); }