1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 20:42:06 +01:00

More Jingle IBB tests

This commit is contained in:
vanitasvitae 2017-08-09 19:26:33 +02:00
parent 3927f3089e
commit efaa3c27a9
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 9 additions and 17 deletions

View file

@ -27,7 +27,7 @@ public class JingleIBBTransportElement extends JingleContentTransportElement {
public static final String ATTR_BLOCK_SIZE = "block-size"; public static final String ATTR_BLOCK_SIZE = "block-size";
public static final String ATTR_SID = "sid"; public static final String ATTR_SID = "sid";
public static final short DEFAULT_BLOCK_SIZE = 4096; public static final Short DEFAULT_BLOCK_SIZE = 4096;
private final String sid; private final String sid;
private final Short blockSize; private final Short blockSize;

View file

@ -17,6 +17,7 @@
package org.jivesoftware.smackx.jingle.transport.jingle_ibb; package org.jivesoftware.smackx.jingle.transport.jingle_ibb;
import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.assertTrue;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
@ -49,26 +50,17 @@ public class JingleIBBTransportTest extends SmackTestSuite {
assertEquals(transport.getElement(), parsed); assertEquals(transport.getElement(), parsed);
assertTrue(transport.getElement().equals(parsed)); assertTrue(transport.getElement().equals(parsed));
assertEquals(xml, parsed.toXML().toString()); assertEquals(xml, parsed.toXML().toString());
/*
JingleIBBTransport transport1 = new JingleIBBTransport((short) 1024); JingleIBBTransport transport1 = new JingleIBBTransport();
assertEquals((short) 1024, transport1.getBlockSize()); assertEquals(JingleIBBTransportElement.DEFAULT_BLOCK_SIZE, transport1.getBlockSize());
assertNotSame(transport, transport1);
assertNotSame(transport.getSessionId(), transport1.getSessionId());
assertFalse(transport.equals(null)); assertFalse(transport.equals(null));
JingleIBBTransport transport2 = new JingleIBBTransport(); JingleIBBTransport transport2 = new JingleIBBTransport(transport1.getStreamId(), (short) 256);
assertEquals(JingleIBBTransport.DEFAULT_BLOCK_SIZE, transport2.getBlockSize()); assertEquals((Short) (short) 256, transport2.getBlockSize());
assertFalse(transport1.equals(transport2)); assertFalse(transport1.equals(transport2));
JingleIBBTransport transport3 = new JingleIBBTransport((short) -1024); transport1.handleSessionAccept(transport2.getElement(), null);
assertEquals(JingleIBBTransport.DEFAULT_BLOCK_SIZE, transport3.getBlockSize()); assertEquals(transport2.getBlockSize(), transport1.getBlockSize());
assertEquals(transport3.getNamespace(), JingleIBBTransport.NAMESPACE_V1);
assertEquals(transport3.getElementName(), "transport");
JingleIBBTransport transport4 = new JingleIBBTransport("session-id");
assertEquals(JingleIBBTransport.DEFAULT_BLOCK_SIZE, transport4.getBlockSize());
*/
} }
} }