mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-2442 - stomp and xmpp tests on ibm jdk 6
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@822231 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bfed2c0e00
commit
869401136e
|
@ -85,8 +85,9 @@ public class StompTest extends CombinationTestSupport {
|
|||
+ "}}";
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
// The order of the entries is different when using the ibm jdk.
|
||||
if (System.getProperty("java.vendor").equals("IBM Corporation")) {
|
||||
// The order of the entries is different when using ibm jdk 5.
|
||||
if (System.getProperty("java.vendor").equals("IBM Corporation")
|
||||
&& System.getProperty("java.version").startsWith("1.5")) {
|
||||
xmlMap = "<map>\n"
|
||||
+ " <entry>\n"
|
||||
+ " <string>city</string>\n"
|
||||
|
|
|
@ -145,15 +145,13 @@
|
|||
<dependency>
|
||||
<groupId>jivesoftware</groupId>
|
||||
<artifactId>smack</artifactId>
|
||||
<version>1.5.0</version>
|
||||
<!--<version>2.2.1</version>-->
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jivesoftware</groupId>
|
||||
<artifactId>smackx</artifactId>
|
||||
<version>1.5.0</version>
|
||||
<!--<version>2.2.1</version>-->
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -19,8 +19,11 @@ package org.apache.activemq.transport.xmpp;
|
|||
import junit.framework.TestCase;
|
||||
import junit.textui.TestRunner;
|
||||
import org.jivesoftware.smack.Chat;
|
||||
import org.jivesoftware.smack.ConnectionConfiguration;
|
||||
import org.jivesoftware.smack.MessageListener;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
|
||||
/**
|
||||
* @version $Revision$
|
||||
|
@ -37,21 +40,27 @@ public class XmppTest extends TestCase {
|
|||
}
|
||||
|
||||
public void testConnect() throws Exception {
|
||||
// ConnectionConfiguration config = new
|
||||
// ConnectionConfiguration("localhost", 61222);
|
||||
ConnectionConfiguration config = new
|
||||
ConnectionConfiguration("localhost", 61222);
|
||||
// config.setDebuggerEnabled(true);
|
||||
|
||||
try {
|
||||
// SmackConfiguration.setPacketReplyTimeout(1000);
|
||||
// XMPPConnection con = new XMPPConnection(config);
|
||||
XMPPConnection con = new XMPPConnection("localhost", 61222);
|
||||
XMPPConnection con = new XMPPConnection(config);
|
||||
con.connect();
|
||||
con.login("amq-user", "amq-pwd");
|
||||
Chat chat = con.createChat("test@localhost");
|
||||
Chat chat = con.getChatManager().createChat("test@localhost",
|
||||
new MessageListener() {
|
||||
public void processMessage(Chat chat, Message message) {
|
||||
//
|
||||
}
|
||||
});
|
||||
for (int i = 0; i < 10; i++) {
|
||||
System.out.println("Sending message: " + i);
|
||||
chat.sendMessage("Hello from Message: " + i);
|
||||
}
|
||||
System.out.println("Sent all messages!");
|
||||
con.disconnect();
|
||||
} catch (XMPPException e) {
|
||||
if (block) {
|
||||
System.out.println("Caught: " + e);
|
||||
|
|
Loading…
Reference in New Issue