mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-23 20:42:06 +01:00
Test isReceiving, isSending
This commit is contained in:
parent
f930c1bdc5
commit
901d7b39c5
3 changed files with 8 additions and 2 deletions
|
@ -372,13 +372,13 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSending() {
|
public boolean isSending() {
|
||||||
return (getSenders() == JingleContentElement.Senders.initiator && getParent().isInitiator()) ||
|
return (getSenders() == JingleContentElement.Senders.initiator && getParent().isInitiator()) ||
|
||||||
(getSenders() == JingleContentElement.Senders.responder && getParent().isResponder()) ||
|
(getSenders() == JingleContentElement.Senders.responder && getParent().isResponder()) ||
|
||||||
getSenders() == JingleContentElement.Senders.both;
|
getSenders() == JingleContentElement.Senders.both;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isReceiving() {
|
public boolean isReceiving() {
|
||||||
return (getSenders() == JingleContentElement.Senders.initiator && getParent().isResponder()) ||
|
return (getSenders() == JingleContentElement.Senders.initiator && getParent().isResponder()) ||
|
||||||
(getSenders() == JingleContentElement.Senders.responder && getParent().isInitiator()) ||
|
(getSenders() == JingleContentElement.Senders.responder && getParent().isInitiator()) ||
|
||||||
getSenders() == JingleContentElement.Senders.both;
|
getSenders() == JingleContentElement.Senders.both;
|
||||||
|
|
|
@ -38,4 +38,6 @@ public class JingleContentTest extends SmackTestSuite {
|
||||||
assertNotNull(content.getName()); //MUST NOT BE NULL!
|
assertNotNull(content.getName()); //MUST NOT BE NULL!
|
||||||
assertEquals(0, content.getTransportBlacklist().size());
|
assertEquals(0, content.getTransportBlacklist().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,6 +162,8 @@ public class JingleSessionTest extends SmackTestSuite {
|
||||||
assertEquals(description.getElement().toXML().toString(), descriptionElement.toXML().toString());
|
assertEquals(description.getElement().toXML().toString(), descriptionElement.toXML().toString());
|
||||||
|
|
||||||
assertNull(contentElement.getSecurity());
|
assertNull(contentElement.getSecurity());
|
||||||
|
assertTrue(content.isSending());
|
||||||
|
assertFalse(content.isReceiving());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
@ -236,6 +238,8 @@ public class JingleSessionTest extends SmackTestSuite {
|
||||||
assertEquals(session.getResponder(), accept.getResponder());
|
assertEquals(session.getResponder(), accept.getResponder());
|
||||||
assertEquals(1, accept.getContents().size());
|
assertEquals(1, accept.getContents().size());
|
||||||
assertEquals(content.getName(), accept.getSoleContentOrThrow().getName());
|
assertEquals(content.getName(), accept.getSoleContentOrThrow().getName());
|
||||||
|
assertFalse(content.isSending());
|
||||||
|
assertTrue(content.isReceiving());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalStateException.class)
|
@Test(expected = IllegalStateException.class)
|
||||||
|
|
Loading…
Reference in a new issue