renaming components
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
|
||||
<channel id="xmppInbound"/>
|
||||
|
||||
<xmpp:message-inbound-channel-adapter id="xmppInboundAdapter" channel="xmppInbound"
|
||||
xmpp-connection="testConnection" extract-payload="false" auto-startup="false"/>
|
||||
<xmpp:inbound-channel-adapter id="xmppInboundAdapter" channel="xmppInbound"
|
||||
xmpp-connection="testConnection" extract-payload="false" auto-startup="false"/>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.inbound.XmppMessageDrivenEndpoint;
|
||||
import org.springframework.integration.xmpp.inbound.ChatMessageListeningEndpoint;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -36,7 +36,7 @@ public class InboundXmppEndpointParserTests {
|
||||
public void testInboundAdapter(){
|
||||
ApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("InboundXmppEndpointParserTests-context.xml", this.getClass());
|
||||
XmppMessageDrivenEndpoint xmde = context.getBean("xmppInboundAdapter", XmppMessageDrivenEndpoint.class);
|
||||
ChatMessageListeningEndpoint xmde = context.getBean("xmppInboundAdapter", ChatMessageListeningEndpoint.class);
|
||||
assertFalse(xmde.isAutoStartup());
|
||||
DirectChannel channel = (DirectChannel) TestUtils.getPropertyValue(xmde, "requestChannel");
|
||||
assertEquals("xmppInbound", channel.getComponentName());
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<int:channel id="outboundEventChannel"/>
|
||||
|
||||
<int-xmpp:message-outbound-channel-adapter id="outboundEventAdapter"
|
||||
channel="outboundEventChannel"
|
||||
xmpp-connection="xmppConnection"/>
|
||||
<int-xmpp:outbound-channel-adapter id="outboundEventAdapter"
|
||||
channel="outboundEventChannel"
|
||||
xmpp-connection="xmppConnection"/>
|
||||
</beans>
|
||||
|
||||
@@ -13,23 +13,23 @@
|
||||
|
||||
<int:channel id="outboundEventChannel"/>
|
||||
|
||||
<int-xmpp:message-outbound-channel-adapter id="outboundEventAdapter"
|
||||
channel="outboundEventChannel"
|
||||
xmpp-connection="testConnection"/>
|
||||
<int-xmpp:outbound-channel-adapter id="outboundEventAdapter"
|
||||
channel="outboundEventChannel"
|
||||
xmpp-connection="testConnection"/>
|
||||
|
||||
<int:channel id="outboundPollingChannel">
|
||||
<int:queue/>
|
||||
</int:channel>
|
||||
|
||||
<int-xmpp:message-outbound-channel-adapter id="outboundPollingAdapter"
|
||||
channel="outboundPollingChannel"
|
||||
xmpp-connection="testConnection">
|
||||
<int-xmpp:outbound-channel-adapter id="outboundPollingAdapter"
|
||||
channel="outboundPollingChannel"
|
||||
xmpp-connection="testConnection">
|
||||
<int:poller fixed-rate="1000" max-messages-per-poll="1"/>
|
||||
</int-xmpp:message-outbound-channel-adapter>
|
||||
</int-xmpp:outbound-channel-adapter>
|
||||
|
||||
<int-xmpp:message-outbound-channel-adapter id="outboundNoChannelAdapter"
|
||||
<int-xmpp:outbound-channel-adapter id="outboundNoChannelAdapter"
|
||||
xmpp-connection="testConnection">
|
||||
<!-- <int:poller fixed-rate="1000" max-messages-per-poll="1"/>-->
|
||||
</int-xmpp:message-outbound-channel-adapter>
|
||||
</int-xmpp:outbound-channel-adapter>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<constructor-arg value="org.jivesoftware.smack.XMPPConnection"/>
|
||||
</bean>
|
||||
|
||||
<int-xmpp:roster-event-inbound-channel-adapter channel="outChannel"
|
||||
<int-xmpp:presence-inbound-channel-adapter channel="outChannel"
|
||||
xmpp-connection="testConnection" auto-startup="false"/>
|
||||
|
||||
<int:channel id="outChannel"/>
|
||||
|
||||
@@ -20,12 +20,12 @@ import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.integration.xmpp.outbound.XmppPresenceSendingMessageHandler;
|
||||
import org.springframework.integration.xmpp.outbound.PresenceSendingMessageHandler;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* Tests {@link XmppPresenceSendingMessageHandler} to ensure that we are able to publish status.
|
||||
* Tests {@link PresenceSendingMessageHandler} to ensure that we are able to publish status.
|
||||
*
|
||||
* @author Josh Long
|
||||
* @since 2.0
|
||||
|
||||
@@ -32,8 +32,8 @@ import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.inbound.XmppMessageDrivenEndpoint;
|
||||
import org.springframework.integration.xmpp.core.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.inbound.ChatMessageListeningEndpoint;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -49,7 +49,7 @@ public class XmppMessageDrivenEndpointTests {
|
||||
public void testLifecycle(){
|
||||
final Set<PacketListener> packetListSet = new HashSet<PacketListener>();
|
||||
XMPPConnection connection = mock(XMPPConnection.class);
|
||||
XmppMessageDrivenEndpoint endpoint = new XmppMessageDrivenEndpoint(connection);
|
||||
ChatMessageListeningEndpoint endpoint = new ChatMessageListeningEndpoint(connection);
|
||||
|
||||
doAnswer(new Answer<Object>() {
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
@@ -75,7 +75,7 @@ public class XmppMessageDrivenEndpointTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testNonInitializationFailure(){
|
||||
XmppMessageDrivenEndpoint endpoint = new XmppMessageDrivenEndpoint(mock(XMPPConnection.class));
|
||||
ChatMessageListeningEndpoint endpoint = new ChatMessageListeningEndpoint(mock(XMPPConnection.class));
|
||||
endpoint.start();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class XmppMessageDrivenEndpointTests {
|
||||
public void testWithImplicitXmppConnection(){
|
||||
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
|
||||
bf.registerSingleton(XmppContextUtils.XMPP_CONNECTION_BEAN_NAME, mock(XMPPConnection.class));
|
||||
XmppMessageDrivenEndpoint endpoint = new XmppMessageDrivenEndpoint();
|
||||
ChatMessageListeningEndpoint endpoint = new ChatMessageListeningEndpoint();
|
||||
endpoint.setBeanFactory(bf);
|
||||
endpoint.afterPropertiesSet();
|
||||
assertNotNull(TestUtils.getPropertyValue(endpoint,"xmppConnection"));
|
||||
@@ -91,7 +91,7 @@ public class XmppMessageDrivenEndpointTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testNoXmppConnection(){
|
||||
XmppMessageDrivenEndpoint endpoint = new XmppMessageDrivenEndpoint();
|
||||
ChatMessageListeningEndpoint endpoint = new ChatMessageListeningEndpoint();
|
||||
endpoint.afterPropertiesSet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.inbound.XmppRosterListeningEndpoint;
|
||||
import org.springframework.integration.xmpp.core.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.inbound.RosterListeningEndpoint;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -69,7 +69,7 @@ public class XmppRosterListeningEndpointTests {
|
||||
return null;
|
||||
}
|
||||
}).when(roster).removeRosterListener(Mockito.any(RosterListener.class));
|
||||
XmppRosterListeningEndpoint rosterEndpoint = new XmppRosterListeningEndpoint(connection);
|
||||
RosterListeningEndpoint rosterEndpoint = new RosterListeningEndpoint(connection);
|
||||
rosterEndpoint.afterPropertiesSet();
|
||||
assertEquals(0, rosterSet.size());
|
||||
rosterEndpoint.start();
|
||||
@@ -80,7 +80,7 @@ public class XmppRosterListeningEndpointTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testNonInitializedFailure(){
|
||||
XmppRosterListeningEndpoint rosterEndpoint = new XmppRosterListeningEndpoint(mock(XMPPConnection.class));
|
||||
RosterListeningEndpoint rosterEndpoint = new RosterListeningEndpoint(mock(XMPPConnection.class));
|
||||
rosterEndpoint.start();
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class XmppRosterListeningEndpointTests {
|
||||
XMPPConnection connection = mock(XMPPConnection.class);
|
||||
Roster roster = mock(Roster.class);
|
||||
when(connection.getRoster()).thenReturn(roster);
|
||||
XmppRosterListeningEndpoint rosterEndpoint = new XmppRosterListeningEndpoint(connection);
|
||||
RosterListeningEndpoint rosterEndpoint = new RosterListeningEndpoint(connection);
|
||||
QueueChannel channel = new QueueChannel();
|
||||
rosterEndpoint.setRequestChannel(channel);
|
||||
rosterEndpoint.afterPropertiesSet();
|
||||
@@ -106,7 +106,7 @@ public class XmppRosterListeningEndpointTests {
|
||||
XMPPConnection connection = mock(XMPPConnection.class);
|
||||
Roster roster = mock(Roster.class);
|
||||
when(connection.getRoster()).thenReturn(roster);
|
||||
XmppRosterListeningEndpoint rosterEndpoint = new XmppRosterListeningEndpoint(connection);
|
||||
RosterListeningEndpoint rosterEndpoint = new RosterListeningEndpoint(connection);
|
||||
QueueChannel channel = new QueueChannel();
|
||||
rosterEndpoint.setRequestChannel(channel);
|
||||
rosterEndpoint.afterPropertiesSet();
|
||||
@@ -122,7 +122,7 @@ public class XmppRosterListeningEndpointTests {
|
||||
public void testWithImplicitXmppConnection(){
|
||||
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
|
||||
bf.registerSingleton(XmppContextUtils.XMPP_CONNECTION_BEAN_NAME, mock(XMPPConnection.class));
|
||||
XmppRosterListeningEndpoint endpoint = new XmppRosterListeningEndpoint();
|
||||
RosterListeningEndpoint endpoint = new RosterListeningEndpoint();
|
||||
endpoint.setBeanFactory(bf);
|
||||
endpoint.afterPropertiesSet();
|
||||
assertNotNull(TestUtils.getPropertyValue(endpoint,"xmppConnection"));
|
||||
@@ -130,7 +130,7 @@ public class XmppRosterListeningEndpointTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testNoXmppConnection(){
|
||||
XmppRosterListeningEndpoint handler = new XmppRosterListeningEndpoint();
|
||||
RosterListeningEndpoint handler = new RosterListeningEndpoint();
|
||||
handler.afterPropertiesSet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ import org.springframework.integration.MessageHandlingException;
|
||||
import org.springframework.integration.message.GenericMessage;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.XmppHeaders;
|
||||
import org.springframework.integration.xmpp.outbound.XmppMessageSendingMessageHandler;
|
||||
import org.springframework.integration.xmpp.core.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.outbound.ChatMessageSendingMessageHandler;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -41,7 +41,7 @@ public class XmppMessageSendingMessageHandlerTests {
|
||||
Chat chat = mock(Chat.class);
|
||||
when(chantManager.createChat(Mockito.any(String.class), Mockito.any(MessageListener.class))).thenReturn(chat);
|
||||
|
||||
XmppMessageSendingMessageHandler handler = new XmppMessageSendingMessageHandler(connection);
|
||||
ChatMessageSendingMessageHandler handler = new ChatMessageSendingMessageHandler(connection);
|
||||
handler.afterPropertiesSet();
|
||||
Message<?> message = MessageBuilder.withPayload("Test Message").
|
||||
setHeader(XmppHeaders.CHAT_TO_USER, "kermit@frog.com").
|
||||
@@ -69,20 +69,20 @@ public class XmppMessageSendingMessageHandlerTests {
|
||||
|
||||
@Test(expected=MessageHandlingException.class)
|
||||
public void validateFailureNoChatToUser() throws Exception{
|
||||
XmppMessageSendingMessageHandler handler = new XmppMessageSendingMessageHandler(mock(XMPPConnection.class));
|
||||
ChatMessageSendingMessageHandler handler = new ChatMessageSendingMessageHandler(mock(XMPPConnection.class));
|
||||
handler.handleMessage(new GenericMessage<String>("hello"));
|
||||
}
|
||||
|
||||
@Test(expected=MessageHandlingException.class)
|
||||
public void validateMessageWithUnsupportedPayload() throws Exception{
|
||||
XmppMessageSendingMessageHandler handler = new XmppMessageSendingMessageHandler(mock(XMPPConnection.class));
|
||||
ChatMessageSendingMessageHandler handler = new ChatMessageSendingMessageHandler(mock(XMPPConnection.class));
|
||||
handler.handleMessage(new GenericMessage<Integer>(123));
|
||||
}
|
||||
@Test
|
||||
public void testWithImplicitXmppConnection(){
|
||||
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
|
||||
bf.registerSingleton(XmppContextUtils.XMPP_CONNECTION_BEAN_NAME, mock(XMPPConnection.class));
|
||||
XmppMessageSendingMessageHandler handler = new XmppMessageSendingMessageHandler();
|
||||
ChatMessageSendingMessageHandler handler = new ChatMessageSendingMessageHandler();
|
||||
handler.setBeanFactory(bf);
|
||||
handler.afterPropertiesSet();
|
||||
assertNotNull(TestUtils.getPropertyValue(handler,"xmppConnection"));
|
||||
@@ -90,7 +90,7 @@ public class XmppMessageSendingMessageHandlerTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testNoXmppConnection(){
|
||||
XmppMessageSendingMessageHandler handler = new XmppMessageSendingMessageHandler();
|
||||
ChatMessageSendingMessageHandler handler = new ChatMessageSendingMessageHandler();
|
||||
handler.afterPropertiesSet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.integration.MessageHandlingException;
|
||||
import org.springframework.integration.message.GenericMessage;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.outbound.XmppPresenceSendingMessageHandler;
|
||||
import org.springframework.integration.xmpp.core.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.outbound.PresenceSendingMessageHandler;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -37,7 +37,7 @@ public class XmppRosterEventMessageSendingHandlerTests {
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Test
|
||||
public void testPresencePayload(){
|
||||
XmppPresenceSendingMessageHandler handler = new XmppPresenceSendingMessageHandler(mock(XMPPConnection.class));
|
||||
PresenceSendingMessageHandler handler = new PresenceSendingMessageHandler(mock(XMPPConnection.class));
|
||||
handler.afterPropertiesSet();
|
||||
handler.handleMessage(new GenericMessage(mock(Presence.class)));
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class XmppRosterEventMessageSendingHandlerTests {
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Test(expected=MessageHandlingException.class)
|
||||
public void testWrongPayload(){
|
||||
XmppPresenceSendingMessageHandler handler = new XmppPresenceSendingMessageHandler(mock(XMPPConnection.class));
|
||||
PresenceSendingMessageHandler handler = new PresenceSendingMessageHandler(mock(XMPPConnection.class));
|
||||
handler.afterPropertiesSet();
|
||||
handler.handleMessage(new GenericMessage(new Object()));
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class XmppRosterEventMessageSendingHandlerTests {
|
||||
public void testWithImplicitXmppConnection(){
|
||||
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
|
||||
bf.registerSingleton(XmppContextUtils.XMPP_CONNECTION_BEAN_NAME, mock(XMPPConnection.class));
|
||||
XmppPresenceSendingMessageHandler handler = new XmppPresenceSendingMessageHandler();
|
||||
PresenceSendingMessageHandler handler = new PresenceSendingMessageHandler();
|
||||
handler.setBeanFactory(bf);
|
||||
handler.afterPropertiesSet();
|
||||
assertNotNull(TestUtils.getPropertyValue(handler,"xmppConnection"));
|
||||
@@ -62,7 +62,7 @@ public class XmppRosterEventMessageSendingHandlerTests {
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testNoXmppConnection(){
|
||||
XmppPresenceSendingMessageHandler handler = new XmppPresenceSendingMessageHandler();
|
||||
PresenceSendingMessageHandler handler = new PresenceSendingMessageHandler();
|
||||
handler.afterPropertiesSet();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user