From d98924b39db3405cdf32eb4856f3b3c5b20b5734 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 13:52:52 -0400 Subject: [PATCH 01/14] Updated indentation and refactored code --- spring-jms/src/com/baeldung/spring/jms/Employee.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-jms/src/com/baeldung/spring/jms/Employee.java b/spring-jms/src/com/baeldung/spring/jms/Employee.java index a0346c4291..36783ebf46 100644 --- a/spring-jms/src/com/baeldung/spring/jms/Employee.java +++ b/spring-jms/src/com/baeldung/spring/jms/Employee.java @@ -18,6 +18,6 @@ public class Employee { } public String toString() { - return "Person: name(" + name + "), age(" + age + ")"; + return "Employee: name(" + name + "), age(" + age + ")"; } } From 94f258f90c16c326979cc8efdab1eefb53cae893 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 13:53:20 -0400 Subject: [PATCH 02/14] Updated indentation and refactored code --- .../spring/jms/SampleJmsMessageSender.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/spring-jms/src/com/baeldung/spring/jms/SampleJmsMessageSender.java b/spring-jms/src/com/baeldung/spring/jms/SampleJmsMessageSender.java index e3eccea03e..123edccb4d 100644 --- a/spring-jms/src/com/baeldung/spring/jms/SampleJmsMessageSender.java +++ b/spring-jms/src/com/baeldung/spring/jms/SampleJmsMessageSender.java @@ -1,6 +1,8 @@ package com.baeldung.spring.jms; -import javax.jms.ConnectionFactory; +import java.util.HashMap; +import java.util.Map; + import javax.jms.JMSException; import javax.jms.Message; import javax.jms.Queue; @@ -14,8 +16,8 @@ public class SampleJmsMessageSender { private JmsTemplate jmsTemplate; private Queue queue; - public void setConnectionFactory(ConnectionFactory cf) { - this.jmsTemplate = new JmsTemplate(cf); + public void setJmsTemplate(JmsTemplate jmsTemplate) { + this.jmsTemplate = jmsTemplate; } public void setQueue(Queue queue) { @@ -29,4 +31,12 @@ public class SampleJmsMessageSender { } }); } -} \ No newline at end of file + + public void sendMessage(final Employee employee) { + System.out.println("Jms Message Sender : " + employee); + Map map = new HashMap(); + map.put("name", employee.getName()); + map.put("age", employee.getAge()); + this.jmsTemplate.convertAndSend(map); + } +} From 53a353916b1bf91653c8df6907e630b3751582e1 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 13:55:01 -0400 Subject: [PATCH 03/14] Updated indentation and refactored code Added a a new method receiveMessage() to receive custom converted messages --- .../baeldung/spring/jms/SampleListener.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/spring-jms/src/com/baeldung/spring/jms/SampleListener.java b/spring-jms/src/com/baeldung/spring/jms/SampleListener.java index 466cac44a0..8c28ab3e35 100644 --- a/spring-jms/src/com/baeldung/spring/jms/SampleListener.java +++ b/spring-jms/src/com/baeldung/spring/jms/SampleListener.java @@ -1,18 +1,26 @@ package com.baeldung.spring.jms; +import java.util.Map; + import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage; +import org.springframework.jms.core.JmsTemplate; + public class SampleListener implements MessageListener { - private String textMessage; + public JmsTemplate getJmsTemplate() { + return getJmsTemplate(); + } public void onMessage(Message message) { if (message instanceof TextMessage) { try { - textMessage = ((TextMessage) message).getText(); + + String msg = ((TextMessage) message).getText(); + System.out.println("Message has been consumed : " + msg); } catch (JMSException ex) { throw new RuntimeException(ex); } @@ -20,4 +28,10 @@ public class SampleListener implements MessageListener { throw new IllegalArgumentException("Message Error"); } } -} \ No newline at end of file + + public Employee receiveMessage() throws JMSException { + Map map = (Map) getJmsTemplate().receiveAndConvert(); + Employee employee = new Employee((String) map.get("name"), (Integer) map.get("age")); + return employee; + } +} From fe9c63560d12e51a9ca7318639d9fa3a79da90f2 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 13:55:26 -0400 Subject: [PATCH 04/14] Updated indentation --- .../baeldung/spring/jms/SampleMessageConverter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-jms/src/com/baeldung/spring/jms/SampleMessageConverter.java b/spring-jms/src/com/baeldung/spring/jms/SampleMessageConverter.java index 856e0e9e49..2142461a5f 100644 --- a/spring-jms/src/com/baeldung/spring/jms/SampleMessageConverter.java +++ b/spring-jms/src/com/baeldung/spring/jms/SampleMessageConverter.java @@ -11,17 +11,17 @@ import org.springframework.jms.support.converter.MessageConverter; public class SampleMessageConverter implements MessageConverter { public Message toMessage(Object object, Session session) throws JMSException, MessageConversionException { - Employee person = (Employee) object; + Employee employee = (Employee) object; MapMessage message = session.createMapMessage(); - message.setString("name", person.getName()); - message.setInt("age", person.getAge()); + message.setString("name", employee.getName()); + message.setInt("age", employee.getAge()); return message; } public Object fromMessage(Message message) throws JMSException, MessageConversionException { MapMessage mapMessage = (MapMessage) message; - Employee person = new Employee(mapMessage.getString("name"), mapMessage.getInt("age")); - return person; + Employee employee = new Employee(mapMessage.getString("name"), mapMessage.getInt("age")); + return employee; } } From d1bdfb5234c94c4c99fbd1eba6ea7f3adde80387 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 13:56:37 -0400 Subject: [PATCH 05/14] This class is not required Embedded ActiveMq is created from XML now. --- .../baeldung/spring/jms/SampleJMSExample.java | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 spring-jms/src/com/baeldung/spring/jms/SampleJMSExample.java diff --git a/spring-jms/src/com/baeldung/spring/jms/SampleJMSExample.java b/spring-jms/src/com/baeldung/spring/jms/SampleJMSExample.java deleted file mode 100644 index bdde97b82d..0000000000 --- a/spring-jms/src/com/baeldung/spring/jms/SampleJMSExample.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.spring.jms; - -import java.net.URI; -import java.net.URISyntaxException; - -import org.apache.activemq.broker.BrokerFactory; -import org.apache.activemq.broker.BrokerService; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class SampleJMSExample { - public static void main(String[] args) throws URISyntaxException, Exception { - BrokerService broker = BrokerFactory.createBroker(new URI("broker:(tcp://localhost:61616)")); - broker.start(); - ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); - - } -} From 0af6fbea16c2ed7f1aee6154a06713bee3794c1b Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 13:58:30 -0400 Subject: [PATCH 06/14] Updated ApplicationContext.xml --- .../src/main/resources/applicationContext.xml | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/spring-jms/src/main/resources/applicationContext.xml b/spring-jms/src/main/resources/applicationContext.xml index c15289763f..d94eb4c371 100644 --- a/spring-jms/src/main/resources/applicationContext.xml +++ b/spring-jms/src/main/resources/applicationContext.xml @@ -3,16 +3,27 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - - - - - - - - + + + + + + + + + + + + + + + + + + - + @@ -23,8 +34,7 @@ - + - - \ No newline at end of file + From 147e1bfe107eed1dcabca36fa7a27847cd4d9d7d Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 13:59:25 -0400 Subject: [PATCH 07/14] Embedded activemq is configured in this file --- .../src/main/resources/EmbeddedActiveMQ.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spring-jms/src/main/resources/EmbeddedActiveMQ.xml diff --git a/spring-jms/src/main/resources/EmbeddedActiveMQ.xml b/spring-jms/src/main/resources/EmbeddedActiveMQ.xml new file mode 100644 index 0000000000..5e956144fd --- /dev/null +++ b/spring-jms/src/main/resources/EmbeddedActiveMQ.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + \ No newline at end of file From 4240e34c376b670ad44df0ce19af55d47eda3329 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 14:01:42 -0400 Subject: [PATCH 08/14] Junit tests JUnit tests for testing default text message as well as custom messages --- .../src/DefaultTextMessageSenderTest.java | 26 ++++++++++++++++++ .../src/MapMessageConvertAndSendTest.java | 27 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 spring-jms/src/DefaultTextMessageSenderTest.java create mode 100644 spring-jms/src/MapMessageConvertAndSendTest.java diff --git a/spring-jms/src/DefaultTextMessageSenderTest.java b/spring-jms/src/DefaultTextMessageSenderTest.java new file mode 100644 index 0000000000..8806f4d1ba --- /dev/null +++ b/spring-jms/src/DefaultTextMessageSenderTest.java @@ -0,0 +1,26 @@ +package com.baeldung.spring.jms.test; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import com.baeldung.spring.jms.SampleJmsMessageSender; + +public class DefaultTextMessageSenderTest { + + private SampleJmsMessageSender messageProducer; + + @SuppressWarnings("resource") + @Before + public void setUp() { + ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); + messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); + } + + @Test + public void testSimpleSend() { + messageProducer.simpleSend(); + } + +} \ No newline at end of file diff --git a/spring-jms/src/MapMessageConvertAndSendTest.java b/spring-jms/src/MapMessageConvertAndSendTest.java new file mode 100644 index 0000000000..d2a3867679 --- /dev/null +++ b/spring-jms/src/MapMessageConvertAndSendTest.java @@ -0,0 +1,27 @@ +package com.baeldung.spring.jms.test; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import com.baeldung.spring.jms.Employee; +import com.baeldung.spring.jms.SampleJmsMessageSender; + +public class MapMessageConvertAndSendTest { + + private SampleJmsMessageSender messageProducer; + + @SuppressWarnings("resource") + @Before + public void setUp() { + ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); + messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); + } + + @Test + public void testSendMessage() { + messageProducer.sendMessage(new Employee("JavaDeveloper2", 22)); + } + +} From 528e3b1ef59ee883deabbda34f204c01efbda578 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 14:02:38 -0400 Subject: [PATCH 09/14] Uploaded in wrong location --- .../src/DefaultTextMessageSenderTest.java | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 spring-jms/src/DefaultTextMessageSenderTest.java diff --git a/spring-jms/src/DefaultTextMessageSenderTest.java b/spring-jms/src/DefaultTextMessageSenderTest.java deleted file mode 100644 index 8806f4d1ba..0000000000 --- a/spring-jms/src/DefaultTextMessageSenderTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.baeldung.spring.jms.test; - -import org.junit.Before; -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import com.baeldung.spring.jms.SampleJmsMessageSender; - -public class DefaultTextMessageSenderTest { - - private SampleJmsMessageSender messageProducer; - - @SuppressWarnings("resource") - @Before - public void setUp() { - ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); - messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); - } - - @Test - public void testSimpleSend() { - messageProducer.simpleSend(); - } - -} \ No newline at end of file From d640b9818d91615e6594f159226b0b4b87bb0920 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 14:02:46 -0400 Subject: [PATCH 10/14] Uploaded in wrong location --- .../src/MapMessageConvertAndSendTest.java | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 spring-jms/src/MapMessageConvertAndSendTest.java diff --git a/spring-jms/src/MapMessageConvertAndSendTest.java b/spring-jms/src/MapMessageConvertAndSendTest.java deleted file mode 100644 index d2a3867679..0000000000 --- a/spring-jms/src/MapMessageConvertAndSendTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.baeldung.spring.jms.test; - -import org.junit.Before; -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import com.baeldung.spring.jms.Employee; -import com.baeldung.spring.jms.SampleJmsMessageSender; - -public class MapMessageConvertAndSendTest { - - private SampleJmsMessageSender messageProducer; - - @SuppressWarnings("resource") - @Before - public void setUp() { - ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); - messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); - } - - @Test - public void testSendMessage() { - messageProducer.sendMessage(new Employee("JavaDeveloper2", 22)); - } - -} From b253563e676013443ec0ead0445e28ae6a8552b9 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 14:06:40 -0400 Subject: [PATCH 11/14] Junit tests JUnit Tests for default text messages and custom converted messages --- .../jms/DefaultTextMessageSenderTest.java | 26 ++++++++++++++++++ .../jms/MapMessageConvertAndSendTest.java | 27 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java create mode 100644 spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java diff --git a/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java b/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java new file mode 100644 index 0000000000..5176d79386 --- /dev/null +++ b/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java @@ -0,0 +1,26 @@ +package com.baeldung.spring.jms; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import com.baeldung.spring.jms.SampleJmsMessageSender; + +public class DefaultTextMessageSenderTest { + + private SampleJmsMessageSender messageProducer; + + @SuppressWarnings("resource") + @Before + public void setUp() { + ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); + messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); + } + + @Test + public void testSimpleSend() { + messageProducer.simpleSend(); + } + +} \ No newline at end of file diff --git a/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java b/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java new file mode 100644 index 0000000000..4bd9827c60 --- /dev/null +++ b/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java @@ -0,0 +1,27 @@ +package com.baeldung.spring.jms; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import com.baeldung.spring.jms.Employee; +import com.baeldung.spring.jms.SampleJmsMessageSender; + +public class MapMessageConvertAndSendTest { + + private SampleJmsMessageSender messageProducer; + + @SuppressWarnings("resource") + @Before + public void setUp() { + ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); + messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); + } + + @Test + public void testSendMessage() { + messageProducer.sendMessage(new Employee("JavaDeveloper2", 22)); + } + +} From ca3e67fcd8da6a5ce90a34b1819e92159eaa2f3d Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 14:21:43 -0400 Subject: [PATCH 12/14] Changed @Before to @BeforeClass accordingly made the necessary methods staic --- .../spring/jms/DefaultTextMessageSenderTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java b/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java index 5176d79386..2016122105 100644 --- a/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java +++ b/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java @@ -1,6 +1,6 @@ package com.baeldung.spring.jms; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -9,11 +9,11 @@ import com.baeldung.spring.jms.SampleJmsMessageSender; public class DefaultTextMessageSenderTest { - private SampleJmsMessageSender messageProducer; + private static SampleJmsMessageSender messageProducer; @SuppressWarnings("resource") - @Before - public void setUp() { + @BeforeClass + public static void setUp() { ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); } @@ -23,4 +23,4 @@ public class DefaultTextMessageSenderTest { messageProducer.simpleSend(); } -} \ No newline at end of file +} From 872654d54cbfd0768e7c36dcc8ab2634df5ec8aa Mon Sep 17 00:00:00 2001 From: Kiran Date: Sun, 9 Oct 2016 14:22:20 -0400 Subject: [PATCH 13/14] Changed @Before to @BeforeClass accordingly made the necessary methods staic --- .../baeldung/spring/jms/MapMessageConvertAndSendTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java b/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java index 4bd9827c60..19b9097601 100644 --- a/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java +++ b/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java @@ -1,6 +1,6 @@ package com.baeldung.spring.jms; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -10,11 +10,11 @@ import com.baeldung.spring.jms.SampleJmsMessageSender; public class MapMessageConvertAndSendTest { - private SampleJmsMessageSender messageProducer; + private static SampleJmsMessageSender messageProducer; @SuppressWarnings("resource") - @Before - public void setUp() { + @BeforeClass + public static void setUp() { ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); } From 02a1c2d114f43604baaeeb0a52efabd063ea934f Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sun, 9 Oct 2016 20:36:41 +0200 Subject: [PATCH 14/14] Merge fix --- .../baeldung/spring/jms/DefaultTextMessageSenderTest.java | 3 +-- .../baeldung/spring/jms/MapMessageConvertAndSendTest.java | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java b/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java index 2016122105..aceb551563 100644 --- a/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java +++ b/spring-jms/src/test/com/baeldung/spring/jms/DefaultTextMessageSenderTest.java @@ -1,12 +1,11 @@ package com.baeldung.spring.jms; +import com.baeldung.spring.jms.SampleJmsMessageSender; import org.junit.BeforeClass; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import com.baeldung.spring.jms.SampleJmsMessageSender; - public class DefaultTextMessageSenderTest { private static SampleJmsMessageSender messageProducer; diff --git a/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java b/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java index 19b9097601..d649938533 100644 --- a/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java +++ b/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java @@ -1,13 +1,12 @@ package com.baeldung.spring.jms; +import com.baeldung.spring.jms.Employee; +import com.baeldung.spring.jms.SampleJmsMessageSender; import org.junit.BeforeClass; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import com.baeldung.spring.jms.Employee; -import com.baeldung.spring.jms.SampleJmsMessageSender; - public class MapMessageConvertAndSendTest { private static SampleJmsMessageSender messageProducer;