1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +02:00

Added support for configuring the connection. SMACK-113 SMACK-114

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@3311 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2006-01-17 20:05:31 +00:00 committed by gato
parent c00abdeffd
commit 39eca6ec5b
3 changed files with 99 additions and 89 deletions

View file

@ -23,6 +23,8 @@ package org.jivesoftware.smackx;
import org.jivesoftware.smack.test.SmackTestCase;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.SmackConfiguration;
/**
* Ensure that stream compression (JEP-138) is correctly supported by Smack.
@ -40,11 +42,14 @@ public class CompressionTest extends SmackTestCase {
* stream compression enabled.
*/
public void testSuccessCompression() throws XMPPException {
XMPPConnection connection = new XMPPConnection(getHost(), getPort());
assertTrue("Server doesn't support stream compression", connection.getServerSupportsCompression());
// Create the configuration for this new connection
ConnectionConfiguration config = new ConnectionConfiguration(getHost(), getPort());
config.setTLSEnabled(true);
config.setCompressionEnabled(true);
config.setSASLAuthenticationEnabled(true);
assertTrue("Failed to negotiate stream compression", connection.useCompression());
XMPPConnection connection = new XMPPConnection(config);
assertTrue("Connection is not using stream compression", connection.isUsingCompression());