INT-1651 added support for default XMPP connection name and auto-discovery of that name by the XMPP adapters

This commit is contained in:
Oleg Zhurakousky
2010-11-30 16:57:33 -05:00
parent 2f20973b16
commit a58e8a83b3
12 changed files with 155 additions and 73 deletions

View File

@@ -9,5 +9,8 @@
<int-xmpp:xmpp-connection id="connection"
user="happy.user" password="blah" host="localhost" auto-startup="false"/>
<int-xmpp:xmpp-connection user="happy.user" password="blah" host="localhost" auto-startup="false"/>
</beans>

View File

@@ -19,6 +19,7 @@ package org.springframework.integration.xmpp.config;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
import java.util.List;
@@ -62,6 +63,12 @@ public class XmppConnectionParserTests {
assertEquals("localhost", configuration.getHost());
assertEquals(5222, configuration.getPort());
}
@Test
public void testDefaultConnectionName() {
ApplicationContext ac = new ClassPathXmlApplicationContext("XmppConnectionParserTests-simple.xml", this.getClass());
assertTrue(ac.containsBean("xmppConnection"));
}
@Test
public void testCompleteConfiguration() {

View File

@@ -12,7 +12,6 @@
<context:property-placeholder location="classpath:test.properties"/>
<int-xmpp:xmpp-connection
id="testConnection"
user="${user.1.login}"
password="${user.1.password}"
host="${user.1.host}"
@@ -20,6 +19,6 @@
<int:channel id="xmppInput"/>
<int-xmpp:outbound-channel-adapter channel="xmppInput" xmpp-connection="testConnection"/>
<int-xmpp:outbound-channel-adapter channel="xmppInput"/>
</beans>