Merge pull request #299 from olegz/INT-2357

INT-2357 upgraded XMPP to Smack 3.2.1
This commit is contained in:
Mark Fisher
2012-01-05 09:50:48 -05:00
3 changed files with 37 additions and 41 deletions

View File

@@ -539,8 +539,8 @@ project('spring-integration-xmpp') {
dependencies {
compile project(":spring-integration-core")
compile("javax.activation:activation:$javaxActivationVersion") { optional = true }
compile "jivesoftware:smack:3.1.0"
compile "jivesoftware:smackx:3.1.0"
compile "org.igniterealtime.smack:smack:3.2.1"
compile "org.igniterealtime.smack:smackx:3.2.1"
compile "org.springframework:spring-context-support:$springVersion"
testCompile project(":spring-integration-test")
testCompile project(":spring-integration-stream")

View File

@@ -88,12 +88,6 @@
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-stream</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
@@ -106,12 +100,6 @@
<version>3.0.7.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-test</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
@@ -130,6 +118,18 @@
<version>1.2.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.igniterealtime.smack</groupId>
<artifactId>smackx</artifactId>
<version>3.2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-test</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
@@ -149,30 +149,30 @@
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jivesoftware</groupId>
<artifactId>smack</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jivesoftware</groupId>
<artifactId>smackx</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-stream</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.igniterealtime.smack</groupId>
<artifactId>smack</artifactId>
<version>3.2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>

View File

@@ -16,21 +16,20 @@
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;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.test.util.TestUtils;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
/**
* @author Oleg Zhurakousky
*/
@@ -52,16 +51,15 @@ public class XmppConnectionParserTests {
public void testSimpleConfiguration() {
ApplicationContext ac = new ClassPathXmlApplicationContext("XmppConnectionParserTests-simple.xml", this.getClass());
XMPPConnection connection = ac.getBean("connection", XMPPConnection.class);
assertNull(connection.getServiceName());
assertEquals("localhost", connection.getServiceName());
assertEquals("localhost", connection.getHost());
assertEquals(5222, connection.getPort());
assertFalse(connection.isConnected());
XmppConnectionFactoryBean xmppFb = ac.getBean("&connection", XmppConnectionFactoryBean.class);
assertEquals("happy.user", TestUtils.getPropertyValue(xmppFb, "user"));
assertEquals("blah", TestUtils.getPropertyValue(xmppFb, "password"));
assertEquals("Smack", TestUtils.getPropertyValue(xmppFb, "resource"));
assertEquals("accept_all", TestUtils.getPropertyValue(xmppFb, "subscriptionMode"));
ConnectionConfiguration configuration = (ConnectionConfiguration) TestUtils.getPropertyValue(connection, "configuration");
assertEquals("localhost", configuration.getHost());
assertEquals(5222, configuration.getPort());
}
@Test
@@ -74,17 +72,15 @@ public class XmppConnectionParserTests {
public void testCompleteConfiguration() {
ApplicationContext ac = new ClassPathXmlApplicationContext("XmppConnectionParserTests-complete.xml", this.getClass());
XMPPConnection connection = ac.getBean("connection", XMPPConnection.class);
assertNull(connection.getServiceName());
assertEquals("foogle.com", connection.getServiceName());
assertEquals("localhost", connection.getHost());
assertEquals(6222, connection.getPort());
assertFalse(connection.isConnected());
XmppConnectionFactoryBean xmppFb = ac.getBean("&connection", XmppConnectionFactoryBean.class);
assertEquals("happy.user", TestUtils.getPropertyValue(xmppFb, "user"));
assertEquals("blah", TestUtils.getPropertyValue(xmppFb, "password"));
assertEquals("SpringSource", TestUtils.getPropertyValue(xmppFb, "resource"));
assertEquals("reject_all", TestUtils.getPropertyValue(xmppFb, "subscriptionMode"));
ConnectionConfiguration configuration = (ConnectionConfiguration) TestUtils.getPropertyValue(connection, "configuration");
assertEquals("localhost", configuration.getHost());
assertEquals(6222, configuration.getPort());
assertEquals("foogle.com", configuration.getServiceName());
}
}