use of org.jivesoftware.smackx.hoxt.packet.HttpOverXmppReq in project Smack by igniterealtime.
the class HttpOverXmppReqProviderTest method getReqOptionAttributesCorrectlyParsed.
@Test
public void getReqOptionAttributesCorrectlyParsed() throws Exception {
String string = "<req xmlns='urn:xmpp:http' method='OPTIONS' resource='*' version='1.1' maxChunkSize='256' sipub='false' ibb='true' jingle='false'/>";
HttpOverXmppReq req = parseReq(string);
assertEquals(req.getMaxChunkSize(), 256);
assertEquals(req.isSipub(), false);
assertEquals(req.isIbb(), true);
assertEquals(req.isJingle(), false);
}
use of org.jivesoftware.smackx.hoxt.packet.HttpOverXmppReq in project Smack by igniterealtime.
the class HttpOverXmppReqProviderTest method getReqOptionalAttributesDefaultValues.
@Test
public void getReqOptionalAttributesDefaultValues() throws Exception {
String string = "<req xmlns='urn:xmpp:http' method='OPTIONS' resource='*' version='1.1'/>";
HttpOverXmppReq req = parseReq(string);
assertEquals(req.isSipub(), true);
assertEquals(req.isIbb(), true);
assertEquals(req.isJingle(), true);
}
use of org.jivesoftware.smackx.hoxt.packet.HttpOverXmppReq in project Smack by igniterealtime.
the class HttpOverXmppReqProviderTest method parseReq.
private static HttpOverXmppReq parseReq(String string) throws Exception {
HttpOverXmppReqProvider provider = new HttpOverXmppReqProvider();
XmlPullParser parser = PacketParserUtils.getParserFor(string);
IQ iq = provider.parse(parser);
assertTrue(iq instanceof HttpOverXmppReq);
HttpOverXmppReq castedIq = (HttpOverXmppReq) iq;
return castedIq;
}
use of org.jivesoftware.smackx.hoxt.packet.HttpOverXmppReq in project Smack by igniterealtime.
the class HttpOverXmppReqProviderTest method areAllReqAttributesCorrectlyParsed.
@Test
public void areAllReqAttributesCorrectlyParsed() throws Exception {
String string = "<req xmlns='urn:xmpp:http' method='OPTIONS' resource='*' version='1.1'/>";
HttpOverXmppReq req = parseReq(string);
assertEquals(req.getVersion(), "1.1");
assertEquals(req.getMethod(), HttpMethod.OPTIONS);
assertEquals(req.getResource(), "*");
}
use of org.jivesoftware.smackx.hoxt.packet.HttpOverXmppReq in project Smack by igniterealtime.
the class HttpOverXmppReqProviderTest method areGetRequestAttributesCorrectlyParsed.
@Test
public void areGetRequestAttributesCorrectlyParsed() throws Exception {
String string = "<req xmlns='urn:xmpp:http' method='GET' resource='/rdf/xep' version='1.1'/>";
HttpOverXmppReq req = parseReq(string);
assertEquals(req.getVersion(), "1.1");
assertEquals(req.getMethod(), HttpMethod.GET);
assertEquals(req.getResource(), "/rdf/xep");
}
Aggregations