1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 01:29:38 +02:00

More checkstyle whitespace related checks

This commit is contained in:
Florian Schmaus 2017-05-23 16:45:04 +02:00
parent 847890b037
commit ce1cddc722
140 changed files with 583 additions and 512 deletions

View file

@ -31,7 +31,7 @@ public class StanzaCollectorTest
{
TestStanzaCollector collector = new TestStanzaCollector(null, new OKEverything(), 5);
for (int i=0; i<6; i++)
for (int i = 0; i < 6; i++)
{
Stanza testPacket = new TestPacket(i);
collector.processStanza(testPacket);
@ -45,7 +45,7 @@ public class StanzaCollectorTest
assertEquals("5", collector.pollResult().getStanzaId());
assertNull(collector.pollResult());
for (int i=10; i<15; i++)
for (int i = 10; i < 15; i++)
{
Stanza testPacket = new TestPacket(i);
collector.processStanza(testPacket);
@ -156,7 +156,7 @@ public class StanzaCollectorTest
consumer2.start();
consumer3.start();
for(int i=0; i<insertCount; i++)
for (int i = 0; i < insertCount; i++)
{
collector.processStanza(new TestPacket(i));
}

View file

@ -29,7 +29,7 @@ public class FilterToStringTest {
andFilter.addFilter(new ThreadFilter("42"));
andFilter.addFilter(MessageWithBodiesFilter.INSTANCE);
final String res =andFilter.toString();
final String res = andFilter.toString();
assertEquals("AndFilter: (StanzaIdFilter: id=foo, ThreadFilter: thread=42, MessageWithBodiesFilter)", res);
}
}

View file

@ -64,7 +64,7 @@ public class MessageTest {
assertXMLEqual(control, messageTypeSet.toXML().toString());
}
@Test(expected=NullPointerException.class)
@Test(expected = NullPointerException.class)
public void setNullMessageBodyTest() {
Message message = getNewMessage();
message.addBody(null, null);

View file

@ -60,7 +60,7 @@ public class PresenceTest {
assertXMLEqual(control, presenceTypeSet.toXML().toString());
}
@Test(expected=NullPointerException.class)
@Test(expected = NullPointerException.class)
public void setNullPresenceTypeTest() {
getNewPresence().setType(null);
}
@ -113,7 +113,7 @@ public class PresenceTest {
assertXMLEqual(control, presence.toXML().toString());
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void setIllegalPriorityTest() {
getNewPresence().setPriority(Integer.MIN_VALUE);
}

View file

@ -54,7 +54,7 @@ public class ProviderConfigTest {
}
@Test
public void addClasspathFileLoaderProvider() throws Exception{
public void addClasspathFileLoaderProvider() throws Exception {
ProviderManager.addLoader(new ProviderFileLoader(FileUtils.getStreamForUrl("classpath:test.providers", null)));
Assert.assertNotNull(ProviderManager.getIQProvider("provider", "test:file_provider"));
}

View file

@ -29,7 +29,7 @@ public class ProviderManagerTest {
* This test should be run in a clean (e.g. forked) VM
*/
@Test
public void shouldInitializeSmackTest() throws Exception{
public void shouldInitializeSmackTest() throws Exception {
ProviderManager.addIQProvider("foo", "bar", new TestIQProvider());
assertTrue(SmackConfiguration.isSmackInitialized());
}

View file

@ -17,6 +17,7 @@
package org.jivesoftware.smack.sasl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
@ -57,7 +58,7 @@ public class DigestMd5SaslTest extends AbstractSaslTest {
if (useAuthzid) {
assertMapValue("authzid", "shazbat@xmpp.org", responsePairs);
} else {
assert(!responsePairs.containsKey("authzid"));
assertTrue (!responsePairs.containsKey("authzid"));
}
assertMapValue("username", "florian", responsePairs);
assertMapValue("realm", "xmpp.org", responsePairs);

View file

@ -664,7 +664,7 @@ public class PacketParserUtilsTest {
*
* @throws Exception
*/
@Test(expected=XmlPullParserException.class)
@Test(expected = XmlPullParserException.class)
public void invalidMessageBodyContainingTagTest() throws Exception {
String control = XMLBuilder.create("message")
.a("from", "romeo@montague.lit/orchard")
@ -701,7 +701,7 @@ public class PacketParserUtilsTest {
try {
PacketParserUtils.parseMessage(PacketParserUtils.getParserFor(invalidControl));
fail("Exception should be thrown");
} catch(XmlPullParserException e) {
} catch (XmlPullParserException e) {
assertTrue(e.getMessage().contains("end tag name </span>"));
}
@ -710,7 +710,7 @@ public class PacketParserUtilsTest {
try {
PacketParserUtils.parseMessage(PacketParserUtils.getParserFor(invalidControl));
fail("Exception should be thrown");
} catch(XmlPullParserException e) {
} catch (XmlPullParserException e) {
assertTrue(e.getMessage().contains("end tag name </body>"));
}
@ -719,7 +719,7 @@ public class PacketParserUtilsTest {
try {
PacketParserUtils.parseMessage(PacketParserUtils.getParserFor(invalidControl));
fail("Exception should be thrown");
} catch(XmlPullParserException e) {
} catch (XmlPullParserException e) {
assertTrue(e.getMessage().contains("end tag name </message>"));
}

View file

@ -70,7 +70,7 @@ public class SHA1Test {
*/
private boolean isValidHash(String result) {
boolean valid = true;
for (int i=0; i<result.length(); i++) {
for (int i = 0; i < result.length(); i++) {
char c = result.charAt(i);
if (HASH_CHARS.indexOf(c) < 0) {
valid = false;