INT-1652 added documentation for default naming convention for XMPP

This commit is contained in:
Oleg Zhurakousky
2010-11-30 18:28:40 -05:00
parent 99c6c1b3df
commit 41d64cdf6b
2 changed files with 17 additions and 5 deletions

View File

@@ -58,6 +58,13 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/xmpp
subscription-mode="accept_all"/>
]]></programlisting>
</para>
<para>
<note>
For added convenience you can rely on the default naming convention and omit the <code>id</code> attribute.
The default name <emphasis>xmppConnection</emphasis> will be used for this connection bean.
</note>
</para>
</section>
<section id="xmpp-messages">
@@ -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.
</para>
</section>
<para>
<note>
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 <code>xmpp-connection</code> attribute and
rely on the default naming convention. The bean with the name <emphasis>xmppConnection</emphasis> will be located and
injected into the adapters.
</note>
</para>
</section>
<section id="xmpp-appendices">
<title>Appendices</title>

View File

@@ -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));
}
}