JmsTransportUtils { public static int getDeliveryMode(URI uri) { String deliveryMode = getStringParameter(DELIVERY_MODE_PATTERN, uri); if ("NON_PERSISTENT".equals(deliveryMode)) { return DeliveryMode.NON_PERSISTENT; } else if ("PERSISTENT".equals(deliveryMode)) { return DeliveryMode.PERSISTENT; } else { return Message.DEFAULT_DELIVERY_MODE; } } 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 getDeliveryMode() throws Exception { URI uri = new URI("jms:RequestQueue?deliveryMode=NON_PERSISTENT"); int deliveryMode = JmsTransportUtils.getDeliveryMode(uri); assertEquals("Invalid deliveryMode", DeliveryMode.NON_PERSISTENT, deliveryMode); uri = new URI("jms:RequestQueue?deliveryMode=PERSISTENT"); deliveryMode = JmsTransportUtils.getDeliveryMode(uri); assertEquals("Invalid deliveryMode", DeliveryMode.PERSISTENT, deliveryMode); uri = new URI("jms:RequestQueue?replyToName=RESP_QUEUE"); deliveryMode = JmsTransportUtils.getDeliveryMode(uri); assertEquals("Invalid deliveryMode", Message.DEFAULT_DELIVERY_MODE, deliveryMode); }