From 9d63baf55a454ceef3c4e0ce001e4191e8f2fd07 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 5 Jul 2017 19:09:30 +0200 Subject: [PATCH] Use assertXMLEqual() in SlotRequestCreateTest --- .../httpfileupload/SlotRequestCreateTest.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/smack-experimental/src/test/java/org/jivesoftware/smackx/httpfileupload/SlotRequestCreateTest.java b/smack-experimental/src/test/java/org/jivesoftware/smackx/httpfileupload/SlotRequestCreateTest.java index e72c9dcf4..525322357 100644 --- a/smack-experimental/src/test/java/org/jivesoftware/smackx/httpfileupload/SlotRequestCreateTest.java +++ b/smack-experimental/src/test/java/org/jivesoftware/smackx/httpfileupload/SlotRequestCreateTest.java @@ -16,13 +16,16 @@ */ package org.jivesoftware.smackx.httpfileupload; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; + +import java.io.IOException; + import org.jivesoftware.smackx.httpfileupload.element.SlotRequest; import org.junit.Assert; import org.junit.Test; import org.jxmpp.jid.JidTestUtil; -import org.jxmpp.stringprep.XmppStringprepException; - +import org.xml.sax.SAXException; public class SlotRequestCreateTest { @@ -40,25 +43,25 @@ public class SlotRequestCreateTest { + "/>"; @Test - public void checkSlotRequestCreation() throws XmppStringprepException { + public void checkSlotRequestCreation() throws SAXException, IOException { SlotRequest slotRequest = new SlotRequest(JidTestUtil.DOMAIN_BARE_JID_1, "my_juliet.png", 23456, "image/jpeg"); Assert.assertEquals("my_juliet.png", slotRequest.getFilename()); Assert.assertEquals(23456, slotRequest.getSize()); Assert.assertEquals("image/jpeg", slotRequest.getContentType()); - Assert.assertEquals(testRequest, slotRequest.getChildElementXML().toString()); + assertXMLEqual(testRequest, slotRequest.getChildElementXML().toString()); } @Test - public void checkSlotRequestCreationWithoutContentType() throws XmppStringprepException { + public void checkSlotRequestCreationWithoutContentType() throws SAXException, IOException { SlotRequest slotRequest = new SlotRequest(JidTestUtil.DOMAIN_BARE_JID_1, "my_romeo.png", 52523); Assert.assertEquals("my_romeo.png", slotRequest.getFilename()); Assert.assertEquals(52523, slotRequest.getSize()); Assert.assertEquals(null, slotRequest.getContentType()); - Assert.assertEquals(testRequestWithoutContentType, slotRequest.getChildElementXML().toString()); + assertXMLEqual(testRequestWithoutContentType, slotRequest.getChildElementXML().toString()); } @Test(expected = IllegalArgumentException.class)