From 41d64cdf6b90c93973457ebe4605d787fa5ba52d Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Tue, 30 Nov 2010 18:28:40 -0500 Subject: [PATCH] INT-1652 added documentation for default naming convention for XMPP --- docs/src/reference/docbook/xmpp.xml | 16 ++++++++++++++++ ...MessageOutboundChannelAdapterParserTests.java | 6 +----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/src/reference/docbook/xmpp.xml b/docs/src/reference/docbook/xmpp.xml index 36eaf0762b..859f1beb5d 100644 --- a/docs/src/reference/docbook/xmpp.xml +++ b/docs/src/reference/docbook/xmpp.xml @@ -58,6 +58,13 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/xmpp subscription-mode="accept_all"/> ]]> + + + + For added convenience you can rely on the default naming convention and omit the id attribute. + The default name xmppConnection will be used for this connection bean. + +
@@ -183,6 +190,15 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/xmpp Like its inbound counterpart, it requires a reference to an XMPP Connection.
+ + + + If you are relying on default naming convention for XMPP Connection bean (described earlier) and you only have one + XMPP Connection bean configured in your Application Context, you may omit the xmpp-connection attribute and + rely on the default naming convention. The bean with the name xmppConnection will be located and + injected into the adapters. + +
Appendices diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/ChatMessageOutboundChannelAdapterParserTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/ChatMessageOutboundChannelAdapterParserTests.java index ae24e82b20..184862f29c 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/ChatMessageOutboundChannelAdapterParserTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/ChatMessageOutboundChannelAdapterParserTests.java @@ -83,12 +83,8 @@ public class ChatMessageOutboundChannelAdapterParserTests { MessageChannel channel = context.getBean("outboundEventChannel", MessageChannel.class); Message message = MessageBuilder.withPayload("hello").setHeader(XmppHeaders.CHAT_TO, "oleg").build(); XMPPConnection connection = context.getBean("testConnection", XMPPConnection.class); - ChatManager chatManager = mock(ChatManager.class); - when(connection.getChatManager()).thenReturn(chatManager); - Chat chat = mock(Chat.class); - when(chatManager.createChat(Mockito.anyString(), Mockito.any(MessageListener.class))).thenReturn(chat); channel.send(message); - //verify(chat, times(1)).sendMessage("hello"); + verify(connection, times(1)).sendPacket(Mockito.any(org.jivesoftware.smack.packet.Message.class)); } }