Package org.jivesoftware.smack.packet

Examples of org.jivesoftware.smack.packet.XMPPError.toXML()


    /**
     * Check the creation of a new xmppError locally.
    */
    public void testLocalErrorCreation() {
      XMPPError error = new XMPPError(XMPPError.Condition.item_not_found);
        error.toXML();

      assertEquals(error.getCondition(), "item-not-found");
      assertEquals(error.getCode(), 404);
      assertEquals(error.getType(), XMPPError.Type.CANCEL);
      assertNull(error.getMessage());
View Full Code Here


     * Check the creation of a new xmppError locally.
    */
    public void testLocalErrorWithCommentCreation() {
        String message = "Error Message";
        XMPPError error = new XMPPError(XMPPError.Condition.item_not_found, message);
        error.toXML();

        assertEquals(error.getCondition(), "item-not-found");
        assertEquals(error.getCode(), 404);
        assertEquals(error.getType(), XMPPError.Type.CANCEL);
        assertEquals(error.getMessage(), message);
View Full Code Here

     * Check the creation of a new xmppError locally where there is not a default defined.
    */
    public void testUserDefinedErrorWithCommentCreation() {
        String message = "Error Message";
        XMPPError error = new XMPPError(new XMPPError.Condition("my_own_error"), message);
        error.toXML();

        assertEquals(error.getCondition(), "my_own_error");
        assertEquals(error.getCode(), 0);
        assertNull(error.getType());
        assertEquals(error.getMessage(), message);
View Full Code Here

         // Create the xml parser
         XmlPullParser parser = getParserFromXML(xml);
         // Create a packet from the xml
         XMPPError error = parseError(parser);
        
         String sendingXML = error.toXML();
        
       assertNotNull(error);
       assertNotNull(sendingXML);
       } catch (Exception e) {
           e.printStackTrace();
View Full Code Here

    /**
     * Check the creation of a new xmppError locally.
    */
    public void testLocalErrorCreation() {
      XMPPError error = new XMPPError(XMPPError.Condition.item_not_found);
        error.toXML();

      assertEquals(error.getCondition(), "item-not-found");
      assertEquals(error.getCode(), 404);
      assertEquals(error.getType(), XMPPError.Type.CANCEL);
      assertNull(error.getMessage());
View Full Code Here

     * Check the creation of a new xmppError locally.
    */
    public void testLocalErrorWithCommentCreation() {
        String message = "Error Message";
        XMPPError error = new XMPPError(XMPPError.Condition.item_not_found, message);
        error.toXML();

        assertEquals(error.getCondition(), "item-not-found");
        assertEquals(error.getCode(), 404);
        assertEquals(error.getType(), XMPPError.Type.CANCEL);
        assertEquals(error.getMessage(), message);
View Full Code Here

     * Check the creation of a new xmppError locally where there is not a default defined.
    */
    public void testUserDefinedErrorWithCommentCreation() {
        String message = "Error Message";
        XMPPError error = new XMPPError(new XMPPError.Condition("my_own_error"), message);
        error.toXML();

        assertEquals(error.getCondition(), "my_own_error");
        assertEquals(error.getCode(), 0);
        assertNull(error.getType());
        assertEquals(error.getMessage(), message);
View Full Code Here

         // Create the xml parser
         XmlPullParser parser = getParserFromXML(xml);
         // Create a packet from the xml
         XMPPError error = parseError(parser);
        
         String sendingXML = error.toXML();
        
       assertNotNull(error);
       assertNotNull(sendingXML);
       } catch (Exception e) {
           e.printStackTrace();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.