use of org.jivesoftware.smackx.jingle.element.JingleContent in project Smack by igniterealtime.
the class JingleTransportMethodManager method getTransportManager.
public JingleTransportManager<?> getTransportManager(Jingle request) {
JingleContent content = request.getContents().get(0);
if (content == null) {
return null;
}
JingleContentTransport transport = content.getTransport();
if (transport == null) {
return null;
}
return getTransportManager(transport.getNamespace());
}
use of org.jivesoftware.smackx.jingle.element.JingleContent in project Smack by igniterealtime.
the class JingleContentTest method parserTest.
@Test
public void parserTest() throws Exception {
JingleContent.Builder builder = JingleContent.getBuilder();
builder.setCreator(JingleContent.Creator.initiator);
builder.setName("A name");
JingleContent content = builder.build();
assertNotNull(content);
assertNull(content.getDescription());
assertEquals(JingleContent.Creator.initiator, content.getCreator());
assertEquals("A name", content.getName());
builder.setSenders(JingleContent.Senders.both);
content = builder.build();
assertEquals(JingleContent.Senders.both, content.getSenders());
builder.setDisposition("session");
JingleContent content1 = builder.build();
assertEquals("session", content1.getDisposition());
assertNotSame(content.toXML().toString(), content1.toXML().toString());
assertEquals(content1.toXML().toString(), builder.build().toXML().toString());
String xml = "<content xmlns='urn:xmpp:jingle:1' creator='initiator' disposition='session' name='A name' senders='both'/>";
assertEquals(xml, content1.toXML().toString());
}
Aggregations