1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 07:22:07 +01:00

Replace JUnit4 with JUnit5 in smack-extensions.

This commit concludes migration of `smack-extensions` module,
from JUnit4 to JUnit5.
This commit is contained in:
adiaholic 2020-04-06 16:55:07 +05:30
parent 078cb5cc8f
commit 5169e887ad
79 changed files with 387 additions and 319 deletions

View file

@ -16,13 +16,13 @@
*/ */
package org.jivesoftware.smackx; package org.jivesoftware.smackx;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.List; import java.util.List;
import org.jivesoftware.smack.extensions.ExtensionsInitializer; import org.jivesoftware.smack.extensions.ExtensionsInitializer;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class ExtensionsInitializerTest { public class ExtensionsInitializerTest {

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.amp; package org.jivesoftware.smackx.amp;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -30,15 +30,15 @@ import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smackx.amp.packet.AMPExtension; import org.jivesoftware.smackx.amp.packet.AMPExtension;
import org.jivesoftware.smackx.amp.provider.AMPExtensionProvider; import org.jivesoftware.smackx.amp.provider.AMPExtensionProvider;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class AMPExtensionTest { public class AMPExtensionTest {
private InputStream CORRECT_SENDING_STANZA_STREAM; private InputStream CORRECT_SENDING_STANZA_STREAM;
private InputStream INCORRECT_RECEIVING_STANZA_STREAM; private InputStream INCORRECT_RECEIVING_STANZA_STREAM;
@Before @BeforeEach
public void setUp() { public void setUp() {
CORRECT_SENDING_STANZA_STREAM = getClass().getResourceAsStream("correct_stanza_test.xml"); CORRECT_SENDING_STANZA_STREAM = getClass().getResourceAsStream("correct_stanza_test.xml");
INCORRECT_RECEIVING_STANZA_STREAM = getClass().getResourceAsStream("incorrect_stanza_test.xml"); INCORRECT_RECEIVING_STANZA_STREAM = getClass().getResourceAsStream("incorrect_stanza_test.xml");

View file

@ -26,7 +26,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.blocking.element.BlockContactsIQ; import org.jivesoftware.smackx.blocking.element.BlockContactsIQ;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;

View file

@ -24,7 +24,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.blocking.element.BlockedErrorExtension; import org.jivesoftware.smackx.blocking.element.BlockedErrorExtension;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class BlockedErrorExtensionTest { public class BlockedErrorExtensionTest {

View file

@ -25,7 +25,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.blocking.element.BlockListIQ; import org.jivesoftware.smackx.blocking.element.BlockListIQ;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
public class GetBlockingListTest { public class GetBlockingListTest {

View file

@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.blocking.element.UnblockContactsIQ; import org.jivesoftware.smackx.blocking.element.UnblockContactsIQ;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;

View file

@ -27,7 +27,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.bob.element.BoBIQ; import org.jivesoftware.smackx.bob.element.BoBIQ;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
public class BoBIQTest extends SmackTestSuite { public class BoBIQTest extends SmackTestSuite {

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb; package org.jivesoftware.smackx.bytestreams.ibb;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
@ -27,7 +27,7 @@ import org.jivesoftware.smack.packet.StanzaError;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.bytestreams.ibb.packet.Close; import org.jivesoftware.smackx.bytestreams.ibb.packet.Close;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb; package org.jivesoftware.smackx.bytestreams.ibb;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
@ -28,7 +28,7 @@ import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.bytestreams.ibb.packet.Data; import org.jivesoftware.smackx.bytestreams.ibb.packet.Data;
import org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension; import org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;

View file

@ -16,10 +16,11 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb; package org.jivesoftware.smackx.bytestreams.ibb;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertNotSame; import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.SmackException;
@ -36,8 +37,8 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
import org.jivesoftware.util.ConnectionUtils; import org.jivesoftware.util.ConnectionUtils;
import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Protocol;
import org.jivesoftware.util.Verification; import org.jivesoftware.util.Verification;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
@ -65,7 +66,7 @@ public class InBandBytestreamManagerTest extends InitExtensions {
* @throws SmackException if Smack detected an exceptional situation. * @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted. * @throws InterruptedException if the calling thread was interrupted.
*/ */
@Before @BeforeEach
public void setup() throws XMPPException, SmackException, InterruptedException { public void setup() throws XMPPException, SmackException, InterruptedException {
// build protocol verifier // build protocol verifier
@ -130,10 +131,12 @@ public class InBandBytestreamManagerTest extends InitExtensions {
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotAllowTooBigDefaultBlockSize() { public void shouldNotAllowTooBigDefaultBlockSize() {
InBandBytestreamManager byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection); InBandBytestreamManager byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection);
byteStreamManager.setDefaultBlockSize(1000000); assertThrows(IllegalArgumentException.class, () -> {
byteStreamManager.setDefaultBlockSize(1000000);
});
} }
@Test @Test
@ -143,10 +146,12 @@ public class InBandBytestreamManagerTest extends InitExtensions {
assertEquals(1024, byteStreamManager.getDefaultBlockSize()); assertEquals(1024, byteStreamManager.getDefaultBlockSize());
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotAllowTooBigMaximumBlockSize() { public void shouldNotAllowTooBigMaximumBlockSize() {
InBandBytestreamManager byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection); InBandBytestreamManager byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection);
byteStreamManager.setMaximumBlockSize(1000000); assertThrows(IllegalArgumentException.class, () -> {
byteStreamManager.setMaximumBlockSize(1000000);
});
} }
@Test @Test

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb; package org.jivesoftware.smackx.bytestreams.ibb;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
@ -29,8 +29,8 @@ import org.jivesoftware.smack.packet.StanzaError;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.bytestreams.ibb.packet.Open; import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
@ -53,7 +53,7 @@ public class InBandBytestreamRequestTest extends InitExtensions {
/** /**
* Initialize fields used in the tests. * Initialize fields used in the tests.
*/ */
@Before @BeforeEach
public void setup() { public void setup() {
// mock connection // mock connection

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb; package org.jivesoftware.smackx.bytestreams.ibb;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.fail;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -42,8 +42,8 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
import org.jivesoftware.util.ConnectionUtils; import org.jivesoftware.util.ConnectionUtils;
import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Protocol;
import org.jivesoftware.util.Verification; import org.jivesoftware.util.Verification;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.powermock.reflect.Whitebox; import org.powermock.reflect.Whitebox;
@ -80,7 +80,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
* @throws SmackException if Smack detected an exceptional situation. * @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted. * @throws InterruptedException if the calling thread was interrupted.
*/ */
@Before @BeforeEach
public void setup() throws XMPPException, SmackException, InterruptedException { public void setup() throws XMPPException, SmackException, InterruptedException {
// build protocol verifier // build protocol verifier

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb; package org.jivesoftware.smackx.bytestreams.ibb;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.fail;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -41,8 +41,8 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
import org.jivesoftware.util.ConnectionUtils; import org.jivesoftware.util.ConnectionUtils;
import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Protocol;
import org.jivesoftware.util.Verification; import org.jivesoftware.util.Verification;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.powermock.reflect.Whitebox; import org.powermock.reflect.Whitebox;
@ -80,7 +80,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
* @throws SmackException if Smack detected an exceptional situation. * @throws SmackException if Smack detected an exceptional situation.
* @throws InterruptedException if the calling thread was interrupted. * @throws InterruptedException if the calling thread was interrupted.
*/ */
@Before @BeforeEach
public void setup() throws XMPPException, SmackException, InterruptedException { public void setup() throws XMPPException, SmackException, InterruptedException {
// build protocol verifier // build protocol verifier

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb; package org.jivesoftware.smackx.bytestreams.ibb;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never; import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
@ -29,8 +29,8 @@ import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.bytestreams.BytestreamRequest; import org.jivesoftware.smackx.bytestreams.BytestreamRequest;
import org.jivesoftware.smackx.bytestreams.ibb.packet.Open; import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
@ -56,7 +56,7 @@ public class InitiationListenerTest extends InitExtensions {
/** /**
* Initialize fields used in the tests. * Initialize fields used in the tests.
*/ */
@Before @BeforeEach
public void setup() { public void setup() {
// mock connection // mock connection

View file

@ -17,7 +17,8 @@
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.XmlUnitUtils.assertXmlSimilar;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Properties; import java.util.Properties;
@ -27,7 +28,7 @@ import org.jivesoftware.smack.packet.StreamOpen;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
/** /**
@ -37,14 +38,18 @@ import org.jxmpp.jid.impl.JidCreate;
*/ */
public class CloseTest extends InitExtensions { public class CloseTest extends InitExtensions {
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArguments1() { public void shouldNotInstantiateWithInvalidArguments1() {
new Close(null); assertThrows(IllegalArgumentException.class, () -> {
new Close(null);
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArguments2() { public void shouldNotInstantiateWithInvalidArguments2() {
new Close(""); assertThrows(IllegalArgumentException.class, () -> {
new Close("");
});
} }
@Test @Test

View file

@ -17,8 +17,9 @@
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.XmlUnitUtils.assertXmlSimilar;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Properties; import java.util.Properties;
@ -26,7 +27,7 @@ import java.util.Properties;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test for the DataPacketExtension class. * Test for the DataPacketExtension class.
@ -35,29 +36,39 @@ import org.junit.Test;
*/ */
public class DataPacketExtensionTest extends InitExtensions { public class DataPacketExtensionTest extends InitExtensions {
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArgument1() { public void shouldNotInstantiateWithInvalidArgument1() {
new DataPacketExtension(null, 0, "data"); assertThrows(IllegalArgumentException.class, () -> {
new DataPacketExtension(null, 0, "data");
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArgument2() { public void shouldNotInstantiateWithInvalidArgument2() {
new DataPacketExtension("", 0, "data"); assertThrows(IllegalArgumentException.class, () -> {
new DataPacketExtension("", 0, "data");
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArgument3() { public void shouldNotInstantiateWithInvalidArgument3() {
new DataPacketExtension("sessionID", -1, "data"); assertThrows(IllegalArgumentException.class, () -> {
new DataPacketExtension("sessionID", -1, "data");
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArgument4() { public void shouldNotInstantiateWithInvalidArgument4() {
new DataPacketExtension("sessionID", 70000, "data"); assertThrows(IllegalArgumentException.class, () -> {
new DataPacketExtension("sessionID", 70000, "data");
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArgument5() { public void shouldNotInstantiateWithInvalidArgument5() {
new DataPacketExtension("sessionID", 0, null); assertThrows(IllegalArgumentException.class, () -> {
new DataPacketExtension("sessionID", 0, null);
});
} }
@Test @Test

View file

@ -17,7 +17,8 @@
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.XmlUnitUtils.assertXmlSimilar;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import java.util.Properties; import java.util.Properties;
@ -29,7 +30,7 @@ import org.jivesoftware.smack.util.stringencoder.Base64;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
/** /**
@ -39,9 +40,11 @@ import org.jxmpp.jid.impl.JidCreate;
*/ */
public class DataTest extends InitExtensions { public class DataTest extends InitExtensions {
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArgument() { public void shouldNotInstantiateWithInvalidArgument() {
new Data(null); assertThrows(IllegalArgumentException.class, () -> {
new Data(null);
});
} }
@Test @Test

View file

@ -17,7 +17,8 @@
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.XmlUnitUtils.assertXmlSimilar;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Properties; import java.util.Properties;
@ -28,7 +29,8 @@ import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager.StanzaType; import org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager.StanzaType;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
/** /**
@ -38,19 +40,25 @@ import org.jxmpp.jid.impl.JidCreate;
*/ */
public class OpenTest extends InitExtensions { public class OpenTest extends InitExtensions {
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArguments1() { public void shouldNotInstantiateWithInvalidArguments1() {
new Open(null, 1); assertThrows(IllegalArgumentException.class, () -> {
new Open(null, 1);
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArguments2() { public void shouldNotInstantiateWithInvalidArguments2() {
new Open("", 1); assertThrows(IllegalArgumentException.class, () -> {
new Open("", 1);
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void shouldNotInstantiateWithInvalidArguments3() { public void shouldNotInstantiateWithInvalidArguments3() {
new Open("sessionID", -1); assertThrows(IllegalArgumentException.class, () -> {
new Open("sessionID", -1);
});
} }
@Test @Test

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.ibb.provider; package org.jivesoftware.smackx.bytestreams.ibb.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Properties; import java.util.Properties;
@ -28,7 +28,7 @@ import org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager.StanzaTyp
import org.jivesoftware.smackx.bytestreams.ibb.packet.Open; import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test for the OpenIQProvider class. * Test for the OpenIQProvider class.

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.bytestreams.socks5; package org.jivesoftware.smackx.bytestreams.socks5;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never; import static org.mockito.Mockito.never;
import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.timeout;
@ -30,8 +30,8 @@ import org.jivesoftware.smackx.bytestreams.BytestreamRequest;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream; import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
@ -62,7 +62,7 @@ public class InitiationListenerTest {
/** /**
* Initialize fields used in the tests. * Initialize fields used in the tests.
*/ */
@Before @BeforeEach
public void setup() { public void setup() {
// mock connection // mock connection

View file

@ -16,13 +16,13 @@
*/ */
package org.jivesoftware.smackx.bytestreams.socks5; package org.jivesoftware.smackx.bytestreams.socks5;
import static org.junit.Assert.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertNotSame; import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import java.io.IOException; import java.io.IOException;
@ -56,7 +56,7 @@ import org.jivesoftware.smackx.disco.packet.DiscoverItems.Item;
import org.jivesoftware.util.ConnectionUtils; import org.jivesoftware.util.ConnectionUtils;
import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Protocol;
import org.jivesoftware.util.Verification; import org.jivesoftware.util.Verification;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
@ -611,8 +611,7 @@ public class Socks5ByteStreamManagerTest {
// initiator can't connect to proxy because it is not running // initiator can't connect to proxy because it is not running
protocol.verifyAll(); protocol.verifyAll();
Throwable actualCause = e.getCause(); Throwable actualCause = e.getCause();
assertEquals("Unexpected throwable: " + actualCause + '.' + ExceptionUtil.getStackTrace(actualCause), assertEquals(TimeoutException.class, actualCause.getClass(), "Unexpected throwable: " + actualCause + '.' + ExceptionUtil.getStackTrace(actualCause));
TimeoutException.class, actualCause.getClass());
} }
/** /**

View file

@ -16,11 +16,11 @@
*/ */
package org.jivesoftware.smackx.bytestreams.socks5; package org.jivesoftware.smackx.bytestreams.socks5;
import static org.junit.Assert.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
@ -37,7 +37,7 @@ import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.util.ConnectionUtils; import org.jivesoftware.util.ConnectionUtils;
import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Protocol;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;

View file

@ -16,10 +16,10 @@
*/ */
package org.jivesoftware.smackx.bytestreams.socks5; package org.jivesoftware.smackx.bytestreams.socks5;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.fail;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
@ -41,7 +41,7 @@ import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.StreamHost;
import org.jivesoftware.util.ConnectionUtils; import org.jivesoftware.util.ConnectionUtils;
import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Protocol;
import org.jivesoftware.util.Verification; import org.jivesoftware.util.Verification;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;

View file

@ -16,10 +16,10 @@
*/ */
package org.jivesoftware.smackx.bytestreams.socks5; package org.jivesoftware.smackx.bytestreams.socks5;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.fail;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
@ -32,9 +32,9 @@ import org.jivesoftware.smack.util.NetworkUtil;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.StreamHost; import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.StreamHost;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
@ -57,7 +57,7 @@ public class Socks5ClientTest {
* *
* @throws Exception should not happen * @throws Exception should not happen
*/ */
@Before @BeforeEach
public void setup() throws Exception { public void setup() throws Exception {
// create SOCKS5 proxy server socket // create SOCKS5 proxy server socket
serverSocket = NetworkUtil.getSocketOnLoopback(); serverSocket = NetworkUtil.getSocketOnLoopback();
@ -333,7 +333,7 @@ public class Socks5ClientTest {
* *
* @throws Exception should not happen * @throws Exception should not happen
*/ */
@After @AfterEach
public void cleanup() throws Exception { public void cleanup() throws Exception {
// Avoid NPE if serverSocket could not get created for whateve reason. // Avoid NPE if serverSocket could not get created for whateve reason.
if (serverSocket != null) { if (serverSocket != null) {

View file

@ -16,11 +16,11 @@
*/ */
package org.jivesoftware.smackx.bytestreams.socks5; package org.jivesoftware.smackx.bytestreams.socks5;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertSame; import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
@ -35,7 +35,7 @@ import java.util.Iterator;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test for Socks5Proxy class. * Test for Socks5Proxy class.

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.caps; package org.jivesoftware.smackx.caps;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -38,7 +38,7 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder;
import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.packet.DataForm; import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException; import org.jxmpp.stringprep.XmppStringprepException;

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.caps.provider; package org.jivesoftware.smackx.caps.provider;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.jivesoftware.smack.test.util.SmackTestUtil; import org.jivesoftware.smack.test.util.SmackTestUtil;

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.commands.provider; package org.jivesoftware.smackx.commands.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
@ -26,7 +26,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.commands.AdHocCommand; import org.jivesoftware.smackx.commands.AdHocCommand;
import org.jivesoftware.smackx.commands.packet.AdHocCommandData; import org.jivesoftware.smackx.commands.packet.AdHocCommandData;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class CommandsProviderTest { public class CommandsProviderTest {

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.delay.provider; package org.jivesoftware.smackx.delay.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -40,7 +40,7 @@ import org.jivesoftware.smackx.delay.DelayInformationManager;
import org.jivesoftware.smackx.delay.packet.DelayInformation; import org.jivesoftware.smackx.delay.packet.DelayInformation;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.util.XmppDateTime; import org.jxmpp.util.XmppDateTime;
public class DelayInformationTest extends InitExtensions { public class DelayInformationTest extends InitExtensions {

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.filetransfer; package org.jivesoftware.smackx.filetransfer;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.DummyConnection; import org.jivesoftware.smack.DummyConnection;
import org.jivesoftware.smack.SmackException.NoResponseException; import org.jivesoftware.smack.SmackException.NoResponseException;
@ -25,15 +25,15 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
public class FileTransferNegotiatorTest extends InitExtensions { public class FileTransferNegotiatorTest extends InitExtensions {
private DummyConnection connection; private DummyConnection connection;
@Before @BeforeEach
public void setUp() throws Exception { public void setUp() throws Exception {
connection = new DummyConnection(); connection = new DummyConnection();
connection.connect(); connection.connect();
@ -41,7 +41,7 @@ public class FileTransferNegotiatorTest extends InitExtensions {
ServiceDiscoveryManager.getInstanceFor(connection); ServiceDiscoveryManager.getInstanceFor(connection);
} }
@After @AfterEach
public void tearDown() throws Exception { public void tearDown() throws Exception {
if (connection != null) if (connection != null)
connection.disconnect(); connection.disconnect();

View file

@ -18,8 +18,9 @@ package org.jivesoftware.smackx.forward;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence; import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Properties; import java.util.Properties;
@ -31,7 +32,7 @@ import org.jivesoftware.smackx.forward.packet.Forwarded;
import org.jivesoftware.smackx.forward.provider.ForwardedProvider; import org.jivesoftware.smackx.forward.provider.ForwardedProvider;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class ForwardedTest { public class ForwardedTest {
@ -94,7 +95,7 @@ public class ForwardedTest {
assertEquals("forwarded", parser.getName()); assertEquals("forwarded", parser.getName());
} }
@Test(expected = Exception.class) @Test
public void forwardedEmptyTest() throws Exception { public void forwardedEmptyTest() throws Exception {
XmlPullParser parser; XmlPullParser parser;
String control; String control;
@ -104,6 +105,8 @@ public class ForwardedTest {
.asString(outputProperties); .asString(outputProperties);
parser = PacketParserUtils.getParserFor(control); parser = PacketParserUtils.getParserFor(control);
new ForwardedProvider().parse(parser); assertThrows(Exception.class, () -> {
new ForwardedProvider().parse(parser);
});
} }
} }

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.geoloc.packet; package org.jivesoftware.smackx.geoloc.packet;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.net.URI; import java.net.URI;
import java.util.Calendar; import java.util.Calendar;
@ -29,7 +29,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.time.packet.Time; import org.jivesoftware.smackx.time.packet.Time;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.util.XmppDateTime; import org.jxmpp.util.XmppDateTime;
/** /**

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.geoloc.provider; package org.jivesoftware.smackx.geoloc.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import java.net.URI; import java.net.URI;
@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.geoloc.packet.GeoLocation; import org.jivesoftware.smackx.geoloc.packet.GeoLocation;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.util.XmppDateTime; import org.jxmpp.util.XmppDateTime;
public class GeoLocationProviderTest extends InitExtensions { public class GeoLocationProviderTest extends InitExtensions {

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.iqlast; package org.jivesoftware.smackx.iqlast;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.DummyConnection; import org.jivesoftware.smack.DummyConnection;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
@ -28,7 +28,7 @@ import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.iqlast.packet.LastActivity; import org.jivesoftware.smackx.iqlast.packet.LastActivity;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class LastActivityTest extends InitExtensions { public class LastActivityTest extends InitExtensions {

View file

@ -18,8 +18,8 @@ package org.jivesoftware.smackx.iqversion;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence; import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.DummyConnection; import org.jivesoftware.smack.DummyConnection;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
@ -29,7 +29,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.iqversion.packet.Version; import org.jivesoftware.smackx.iqversion.packet.Version;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class VersionTest extends InitExtensions { public class VersionTest extends InitExtensions {
@Test @Test

View file

@ -16,13 +16,14 @@
*/ */
package org.jivesoftware.smackx.jingle; package org.jivesoftware.smackx.jingle;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smackx.jingle.element.JingleAction; import org.jivesoftware.smackx.jingle.element.JingleAction;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test the JingleAction class. * Test the JingleAction class.
@ -39,8 +40,10 @@ public class JingleActionTest extends SmackTestSuite {
} }
} }
@Test(expected = IllegalArgumentException.class) @Test
public void nonExistentEnumTest() { public void nonExistentEnumTest() {
JingleAction.fromString("inexistent-action"); assertThrows(IllegalArgumentException.class, () -> {
JingleAction.fromString("inexistent-action");
});
} }
} }

View file

@ -16,33 +16,38 @@
*/ */
package org.jivesoftware.smackx.jingle; package org.jivesoftware.smackx.jingle;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static junit.framework.TestCase.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static junit.framework.TestCase.assertNotSame; import static org.junit.jupiter.api.Assertions.assertNotSame;
import static junit.framework.TestCase.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smackx.jingle.element.JingleContent; import org.jivesoftware.smackx.jingle.element.JingleContent;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test the JingleContent class. * Test the JingleContent class.
*/ */
public class JingleContentTest extends SmackTestSuite { public class JingleContentTest extends SmackTestSuite {
@Test(expected = IllegalArgumentException.class) @Test
public void emptyBuilderThrowsTest() { public void emptyBuilderThrowsTest() {
JingleContent.Builder builder = JingleContent.getBuilder(); JingleContent.Builder builder = JingleContent.getBuilder();
builder.build(); assertThrows(IllegalArgumentException.class, () -> {
builder.build();
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void onlyCreatorBuilderThrowsTest() { public void onlyCreatorBuilderThrowsTest() {
JingleContent.Builder builder = JingleContent.getBuilder(); JingleContent.Builder builder = JingleContent.getBuilder();
builder.setCreator(JingleContent.Creator.initiator); builder.setCreator(JingleContent.Creator.initiator);
builder.build(); assertThrows(IllegalArgumentException.class, () -> {
builder.build();
});
} }
@Test @Test

View file

@ -16,7 +16,8 @@
*/ */
package org.jivesoftware.smackx.jingle; package org.jivesoftware.smackx.jingle;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smack.test.util.TestUtils; import org.jivesoftware.smack.test.util.TestUtils;
@ -24,7 +25,7 @@ import org.jivesoftware.smack.test.util.TestUtils;
import org.jivesoftware.smackx.jingle.element.JingleError; import org.jivesoftware.smackx.jingle.element.JingleError;
import org.jivesoftware.smackx.jingle.provider.JingleErrorProvider; import org.jivesoftware.smackx.jingle.provider.JingleErrorProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test the JingleError class. * Test the JingleError class.
@ -59,9 +60,11 @@ public class JingleErrorTest extends SmackTestSuite {
assertEquals(xml, error.toXML().toString()); assertEquals(xml, error.toXML().toString());
} }
@Test(expected = IllegalArgumentException.class) @Test
public void illegalArgumentTest() { public void illegalArgumentTest() {
JingleError.fromString("inexistent-error"); assertThrows(IllegalArgumentException.class, () -> {
JingleError.fromString("inexistent-error");
});
} }

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.jingle; package org.jivesoftware.smackx.jingle;
import static org.junit.Assert.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 org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;

View file

@ -16,16 +16,17 @@
*/ */
package org.jivesoftware.smackx.jingle; package org.jivesoftware.smackx.jingle;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static junit.framework.TestCase.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static junit.framework.TestCase.assertTrue; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smackx.jingle.element.Jingle; import org.jivesoftware.smackx.jingle.element.Jingle;
import org.jivesoftware.smackx.jingle.element.JingleAction; import org.jivesoftware.smackx.jingle.element.JingleAction;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException; import org.jxmpp.stringprep.XmppStringprepException;
@ -35,19 +36,23 @@ import org.jxmpp.stringprep.XmppStringprepException;
*/ */
public class JingleTest extends SmackTestSuite { public class JingleTest extends SmackTestSuite {
@Test(expected = IllegalArgumentException.class) @Test
public void emptyBuilderTest() { public void emptyBuilderTest() {
Jingle.Builder builder = Jingle.getBuilder(); Jingle.Builder builder = Jingle.getBuilder();
builder.build(); assertThrows(IllegalArgumentException.class, () -> {
builder.build();
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void onlySessionIdBuilderTest() { public void onlySessionIdBuilderTest() {
String sessionId = "testSessionId"; String sessionId = "testSessionId";
Jingle.Builder builder = Jingle.getBuilder(); Jingle.Builder builder = Jingle.getBuilder();
builder.setSessionId(sessionId); builder.setSessionId(sessionId);
builder.build(); assertThrows(IllegalArgumentException.class, () -> {
builder.build();
});
} }
@Test @Test

View file

@ -23,8 +23,8 @@ import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smackx.jingle.element.Jingle; import org.jivesoftware.smackx.jingle.element.Jingle;
import org.jivesoftware.smackx.jingle.element.JingleContent; import org.jivesoftware.smackx.jingle.element.JingleContent;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException; import org.jxmpp.stringprep.XmppStringprepException;
@ -37,7 +37,7 @@ public class JingleUtilTest extends SmackTestSuite {
private XMPPConnection connection; private XMPPConnection connection;
private JingleUtil jutil; private JingleUtil jutil;
@Before @BeforeEach
public void setup() { public void setup() {
connection = new DummyConnection( connection = new DummyConnection(
DummyConnection.getDummyConfigurationBuilder() DummyConnection.getDummyConfigurationBuilder()

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.jingle.provider; package org.jivesoftware.smackx.jingle.provider;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static junit.framework.TestCase.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
@ -26,7 +26,7 @@ import org.jivesoftware.smackx.jingle.transports.jingle_ibb.provider.JingleIBBTr
import org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements.JingleS5BTransport; import org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements.JingleS5BTransport;
import org.jivesoftware.smackx.jingle.transports.jingle_s5b.provider.JingleS5BTransportProvider; import org.jivesoftware.smackx.jingle.transports.jingle_s5b.provider.JingleS5BTransportProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Tests for the JingleContentProviderManager. * Tests for the JingleContentProviderManager.

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.jingle.provider; package org.jivesoftware.smackx.jingle.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException; import java.io.IOException;
@ -28,7 +28,7 @@ import org.jivesoftware.smackx.jingle.element.Jingle;
import org.jivesoftware.smackx.jingle.element.JingleContentDescription; import org.jivesoftware.smackx.jingle.element.JingleContentDescription;
import org.jivesoftware.smackx.jingle.element.JingleContentTransport; import org.jivesoftware.smackx.jingle.element.JingleContentTransport;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class JingleProviderTest { public class JingleProviderTest {

View file

@ -16,10 +16,10 @@
*/ */
package org.jivesoftware.smackx.jingle.transports.jingle_ibb; package org.jivesoftware.smackx.jingle.transports.jingle_ibb;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static junit.framework.TestCase.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static junit.framework.TestCase.assertNotSame; import static org.junit.jupiter.api.Assertions.assertNotSame;
import static junit.framework.TestCase.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smack.test.util.TestUtils; import org.jivesoftware.smack.test.util.TestUtils;
@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.jingle.transports.jingle_ibb.element.JingleIBBTransport; import org.jivesoftware.smackx.jingle.transports.jingle_ibb.element.JingleIBBTransport;
import org.jivesoftware.smackx.jingle.transports.jingle_ibb.provider.JingleIBBTransportProvider; import org.jivesoftware.smackx.jingle.transports.jingle_ibb.provider.JingleIBBTransportProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Test JingleIBBTransport provider and element. * Test JingleIBBTransport provider and element.

View file

@ -16,11 +16,12 @@
*/ */
package org.jivesoftware.smackx.jingle.transports.jingle_s5b; package org.jivesoftware.smackx.jingle.transports.jingle_s5b;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static junit.framework.TestCase.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static junit.framework.TestCase.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static junit.framework.TestCase.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import static junit.framework.TestCase.assertTrue; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.net.UnknownHostException; import java.net.UnknownHostException;
@ -33,7 +34,7 @@ import org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements.JingleS5BTr
import org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements.JingleS5BTransportInfo; import org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements.JingleS5BTransportInfo;
import org.jivesoftware.smackx.jingle.transports.jingle_s5b.provider.JingleS5BTransportProvider; import org.jivesoftware.smackx.jingle.transports.jingle_s5b.provider.JingleS5BTransportProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException; import org.jxmpp.stringprep.XmppStringprepException;
@ -178,30 +179,36 @@ public class JingleS5BTransportTest extends SmackTestSuite {
assertEquals(candidateActivated, candidateActivatedTransport.toXML().toString()); assertEquals(candidateActivated, candidateActivatedTransport.toXML().toString());
} }
@Test(expected = IllegalArgumentException.class) @Test
public void candidateBuilderInvalidPortTest() { public void candidateBuilderInvalidPortTest() {
JingleS5BTransportCandidate.getBuilder().setPort(-5); assertThrows(IllegalArgumentException.class, () -> {
JingleS5BTransportCandidate.getBuilder().setPort(-5);
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void candidateBuilderInvalidPriorityTest() { public void candidateBuilderInvalidPriorityTest() {
JingleS5BTransportCandidate.getBuilder().setPriority(-1000); assertThrows(IllegalArgumentException.class, () -> {
JingleS5BTransportCandidate.getBuilder().setPriority(-1000);
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void transportCandidateIllegalPriorityTest() throws XmppStringprepException, UnknownHostException { public void transportCandidateIllegalPriorityTest() throws XmppStringprepException, UnknownHostException {
FullJid jid = JidCreate.fullFrom("test@test.test/test"); FullJid jid = JidCreate.fullFrom("test@test.test/test");
@SuppressWarnings("unused") assertThrows(IllegalArgumentException.class, () -> {
JingleS5BTransportCandidate candidate = new JingleS5BTransportCandidate( new JingleS5BTransportCandidate(
"cid", "localhost", jid, 5555, -30, JingleS5BTransportCandidate.Type.proxy); "cid", "localhost", jid, 5555, -30, JingleS5BTransportCandidate.Type.proxy);
});
} }
@Test(expected = IllegalArgumentException.class) @Test
public void transportCandidateIllegalPortTest() throws XmppStringprepException, UnknownHostException { public void transportCandidateIllegalPortTest() throws XmppStringprepException, UnknownHostException {
FullJid jid = JidCreate.fullFrom("test@test.test/test"); FullJid jid = JidCreate.fullFrom("test@test.test/test");
@SuppressWarnings("unused") assertThrows(IllegalArgumentException.class, () -> {
JingleS5BTransportCandidate candidate = new JingleS5BTransportCandidate( new JingleS5BTransportCandidate(
"cid", "host", jid, -5555, 30, JingleS5BTransportCandidate.Type.proxy); "cid", "host", jid, -5555, 30, JingleS5BTransportCandidate.Type.proxy);
});
} }
@Test @Test
@ -221,8 +228,10 @@ public class JingleS5BTransportTest extends SmackTestSuite {
assertEquals(streamHost.toXML().toString(), candidate.getStreamHost().toXML().toString()); assertEquals(streamHost.toXML().toString(), candidate.getStreamHost().toXML().toString());
} }
@Test(expected = IllegalArgumentException.class) @Test
public void typeFromIllegalStringTest() { public void typeFromIllegalStringTest() {
JingleS5BTransportCandidate.Type.fromString("illegal-type"); assertThrows(IllegalArgumentException.class, () -> {
JingleS5BTransportCandidate.Type.fromString("illegal-type");
});
} }
} }

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.jiveproperties; package org.jivesoftware.smackx.jiveproperties;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.util.PacketParserUtils; import org.jivesoftware.smack.util.PacketParserUtils;
@ -25,18 +25,18 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.jiveproperties.packet.JivePropertiesExtension; import org.jivesoftware.smackx.jiveproperties.packet.JivePropertiesExtension;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class JivePropertiesExtensionTest extends InitExtensions { public class JivePropertiesExtensionTest extends InitExtensions {
@Before @BeforeEach
public void setUp() { public void setUp() {
JivePropertiesManager.setJavaObjectEnabled(true); JivePropertiesManager.setJavaObjectEnabled(true);
} }
@After @AfterEach
public void tearDown() { public void tearDown() {
JivePropertiesManager.setJavaObjectEnabled(false); JivePropertiesManager.setJavaObjectEnabled(false);
} }

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.last_interaction; package org.jivesoftware.smackx.last_interaction;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.Date; import java.util.Date;
@ -31,7 +31,7 @@ import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smackx.last_interaction.element.IdleElement; import org.jivesoftware.smackx.last_interaction.element.IdleElement;
import org.jivesoftware.smackx.last_interaction.provider.IdleProvider; import org.jivesoftware.smackx.last_interaction.provider.IdleProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.util.XmppDateTime; import org.jxmpp.util.XmppDateTime;
public class IdleTest extends SmackTestSuite { public class IdleTest extends SmackTestSuite {

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.mediaelement.element; package org.jivesoftware.smackx.mediaelement.element;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.mediaelement.provider; package org.jivesoftware.smackx.mediaelement.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;

View file

@ -23,7 +23,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.message_correct.element.MessageCorrectExtension; import org.jivesoftware.smackx.message_correct.element.MessageCorrectExtension;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class MessageCorrectExtensionTest { public class MessageCorrectExtensionTest {

View file

@ -16,10 +16,10 @@
*/ */
package org.jivesoftware.smackx.mood; package org.jivesoftware.smackx.mood;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertTrue;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.provider.ProviderManager; import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
@ -31,7 +31,7 @@ import org.jivesoftware.smackx.mood.element.MoodElement;
import org.jivesoftware.smackx.mood.provider.MoodProvider; import org.jivesoftware.smackx.mood.provider.MoodProvider;
import org.jivesoftware.smackx.mood.provider.SimpleMoodConcretisationProvider; import org.jivesoftware.smackx.mood.provider.SimpleMoodConcretisationProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* This test checks, if extending XEP-0107: User Mood using custom mood concretisations works. * This test checks, if extending XEP-0107: User Mood using custom mood concretisations works.

View file

@ -16,10 +16,11 @@
*/ */
package org.jivesoftware.smackx.mood; package org.jivesoftware.smackx.mood;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertNull;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar; import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smack.test.util.TestUtils; import org.jivesoftware.smack.test.util.TestUtils;
@ -29,7 +30,7 @@ import org.jivesoftware.smack.xml.XmlPullParserException;
import org.jivesoftware.smackx.mood.element.MoodElement; import org.jivesoftware.smackx.mood.element.MoodElement;
import org.jivesoftware.smackx.mood.provider.MoodProvider; import org.jivesoftware.smackx.mood.provider.MoodProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class MoodElementTest extends SmackTestSuite { public class MoodElementTest extends SmackTestSuite {
@ -51,9 +52,11 @@ public class MoodElementTest extends SmackTestSuite {
assertEquals(xml, parsed.toXML().toString()); assertEquals(xml, parsed.toXML().toString());
} }
@Test(expected = IllegalArgumentException.class) @Test
public void illegalArgumentsTest() { public void illegalArgumentsTest() {
new MoodElement(null, "Text alone is not allowed."); assertThrows(IllegalArgumentException.class, () -> {
new MoodElement(null, "Text alone is not allowed.");
});
} }
@Test @Test
@ -71,13 +74,15 @@ public class MoodElementTest extends SmackTestSuite {
assertEquals(empty.toXML().toString(), emptyParsed.toXML().toString()); assertEquals(empty.toXML().toString(), emptyParsed.toXML().toString());
} }
@Test(expected = XmlPullParserException.class) @Test
public void unknownMoodValueExceptionTest() throws Exception { public void unknownMoodValueExceptionTest() throws Exception {
String xml = String xml =
"<mood xmlns='http://jabber.org/protocol/mood'>" + "<mood xmlns='http://jabber.org/protocol/mood'>" +
"<unknown/>" + "<unknown/>" +
"</mood>"; "</mood>";
XmlPullParser parser = TestUtils.getParser(xml); XmlPullParser parser = TestUtils.getParser(xml);
MoodProvider.INSTANCE.parse(parser); assertThrows(XmlPullParserException.class, () -> {
MoodProvider.INSTANCE.parse(parser);
});
} }
} }

View file

@ -16,10 +16,10 @@
*/ */
package org.jivesoftware.smackx.mood; package org.jivesoftware.smackx.mood;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static junit.framework.TestCase.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static junit.framework.TestCase.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static junit.framework.TestCase.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.StanzaBuilder; import org.jivesoftware.smack.packet.StanzaBuilder;
@ -27,7 +27,7 @@ import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smackx.mood.element.MoodElement; import org.jivesoftware.smackx.mood.element.MoodElement;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class MoodManagerTest extends SmackTestSuite { public class MoodManagerTest extends SmackTestSuite {

View file

@ -16,14 +16,14 @@
*/ */
package org.jivesoftware.smackx.muc; package org.jivesoftware.smackx.muc;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo; import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.packet.DataForm; import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class RoomInfoTest { public class RoomInfoTest {
@Test @Test

View file

@ -16,15 +16,15 @@
*/ */
package org.jivesoftware.smackx.muc.packet; package org.jivesoftware.smackx.muc.packet;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.jivesoftware.smackx.muc.packet.MUCUser.Status; import org.jivesoftware.smackx.muc.packet.MUCUser.Status;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class MUCUserTest { public class MUCUserTest {

View file

@ -18,10 +18,10 @@ package org.jivesoftware.smackx.ping;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence; import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.fail;
import static org.jxmpp.jid.JidTestUtil.DUMMY_AT_EXAMPLE_ORG; import static org.jxmpp.jid.JidTestUtil.DUMMY_AT_EXAMPLE_ORG;
import java.io.IOException; import java.io.IOException;
@ -38,7 +38,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.ping.packet.Ping; import org.jivesoftware.smackx.ping.packet.Ping;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class PingTest extends InitExtensions { public class PingTest extends InitExtensions {

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.privacy.provider; package org.jivesoftware.smackx.privacy.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.List; import java.util.List;
@ -29,7 +29,7 @@ import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.privacy.packet.Privacy; import org.jivesoftware.smackx.privacy.packet.Privacy;
import org.jivesoftware.smackx.privacy.packet.PrivacyItem; import org.jivesoftware.smackx.privacy.packet.PrivacyItem;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class PrivacyProviderTest extends InitExtensions { public class PrivacyProviderTest extends InitExtensions {

View file

@ -24,7 +24,7 @@ import java.util.List;
import org.jivesoftware.smackx.pubsub.Affiliation.Type; import org.jivesoftware.smackx.pubsub.Affiliation.Type;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.BareJid; import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;

View file

@ -16,8 +16,9 @@
*/ */
package org.jivesoftware.smackx.pubsub; package org.jivesoftware.smackx.pubsub;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import java.io.IOException; import java.io.IOException;
@ -38,7 +39,7 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder;
import org.jivesoftware.smackx.pubsub.packet.PubSub; import org.jivesoftware.smackx.pubsub.packet.PubSub;
import org.jivesoftware.smackx.xdata.packet.DataForm; import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Configure form test. * Configure form test.
@ -84,8 +85,8 @@ public class ConfigureFormTest extends InitExtensions {
} }
} }
@Test(expected = SmackException.class) @Test
public void getConfigFormWithTimeout() throws XMPPException, SmackException, InterruptedException { public void getConfigFormWithTimeout() throws XMPPException, InterruptedException {
ThreadedDummyConnection con = new ThreadedDummyConnection(); ThreadedDummyConnection con = new ThreadedDummyConnection();
PubSubManager mgr = new PubSubManager(con, PubSubManagerTest.DUMMY_PUBSUB_SERVICE); PubSubManager mgr = new PubSubManager(con, PubSubManagerTest.DUMMY_PUBSUB_SERVICE);
DiscoverInfoBuilder info = DiscoverInfo.builder("disco-result"); DiscoverInfoBuilder info = DiscoverInfo.builder("disco-result");
@ -95,12 +96,15 @@ public class ConfigureFormTest extends InitExtensions {
DiscoverInfo discoverInfo = info.build(); DiscoverInfo discoverInfo = info.build();
con.addIQReply(discoverInfo); con.addIQReply(discoverInfo);
Node node = mgr.getNode("princely_musings"); assertThrows(SmackException.class, () -> {
// TODO: This method should not throw any exception but currently does.
Node node = mgr.getNode("princely_musings");
SmackConfiguration.setDefaultReplyTimeout(100); SmackConfiguration.setDefaultReplyTimeout(100);
con.setTimeout(); con.setTimeout();
node.getNodeConfiguration(); node.getNodeConfiguration();
});
} }
@Test @Test

View file

@ -17,8 +17,8 @@
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.XmlUnitUtils.assertXmlSimilar;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.ThreadedDummyConnection; import org.jivesoftware.smack.ThreadedDummyConnection;
import org.jivesoftware.smack.packet.ExtensionElement; import org.jivesoftware.smack.packet.ExtensionElement;
@ -30,9 +30,9 @@ import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace; import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Item validation test. * Item validation test.
@ -42,7 +42,7 @@ import org.junit.Test;
public class ItemValidationTest extends InitExtensions { public class ItemValidationTest extends InitExtensions {
private ThreadedDummyConnection connection; private ThreadedDummyConnection connection;
@Before @BeforeEach
public void setUp() throws Exception { public void setUp() throws Exception {
// Uncomment this to enable debug output // Uncomment this to enable debug output
// SmackConfiguration.DEBUG = true; // SmackConfiguration.DEBUG = true;
@ -52,7 +52,7 @@ public class ItemValidationTest extends InitExtensions {
connection.login(); connection.login();
} }
@After @AfterEach
public void tearDown() throws Exception { public void tearDown() throws Exception {
if (connection != null) if (connection != null)
connection.disconnect(); connection.disconnect();

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.pubsub; package org.jivesoftware.smackx.pubsub;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException; import java.io.IOException;
@ -26,7 +26,7 @@ import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smackx.pubsub.packet.PubSub; import org.jivesoftware.smackx.pubsub.packet.PubSub;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException; import org.jxmpp.stringprep.XmppStringprepException;

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.pubsub; package org.jivesoftware.smackx.pubsub;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
@ -38,7 +38,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
import org.jivesoftware.util.ConnectionUtils; import org.jivesoftware.util.ConnectionUtils;
import org.jivesoftware.util.Protocol; import org.jivesoftware.util.Protocol;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.pubsub; package org.jivesoftware.smackx.pubsub;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class SimplePayloadTest { public class SimplePayloadTest {

View file

@ -18,7 +18,7 @@ package org.jivesoftware.smackx.pubsub.provider;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence; import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.List; import java.util.List;
@ -31,7 +31,7 @@ import org.jivesoftware.smackx.pubsub.Subscription;
import org.jivesoftware.smackx.pubsub.SubscriptionsExtension; import org.jivesoftware.smackx.pubsub.SubscriptionsExtension;
import org.jivesoftware.smackx.pubsub.packet.PubSub; import org.jivesoftware.smackx.pubsub.packet.PubSub;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class PubSubProviderTest { public class PubSubProviderTest {

View file

@ -18,10 +18,10 @@ package org.jivesoftware.smackx.receipts;
import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence; import static org.jivesoftware.smack.test.util.CharSequenceEquals.equalsCharSequence;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Properties; import java.util.Properties;
@ -38,7 +38,7 @@ import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.receipts.DeliveryReceiptManager.AutoReceiptMode; import org.jivesoftware.smackx.receipts.DeliveryReceiptManager.AutoReceiptMode;
import com.jamesmurty.utils.XMLBuilder; import com.jamesmurty.utils.XMLBuilder;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
public class DeliveryReceiptTest extends InitExtensions { public class DeliveryReceiptTest extends InitExtensions {

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.rsm.provider; package org.jivesoftware.smackx.rsm.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.util.PacketParserUtils; import org.jivesoftware.smack.util.PacketParserUtils;
@ -25,7 +25,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.rsm.packet.RSMSet; import org.jivesoftware.smackx.rsm.packet.RSMSet;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class RSMSetProviderTest extends InitExtensions { public class RSMSetProviderTest extends InitExtensions {

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.shim.provider; package org.jivesoftware.smackx.shim.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.test.util.TestUtils; import org.jivesoftware.smack.test.util.TestUtils;
@ -26,7 +26,7 @@ import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smackx.shim.packet.Header; import org.jivesoftware.smackx.shim.packet.Header;
import org.jivesoftware.smackx.shim.packet.HeadersExtension; import org.jivesoftware.smackx.shim.packet.HeadersExtension;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class HeadersProviderTest { public class HeadersProviderTest {

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.time.packet; package org.jivesoftware.smackx.time.packet;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
@ -24,7 +24,7 @@ import java.util.TimeZone;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class TimeTest extends InitExtensions { public class TimeTest extends InitExtensions {

View file

@ -16,15 +16,15 @@
*/ */
package org.jivesoftware.smackx.time.provider; package org.jivesoftware.smackx.time.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.util.PacketParserUtils; import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.time.packet.Time; import org.jivesoftware.smackx.time.packet.Time;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class TimeProviderTest { public class TimeProviderTest {

View file

@ -32,7 +32,7 @@ import org.jivesoftware.smack.xml.XmlPullParserException;
import org.jivesoftware.smackx.usertune.element.UserTuneElement; import org.jivesoftware.smackx.usertune.element.UserTuneElement;
import org.jivesoftware.smackx.usertune.provider.UserTuneProvider; import org.jivesoftware.smackx.usertune.provider.UserTuneProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource;

View file

@ -16,9 +16,9 @@
*/ */
package org.jivesoftware.smackx.usertune; package org.jivesoftware.smackx.usertune;
import static junit.framework.TestCase.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static junit.framework.TestCase.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static junit.framework.TestCase.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
@ -29,7 +29,7 @@ import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smackx.usertune.element.UserTuneElement; import org.jivesoftware.smackx.usertune.element.UserTuneElement;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class UserTuneManagerTest extends SmackTestSuite{ public class UserTuneManagerTest extends SmackTestSuite{

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.vcardtemp; package org.jivesoftware.smackx.vcardtemp;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Arrays; import java.util.Arrays;
@ -27,7 +27,7 @@ import org.jivesoftware.smack.util.stringencoder.Base64;
import org.jivesoftware.smackx.InitExtensions; import org.jivesoftware.smackx.InitExtensions;
import org.jivesoftware.smackx.vcardtemp.packet.VCard; import org.jivesoftware.smackx.vcardtemp.packet.VCard;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class VCardTest extends InitExtensions { public class VCardTest extends InitExtensions {

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.xdata.packet; package org.jivesoftware.smackx.xdata.packet;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.jivesoftware.smack.packet.Element; import org.jivesoftware.smack.packet.Element;
import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestSuite;
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.xdatalayout.packet.DataLayout.Text;
import org.jivesoftware.smackx.xdatavalidation.packet.ValidateElement; import org.jivesoftware.smackx.xdatavalidation.packet.ValidateElement;
import org.jivesoftware.smackx.xdatavalidation.packet.ValidateElement.RangeValidateElement; import org.jivesoftware.smackx.xdatavalidation.packet.ValidateElement.RangeValidateElement;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Unit tests for DataForm reading and parsing. * Unit tests for DataForm reading and parsing.

View file

@ -16,8 +16,8 @@
*/ */
package org.jivesoftware.smackx.xdatalayout.packet; package org.jivesoftware.smackx.xdatalayout.packet;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.xdatalayout.packet.DataLayout.Section;
import org.jivesoftware.smackx.xdatalayout.packet.DataLayout.Text; import org.jivesoftware.smackx.xdatalayout.packet.DataLayout.Text;
import org.jivesoftware.smackx.xdatalayout.provider.DataLayoutProvider; import org.jivesoftware.smackx.xdatalayout.provider.DataLayoutProvider;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* Unit tests for DataForm reading and parsing. * Unit tests for DataForm reading and parsing.

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.smackx.xdatavalidation; package org.jivesoftware.smackx.xdatavalidation;
import static org.junit.Assert.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 org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.FormField;

View file

@ -16,10 +16,10 @@
*/ */
package org.jivesoftware.smackx.xdatavalidation.provider; package org.jivesoftware.smackx.xdatavalidation.provider;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException; import java.io.IOException;

View file

@ -30,7 +30,7 @@ import org.jivesoftware.smack.xml.XmlPullParserException;
import org.jivesoftware.smackx.xhtmlim.packet.XHTMLExtension; import org.jivesoftware.smackx.xhtmlim.packet.XHTMLExtension;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class XHTMLExtensionProviderTest { public class XHTMLExtensionProviderTest {
public static final String XHTML_EXTENSION_SAMPLE_RESOURCE_NAME = "xhtml.xml"; public static final String XHTML_EXTENSION_SAMPLE_RESOURCE_NAME = "xhtml.xml";

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.util; package org.jivesoftware.util;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;

View file

@ -16,7 +16,7 @@
*/ */
package org.jivesoftware.util; package org.jivesoftware.util;
import static org.junit.Assert.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;