remove (useless) SenderTest + mockrunner-jms/nekohtml (FINERACT-938)
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
f7f52f04d1
commit
cbc274f603
@@ -1,78 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.notification;
|
||||
|
||||
import com.mockrunner.mock.jms.MockQueue;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import org.apache.fineract.notification.data.NotificationData;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.jms.core.MessageCreator;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@ContextConfiguration(locations = {
|
||||
"classpath:META-INF/testNotificationContext.xml",
|
||||
})
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class SenderTest {
|
||||
private final static Logger LOG = LoggerFactory.getLogger(SenderTest.class);
|
||||
@Autowired
|
||||
private JmsTemplate jmsTemplate;
|
||||
|
||||
@Autowired
|
||||
private MockQueue mockQueue;
|
||||
|
||||
@Test
|
||||
public void notificationCreation() {
|
||||
|
||||
String objectType = "CLIENT";
|
||||
Long objectIdentifier = 1L;
|
||||
String action = "created";
|
||||
Long actorId = 1L;
|
||||
String notificationContent = "A client was created";
|
||||
|
||||
NotificationData notificationData = new NotificationData(
|
||||
objectType,
|
||||
objectIdentifier,
|
||||
action,
|
||||
actorId,
|
||||
notificationContent,
|
||||
false,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
|
||||
jmsTemplate.send(mockQueue, new MessageCreator() {
|
||||
@Override
|
||||
public Message createMessage(Session session) throws JMSException {
|
||||
LOG.info("Message send successfully");
|
||||
return session.createObjectMessage(notificationData);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
-->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:jms="http://www.springframework.org/schema/jms"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd">
|
||||
|
||||
<bean id="destinationManager" class="com.mockrunner.jms.DestinationManager"/>
|
||||
|
||||
<bean id="mockQueue" factory-bean="destinationManager" factory-method="createQueue">
|
||||
<constructor-arg index="0" value="demoMockRunnerQueue" />
|
||||
</bean>
|
||||
|
||||
<bean id="configurationManager" class="com.mockrunner.jms.ConfigurationManager"/>
|
||||
|
||||
<bean id="jmsQueueConnectionFactory" class="com.mockrunner.mock.jms.MockQueueConnectionFactory">
|
||||
<constructor-arg index="0" ref="destinationManager" />
|
||||
<constructor-arg index="1" ref="configurationManager" />
|
||||
</bean>
|
||||
|
||||
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
|
||||
<property name="connectionFactory" ref="jmsQueueConnectionFactory" />
|
||||
</bean>
|
||||
|
||||
<jms:listener-container connection-factory="jmsQueueConnectionFactory" >
|
||||
<jms:listener destination="demoMockRunnerQueue" ref="testListener" method="onMessage" />
|
||||
</jms:listener-container>
|
||||
|
||||
<bean id="testListener" class="org.apache.fineract.notification.Listener" />
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user