1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 09:39:39 +02:00

Added reconnection support. SMACK-172

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@5367 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2006-09-14 19:16:40 +00:00 committed by gato
parent 96e4201f61
commit 3af86fd462
22 changed files with 501 additions and 194 deletions

View file

@ -20,11 +20,10 @@
package org.jivesoftware.smackx;
import org.jivesoftware.smack.test.SmackTestCase;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.test.SmackTestCase;
/**
* Ensure that stream compression (JEP-138) is correctly supported by Smack.
@ -50,6 +49,7 @@ public class CompressionTest extends SmackTestCase {
config.setSASLAuthenticationEnabled(true);
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
// Login with the test account
connection.login("user0", "user0");
@ -57,7 +57,7 @@ public class CompressionTest extends SmackTestCase {
assertTrue("Connection is not using stream compression", connection.isUsingCompression());
// Close connection
connection.close();
connection.disconnect();
}
protected int getMaxConnections() {
@ -70,6 +70,7 @@ public class CompressionTest extends SmackTestCase {
protected void setUp() throws Exception {
super.setUp();
XMPPConnection setupConnection = new XMPPConnection(getHost(), getPort());
setupConnection.connect();
if (!setupConnection.getAccountManager().supportsAccountCreation())
fail("Server does not support account creation");
@ -90,11 +91,12 @@ public class CompressionTest extends SmackTestCase {
protected void tearDown() throws Exception {
super.tearDown();
XMPPConnection setupConnection = new XMPPConnection(getHost(), getPort());
setupConnection.connect();
setupConnection.login("user0", "user0");
// Delete the created account for the test
setupConnection.getAccountManager().deleteAccount();
// Close the setupConnection
setupConnection.close();
setupConnection.disconnect();
}
}