Rename XmlUnitUtils to XmlAssertUtil

This commit is contained in:
Florian Schmaus 2020-06-14 16:53:21 +02:00
parent 9d6665735f
commit 18c2c37ad0
36 changed files with 40 additions and 41 deletions

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smack.compress.packet; package org.jivesoftware.smack.compress.packet;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import java.io.IOException; import java.io.IOException;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smack.packet; package org.jivesoftware.smack.packet;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smack.packet; package org.jivesoftware.smack.packet;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smack.provider; package org.jivesoftware.smack.provider;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import java.io.IOException; import java.io.IOException;

View File

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smack.util; package org.jivesoftware.smack.util;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlNotSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlNotSimilar;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;

View File

@ -18,7 +18,7 @@ package org.jivesoftware.smack.util;
import org.jivesoftware.smack.packet.StandardExtensionElement; import org.jivesoftware.smack.packet.StandardExtensionElement;
import org.jivesoftware.smack.packet.XmlEnvironment; import org.jivesoftware.smack.packet.XmlEnvironment;
import org.jivesoftware.smack.test.util.XmlUnitUtils; import org.jivesoftware.smack.test.util.XmlAssertUtil;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -38,10 +38,10 @@ public class XmlStringBuilderTest {
String expectedXml = "<outer xmlns='outer-namespace'><inner xmlns='inner-namespace'></inner><inner xmlns='inner-namespace'></inner></outer>"; String expectedXml = "<outer xmlns='outer-namespace'><inner xmlns='inner-namespace'></inner><inner xmlns='inner-namespace'></inner></outer>";
XmlStringBuilder actualXml = outer.toXML(XmlEnvironment.EMPTY); XmlStringBuilder actualXml = outer.toXML(XmlEnvironment.EMPTY);
XmlUnitUtils.assertXmlSimilar(expectedXml, actualXml); XmlAssertUtil.assertXmlSimilar(expectedXml, actualXml);
StringBuilder actualXmlTwo = actualXml.toXML(XmlEnvironment.EMPTY); StringBuilder actualXmlTwo = actualXml.toXML(XmlEnvironment.EMPTY);
XmlUnitUtils.assertXmlSimilar(expectedXml, actualXmlTwo); XmlAssertUtil.assertXmlSimilar(expectedXml, actualXmlTwo);
} }
} }

View File

@ -1,6 +1,6 @@
/** /**
* *
* Copyright 2014-2019 Florian Schmaus * Copyright 2014-2020 Florian Schmaus
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,8 +26,7 @@ import org.xmlunit.diff.DefaultNodeMatcher;
import org.xmlunit.diff.ElementSelectors; import org.xmlunit.diff.ElementSelectors;
import org.xmlunit.input.NormalizedSource; import org.xmlunit.input.NormalizedSource;
// TODO: Rename this class to XmlAssertUtil public class XmlAssertUtil {
public class XmlUnitUtils {
public static void assertXmlNotSimilar(CharSequence xmlOne, CharSequence xmlTwo) { public static void assertXmlNotSimilar(CharSequence xmlOne, CharSequence xmlTwo) {
normalizedCompare(xmlOne, xmlTwo).areNotSimilar(); normalizedCompare(xmlOne, xmlTwo).areNotSimilar();

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.httpfileupload; package org.jivesoftware.smackx.httpfileupload;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException; import java.io.IOException;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.httpfileupload; package org.jivesoftware.smackx.httpfileupload;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.httpfileupload.provider; package org.jivesoftware.smackx.httpfileupload.provider;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.net.MalformedURLException; import java.net.MalformedURLException;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.mam; package org.jivesoftware.smackx.mam;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import org.jivesoftware.smack.packet.StreamOpen; import org.jivesoftware.smack.packet.StreamOpen;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.message_fastening; package org.jivesoftware.smackx.message_fastening;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.message_markup; package org.jivesoftware.smackx.message_markup;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.message_retraction.element; package org.jivesoftware.smackx.message_retraction.element;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException; import java.io.IOException;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.message_retraction.element; package org.jivesoftware.smackx.message_retraction.element;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException; import java.io.IOException;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.reference; package org.jivesoftware.smackx.reference;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.sid; package org.jivesoftware.smackx.sid;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.spoiler; package org.jivesoftware.smackx.spoiler;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.attention; package org.jivesoftware.smackx.attention;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import org.jivesoftware.smackx.attention.packet.AttentionExtension; import org.jivesoftware.smackx.attention.packet.AttentionExtension;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb.packet; package org.jivesoftware.smackx.bytestreams.ibb.packet;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb.packet; package org.jivesoftware.smackx.bytestreams.ibb.packet;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb.packet; package org.jivesoftware.smackx.bytestreams.ibb.packet;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb.packet; package org.jivesoftware.smackx.bytestreams.ibb.packet;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.last_interaction; package org.jivesoftware.smackx.last_interaction;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.mood; package org.jivesoftware.smackx.mood;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.mood; package org.jivesoftware.smackx.mood;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.nick; package org.jivesoftware.smackx.nick;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.pubsub; package org.jivesoftware.smackx.pubsub;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.pubsub; package org.jivesoftware.smackx.pubsub;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.softwareinfo; package org.jivesoftware.smackx.softwareinfo;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.usertune; package org.jivesoftware.smackx.usertune;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;

View File

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.xdata; package org.jivesoftware.smackx.xdata;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;

View File

@ -18,7 +18,7 @@ package org.jivesoftware.smackx.ox;
import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNotNull;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.IOException; import java.io.IOException;

View File

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.ox; package org.jivesoftware.smackx.ox;
import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertEquals;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import java.io.IOException; import java.io.IOException;
import java.text.ParseException; import java.text.ParseException;

View File

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.ox; package org.jivesoftware.smackx.ox;
import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertEquals;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import java.util.Date; import java.util.Date;

View File

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.ox; package org.jivesoftware.smackx.ox;
import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.assertTrue;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.Arrays; import java.util.Arrays;