mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-15 03:59:38 +02:00
Use createPacketCollectorAndSend in FileTransferNegoiator
also fixes a potential PacketCollector leak.
This commit is contained in:
parent
70f1c22bb2
commit
d10ff92d44
3 changed files with 11 additions and 12 deletions
|
@ -19,6 +19,7 @@ package org.jivesoftware.smackx.filetransfer;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.jivesoftware.smack.DummyConnection;
|
||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.junit.After;
|
||||
|
@ -48,7 +49,11 @@ public class FileTransferNegotiatorTest {
|
|||
@Test
|
||||
public void verifyForm() throws Exception {
|
||||
FileTransferNegotiator fileNeg = FileTransferNegotiator.getInstanceFor(connection);
|
||||
fileNeg.negotiateOutgoingTransfer("me", "streamid", "file", 1024, null, 10);
|
||||
try {
|
||||
fileNeg.negotiateOutgoingTransfer("me", "streamid", "file", 1024, null, 10);
|
||||
} catch (NoResponseException e) {
|
||||
// Ignore
|
||||
}
|
||||
Packet packet = connection.getSentPacket();
|
||||
String xml = packet.toXML().toString();
|
||||
assertTrue(xml.indexOf("var='stream-method' type='list-single'") != -1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue