mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 10:19:41 +02:00
Fix minor codestyle issues
This commit is contained in:
parent
200f90ffdc
commit
cb18056613
422 changed files with 1404 additions and 1444 deletions
|
@ -25,11 +25,9 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.chat.ChatManagerListener;
|
||||
import org.jivesoftware.smack.filter.ThreadFilter;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
|
||||
import org.jivesoftware.smackx.jiveproperties.JivePropertiesManager;
|
||||
|
||||
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
|
||||
|
@ -37,7 +35,6 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTest;
|
|||
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.jxmpp.stringprep.XmppStringprepException;
|
||||
|
||||
/**
|
||||
* Tests for Chat Manager and for Chat Manager Listener.
|
||||
|
@ -68,7 +65,7 @@ public class ChatTest extends AbstractSmackIntegrationTest {
|
|||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SmackIntegrationTest
|
||||
public void testProperties() throws XmppStringprepException, NotConnectedException, Exception {
|
||||
public void testProperties() throws Exception {
|
||||
org.jivesoftware.smack.chat.Chat newChat = chatManagerOne.createChat(conTwo.getUser());
|
||||
StanzaCollector collector = conTwo.createStanzaCollector(new ThreadFilter(newChat.getThreadID()));
|
||||
|
||||
|
@ -85,7 +82,7 @@ public class ChatTest extends AbstractSmackIntegrationTest {
|
|||
|
||||
newChat.sendMessage(msg);
|
||||
|
||||
Message msg2 = (Message) collector.nextResult(2000);
|
||||
Message msg2 = collector.nextResult(2000);
|
||||
assertNotNull("No message was received", msg2);
|
||||
assertEquals("Subjects are different", msg.getSubject(), msg2.getSubject());
|
||||
assertEquals("Bodies are different", msg.getBody(), msg2.getBody());
|
||||
|
|
|
@ -60,7 +60,7 @@ public class LowLevelRosterIntegrationTest extends AbstractSmackLowLevelIntegrat
|
|||
}
|
||||
});
|
||||
|
||||
// Disconnect conTwo, this should cause an 'unavilable' presence to be send from conTwo to
|
||||
// Disconnect conTwo, this should cause an 'unavailable' presence to be send from conTwo to
|
||||
// conOne.
|
||||
conTwo.disconnect();
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public class FileTransferIntegrationTest extends AbstractSmackIntegrationTest {
|
|||
final FileTransferListener receiveListener = new FileTransferListener() {
|
||||
@Override
|
||||
public void fileTransferRequest(FileTransferRequest request) {
|
||||
byte[] dataReceived = null;
|
||||
byte[] dataReceived;
|
||||
IncomingFileTransfer ift = request.accept();
|
||||
try {
|
||||
InputStream is = ift.recieveFile();
|
||||
|
@ -105,9 +105,9 @@ public class FileTransferIntegrationTest extends AbstractSmackIntegrationTest {
|
|||
while (!oft.isDone()) {
|
||||
switch (oft.getStatus()) {
|
||||
case error:
|
||||
throw new Exception("Filetransfer error: " + oft.getError());
|
||||
throw new Exception("FileTransfer error: " + oft.getError());
|
||||
default:
|
||||
LOGGER.info("Filetransfer status: " + oft.getStatus() + ". Progress: " + oft.getProgress());
|
||||
LOGGER.info("FileTransfer status: " + oft.getStatus() + ". Progress: " + oft.getProgress());
|
||||
break;
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertArrayEquals;
|
|||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -62,7 +61,7 @@ public class HttpFileUploadIntegrationTest extends AbstractSmackIntegrationTest
|
|||
}
|
||||
|
||||
@SmackIntegrationTest
|
||||
public void httpFileUploadTest() throws FileNotFoundException, IOException, XMPPErrorException, InterruptedException, SmackException {
|
||||
public void httpFileUploadTest() throws IOException, XMPPErrorException, InterruptedException, SmackException {
|
||||
final int fileSize = FILE_SIZE;
|
||||
File file = createNewTempFile();
|
||||
FileOutputStream fos = new FileOutputStream(file.getCanonicalPath());
|
||||
|
|
|
@ -57,7 +57,7 @@ public class IoTControlIntegrationTest extends AbstractSmackIntegrationTest {
|
|||
*/
|
||||
@SmackIntegrationTest
|
||||
// @SmackSerialIntegrationTest
|
||||
public void controlTest() throws TimeoutException, Exception {
|
||||
public void controlTest() throws Exception {
|
||||
final String key = StringUtils.randomString(12);
|
||||
final String sn = StringUtils.randomString(12);
|
||||
final SimpleResultSyncPoint syncPoint = new SimpleResultSyncPoint();
|
||||
|
|
|
@ -58,7 +58,7 @@ public class IoTDataIntegrationTest extends AbstractSmackIntegrationTest {
|
|||
* @throws TimeoutException
|
||||
*/
|
||||
@SmackIntegrationTest
|
||||
public void dataTest() throws TimeoutException, Exception {
|
||||
public void dataTest() throws Exception {
|
||||
final String key = StringUtils.randomString(12);
|
||||
final String sn = StringUtils.randomString(12);
|
||||
final int value = INSECURE_RANDOM.nextInt();
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package org.jivesoftware.smackx.muc;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.jivesoftware.smack.MessageListener;
|
||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
|
@ -25,7 +24,6 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
|||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
||||
import org.jivesoftware.smackx.muc.MultiUserChat.MucCreateConfigFormHandle;
|
||||
|
||||
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
|
||||
|
@ -64,7 +62,7 @@ public class MultiUserChatIntegrationTest extends AbstractSmackIntegrationTest {
|
|||
}
|
||||
|
||||
@SmackIntegrationTest
|
||||
public void mucTest() throws TimeoutException, Exception {
|
||||
public void mucTest() throws Exception {
|
||||
EntityBareJid mucAddress = JidCreate.entityBareFrom(Localpart.from("smack-inttest-" + randomString), mucService.getDomain());
|
||||
|
||||
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
|
||||
|
|
|
@ -79,7 +79,7 @@ public class MultiUserChatLowLevelIntegrationTest extends AbstractSmackLowLevelI
|
|||
connection.connect().login();
|
||||
|
||||
// MucBookmarkAutojoinManager is also able to do its task automatically
|
||||
// after every login, it's not determinstic when this will be finished.
|
||||
// after every login, it's not deterministic when this will be finished.
|
||||
// So we trigger it manually here.
|
||||
MucBookmarkAutojoinManager.getInstanceFor(connection).autojoinBookmarkedConferences();
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.junit.BeforeClass;
|
|||
*/
|
||||
public abstract class AbstractOmemoIntegrationTest extends AbstractSmackIntegrationTest {
|
||||
|
||||
static final File storePath;
|
||||
private static final File storePath;
|
||||
|
||||
static {
|
||||
String userHome = System.getProperty("user.home");
|
||||
|
|
|
@ -107,7 +107,7 @@ public class OmemoSessionRenegotiationTest extends AbstractOmemoIntegrationTest
|
|||
@Override
|
||||
public void onOmemoMessageReceived(String decryptedBody, Message encryptedMessage, Message wrappingMessage, OmemoMessageInformation omemoInformation) {
|
||||
LOGGER.log(Level.INFO, "Alice received OMEMO message: " + decryptedBody);
|
||||
assertEquals("Reply must match the messagewe sent.", decryptedBody, m2);
|
||||
assertEquals("Reply must match the message we sent.", decryptedBody, m2);
|
||||
sp2.signal();
|
||||
}
|
||||
|
||||
|
|
|
@ -94,12 +94,12 @@ public class OmemoStoreTest extends AbstractOmemoIntegrationTest {
|
|||
store.getDateOfLastReceivedMessage(alice, bob.getOwnDevice()));
|
||||
Date now = new Date();
|
||||
store.setDateOfLastReceivedMessage(alice, bob.getOwnDevice(), now);
|
||||
assertEquals("Date of last reveived message must match the one we set.",
|
||||
assertEquals("Date of last received message must match the one we set.",
|
||||
now, store.getDateOfLastReceivedMessage(alice, bob.getOwnDevice()));
|
||||
assertNull("Date of last signed prekey renewal must be null.",
|
||||
assertNull("Date of last signed preKey renewal must be null.",
|
||||
store.getDateOfLastSignedPreKeyRenewal(alice));
|
||||
store.setDateOfLastSignedPreKeyRenewal(alice, now);
|
||||
assertEquals("Date of last signed prekey renewal must match our date.",
|
||||
assertEquals("Date of last signed preKey renewal must match our date.",
|
||||
now, store.getDateOfLastSignedPreKeyRenewal(alice));
|
||||
|
||||
// Keys
|
||||
|
|
|
@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals;
|
|||
|
||||
import java.util.concurrent.BrokenBarrierException;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.jivesoftware.smack.util.Async;
|
||||
|
||||
|
@ -29,7 +28,7 @@ import org.junit.Test;
|
|||
public class ResultSyncPointTest {
|
||||
|
||||
@Test
|
||||
public void testResultSyncPoint() throws InterruptedException, TimeoutException, Exception {
|
||||
public void testResultSyncPoint() throws Exception {
|
||||
final String result = "Hip Hip Hurrary!!111!";
|
||||
final CyclicBarrier barrier = new CyclicBarrier(2);
|
||||
final ResultSyncPoint<String, Exception> rsp = new ResultSyncPoint<>();
|
||||
|
@ -46,7 +45,7 @@ public class ResultSyncPointTest {
|
|||
}
|
||||
|
||||
@Test(expected = TestException.class)
|
||||
public void exceptionTestResultSyncPoint() throws InterruptedException, TimeoutException, Exception {
|
||||
public void exceptionTestResultSyncPoint() throws Exception {
|
||||
final CyclicBarrier barrier = new CyclicBarrier(2);
|
||||
final ResultSyncPoint<String, TestException> rsp = new ResultSyncPoint<>();
|
||||
Async.go(new Async.ThrowingRunnable() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue