summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiwei Tian <tian.shiwei@zte.com.cn>2017-09-12 15:37:43 +0800
committerShiwei Tian <tian.shiwei@zte.com.cn>2017-09-12 16:30:44 +0800
commitbd773efb854a9a292bc6dd9e11bb00a4d4268b68 (patch)
treeadefe328c0a2722bbc9d5d9322885fd14ffc3208
parentf37f7595742b43c5bce7f4400184089ba1fb2d6c (diff)
modify MQproducer
Issue-ID: HOLMES-47 Change-Id: I9224601a0d29986d0a7a7ebaaac6e6846d22ac7e Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java5
-rw-r--r--holmes-actions/src/test/java/org/onap/holmes/common/producer/MQProducerTest.java5
2 files changed, 6 insertions, 4 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java b/holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java
index 6aaa860..9483bb6 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java
@@ -29,6 +29,7 @@ import lombok.extern.slf4j.Slf4j;
import org.glassfish.hk2.api.IterableProvider;
import org.jvnet.hk2.annotations.Service;
import org.onap.holmes.common.api.stat.Alarm;
+import org.onap.holmes.common.api.stat.VesAlarm;
import org.onap.holmes.common.constant.AlarmConst;
import org.onap.holmes.common.api.entity.CorrelationResult;
import org.onap.holmes.common.api.stat.AplusResult;
@@ -52,7 +53,7 @@ public class MQProducer {
mqConfigProvider.get().brokerPassword, brokerURL);
}
- public void sendAlarmMQTopicMsg(Alarm alarm) {
+ public void sendAlarmMQTopicMsg(VesAlarm alarm) {
sendMQTopicMsg(alarm);
}
@@ -75,7 +76,7 @@ public class MQProducer {
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
if (t instanceof CorrelationResult) {
destination = session.createTopic(AlarmConst.MQ_TOPIC_NAME_ALARMS_CORRELATION);
- } else if (t instanceof Alarm) {
+ } else if (t instanceof VesAlarm) {
destination = session.createTopic(AlarmConst.MQ_TOPIC_NAME_ALARM);
}
messageProducer = session.createProducer(destination);
diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/producer/MQProducerTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/producer/MQProducerTest.java
index 7c561b0..d9dffeb 100644
--- a/holmes-actions/src/test/java/org/onap/holmes/common/producer/MQProducerTest.java
+++ b/holmes-actions/src/test/java/org/onap/holmes/common/producer/MQProducerTest.java
@@ -36,6 +36,7 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onap.holmes.common.api.stat.Alarm;
import org.onap.holmes.common.api.entity.CorrelationResult;
+import org.onap.holmes.common.api.stat.VesAlarm;
import org.onap.holmes.common.config.MQConfig;
import org.powermock.api.easymock.PowerMock;
import org.powermock.modules.junit4.rule.PowerMockRule;
@@ -84,7 +85,7 @@ public class MQProducerTest {
@Test
public void sendAlarmMQTopicMsg() throws Exception {
- Alarm alarm = new Alarm();
+ VesAlarm alarm = new VesAlarm();
Connection connection = PowerMock.createMock(Connection.class);
Session session = PowerMock.createMock(Session.class);
Destination destination = PowerMock.createMock(Topic.class);
@@ -113,7 +114,7 @@ public class MQProducerTest {
@Test
public void sendAlarmMQTopicMsg_exception() throws Exception {
thrown.expect(JMSException.class);
- Alarm alarm = new Alarm();
+ VesAlarm alarm = new VesAlarm();
expect(connectionFactory.createConnection()).andThrow(new JMSException(""));