@Override public MapMessage createMapMessage() throws JMSException { return next.createMapMessage(); }
@Override public MapMessage createMapMessage() throws JMSException { return next.createMapMessage(); }
/** * @return * @throws JMSException */ public MapMessage createMapMessage() throws JMSException { return next.createMapMessage(); }
@Override public MapMessage createMapMessage() throws JMSException { return next.createMapMessage(); }
@Override public MapMessage createMapMessage() throws JMSException { return next.createMapMessage(); }
/** * Test that the if the name parameter of the set methods of a <code>MapMessage</code> is an empty String, * the method must throw the error <code>java.lang.IllegalArgumentException</code>. * <br /> * @since JMS 1.1 */ public void testEmptyStringInSetMethodsForMapMessage() { try { MapMessage message = senderSession.createMapMessage(); message.setBoolean("", true); fail("Should throw an IllegalArgumentException"); } catch (IllegalArgumentException e) { } catch (JMSException e) { fail("Should throw an IllegalArgumentException, not a" + e); } }
/** * Test that the if the name parameter of the set methods of a <code>MapMessage</code> is <code>null</code>, * the method must throw the error <code>java.lang.IllegalArgumentException</code>. * <br /> * @since JMS 1.1 */ public void testNullInSetMethodsForMapMessage() { try { MapMessage message = senderSession.createMapMessage(); message.setBoolean(null, true); fail("Should throw an IllegalArgumentException"); } catch (IllegalArgumentException e) { } catch (JMSException e) { fail("Should throw an IllegalArgumentException, not a" + e); } }
/** * Test that the <code>MapMessage.getMapNames()</code> method returns an * empty <code>Enumeration</code> when no map has been defined before. * <br /> * Also test that the same method returns the correct names of the map. */ public void testgetMapNames() { try { MapMessage message = senderSession.createMapMessage(); Enumeration e = message.getMapNames(); assertTrue("No map yet defined.\n", !e.hasMoreElements()); message.setDouble("pi", 3.14159); e = message.getMapNames(); assertEquals("pi", (String) (e.nextElement())); } catch (JMSException e) { fail(e); } }
/** * Send a <code>MapMessage</code> with an empty body. * <br /> * Receive it and test if the message is effectively an instance of * <code>MapMessage</code> */ public void testMapMessage_1() { try { MapMessage message = senderSession.createMapMessage(); sender.send(message); Message msg = receiver.receive(TestConfig.TIMEOUT); assertTrue("The message should be an instance of MapMessage.\n", msg instanceof MapMessage); } catch (JMSException e) { fail(e); } }
/** * Test that the if the name parameter of the set methods of a <code>MapMessage</code> is <code>null</code>, * the method must throw the error <code>java.lang.IllegalArgumentException</code>. * <br /> * * @since JMS 1.1 */ @Test public void testNullInSetMethodsForMapMessage() { try { MapMessage message = senderSession.createMapMessage(); message.setBoolean(null, true); Assert.fail("Should throw an IllegalArgumentException"); } catch (IllegalArgumentException e) { } catch (JMSException e) { Assert.fail("Should throw an IllegalArgumentException, not a" + e); } }
/** * Test in MapMessage the conversion between <code>getObject("foo")</code> and * <code>getDouble("foo")</code> (the later returning a java.lang.Double and the former a double) */ public void testMapMessageConversion() { try { MapMessage message = senderSession.createMapMessage(); message.setDouble("pi", 3.14159); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); assertTrue("The message should be an instance of MapMessage.\n", m instanceof MapMessage); MapMessage msg = (MapMessage) m; assertTrue(msg.getObject("pi") instanceof Double); assertEquals(3.14159, ((Double) msg.getObject("pi")).doubleValue(), 0); assertEquals(3.14159, msg.getDouble("pi"), 0); } catch (JMSException e) { fail(e); } }
/** * Test that the <code>MapMessage.getMapNames()</code> method returns an * empty <code>Enumeration</code> when no map has been defined before. * <br /> * Also test that the same method returns the correct names of the map. */ @Test public void testgetMapNames() { try { MapMessage message = senderSession.createMapMessage(); Enumeration<?> e = message.getMapNames(); Assert.assertTrue("No map yet defined.\n", !e.hasMoreElements()); message.setDouble("pi", 3.14159); e = message.getMapNames(); Assert.assertEquals("pi", e.nextElement()); } catch (JMSException e) { fail(e); } }
/** * Test that the if the name parameter of the set methods of a <code>MapMessage</code> is an empty String, * the method must throw the error <code>java.lang.IllegalArgumentException</code>. * <br /> * * @since JMS 1.1 */ @Test public void testEmptyStringInSetMethodsForMapMessage() { try { MapMessage message = senderSession.createMapMessage(); message.setBoolean("", true); Assert.fail("Should throw an IllegalArgumentException"); } catch (IllegalArgumentException e) { } catch (JMSException e) { Assert.fail("Should throw an IllegalArgumentException, not a" + e); } }
/** * Send a <code>MapMessage</code> with an empty body. * <br /> * Receive it and test if the message is effectively an instance of * <code>MapMessage</code> */ @Test public void testMapMessage_1() { try { MapMessage message = senderSession.createMapMessage(); sender.send(message); Message msg = receiver.receive(TestConfig.TIMEOUT); Assert.assertTrue("The message should be an instance of MapMessage.\n", msg instanceof MapMessage); } catch (JMSException e) { fail(e); } }
/** * Send a <code>MapMessage</code> with 2 Java primitives in its body (a <code> * String</code> and a <code>double</code>). * <br /> * Receive it and test that the values of the primitives of the body are correct */ public void testMapMessage_2() { try { MapMessage message = senderSession.createMapMessage(); message.setString("name", "pi"); message.setDouble("value", 3.14159); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); assertTrue("The message should be an instance of MapMessage.\n", m instanceof MapMessage); MapMessage msg = (MapMessage) m; assertEquals("pi", msg.getString("name")); assertEquals(3.14159, msg.getDouble("value"), 0); } catch (JMSException e) { fail(e); } }
/** * Test in MapMessage the conversion between <code>getObject("foo")</code> and * <code>getDouble("foo")</code> (the later returning a java.lang.Double and the former a double) */ @Test public void testMapMessageConversion() { try { MapMessage message = senderSession.createMapMessage(); message.setDouble("pi", 3.14159); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); Assert.assertTrue("The message should be an instance of MapMessage.\n", m instanceof MapMessage); MapMessage msg = (MapMessage) m; Assert.assertTrue(msg.getObject("pi") instanceof Double); Assert.assertEquals(3.14159, ((Double) msg.getObject("pi")).doubleValue(), 0); Assert.assertEquals(3.14159, msg.getDouble("pi"), 0); } catch (JMSException e) { fail(e); } }
/** * Send a <code>MapMessage</code> with 2 Java primitives in its body (a <code> * String</code> and a <code>double</code>). * <br /> * Receive it and test that the values of the primitives of the body are correct */ @Test public void testMapMessage_2() { try { MapMessage message = senderSession.createMapMessage(); message.setString("name", "pi"); message.setDouble("value", 3.14159); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); Assert.assertTrue("The message should be an instance of MapMessage.\n", m instanceof MapMessage); MapMessage msg = (MapMessage) m; Assert.assertEquals("pi", msg.getString("name")); Assert.assertEquals(3.14159, msg.getDouble("value"), 0); } catch (JMSException e) { fail(e); } }
MapMessage mapMessage = defaultQueueSession.createMapMessage(); mapMessage.setStringProperty("testName", "testSendEmptyMessages"); defaultSender.send(mapMessage);