mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-14 11:39:39 +02:00
More checkstyle whitespace related checks
This commit is contained in:
parent
847890b037
commit
ce1cddc722
140 changed files with 583 additions and 512 deletions
|
@ -163,7 +163,7 @@ public class Socks5ByteStreamManagerTest {
|
|||
catch (FeatureNotSupportedException e) {
|
||||
assertTrue(e.getFeature().equals("SOCKS5 Bytestream"));
|
||||
assertTrue(e.getJid().equals(targetJID));
|
||||
} catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ public class Socks5ProxyTest {
|
|||
proxy.addLocalAddress("same");
|
||||
|
||||
int sameCount = 0;
|
||||
for(String localAddress : proxy.getLocalAddresses()) {
|
||||
for (String localAddress : proxy.getLocalAddresses()) {
|
||||
if ("same".equals(localAddress)) {
|
||||
sameCount++;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ public final class Socks5TestProxy {
|
|||
*/
|
||||
@SuppressWarnings("WaitNotInLoop")
|
||||
public Socket getSocket(String digest) {
|
||||
synchronized(this) {
|
||||
synchronized (this) {
|
||||
if (!startupComplete) {
|
||||
try {
|
||||
wait(5000);
|
||||
|
|
|
@ -93,7 +93,7 @@ public class ForwardedTest {
|
|||
assertEquals("forwarded", parser.getName());
|
||||
}
|
||||
|
||||
@Test(expected=Exception.class)
|
||||
@Test(expected = Exception.class)
|
||||
public void forwardedEmptyTest() throws Exception {
|
||||
XmlPullParser parser;
|
||||
String control;
|
||||
|
|
|
@ -75,32 +75,32 @@ public class GeoLocationTest extends InitExtensions {
|
|||
|
||||
// @formatter:off
|
||||
final String geoLocationMessageString = "<message from='portia@merchantofvenice.lit'"
|
||||
+" to='bassanio@merchantofvenice.lit'>"
|
||||
+"<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+"<accuracy>23</accuracy>"
|
||||
+"<alt>1000</alt>"
|
||||
+"<area>Delhi</area>"
|
||||
+"<bearing>10</bearing>"
|
||||
+"<building>Small Building</building>"
|
||||
+"<country>India</country>"
|
||||
+"<countrycode>IN</countrycode>"
|
||||
+"<description>My Description</description>"
|
||||
+"<error>90</error>"
|
||||
+"<floor>top</floor>"
|
||||
+"<lat>25.098345</lat>"
|
||||
+"<locality>awesome</locality>"
|
||||
+"<lon>77.992034</lon>"
|
||||
+"<postalcode>110085</postalcode>"
|
||||
+"<region>North</region>"
|
||||
+"<room>small</room>"
|
||||
+"<speed>250.0</speed>"
|
||||
+"<street>Wall Street</street>"
|
||||
+"<text>Unit Testing GeoLocation</text>"
|
||||
+"<timestamp>2004-02-19</timestamp>"
|
||||
+"<tzo>+5:30</tzo>"
|
||||
+"<uri>http://xmpp.org</uri>"
|
||||
+"</geoloc>"
|
||||
+"</message>";
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>23</accuracy>"
|
||||
+ "<alt>1000</alt>"
|
||||
+ "<area>Delhi</area>"
|
||||
+ "<bearing>10</bearing>"
|
||||
+ "<building>Small Building</building>"
|
||||
+ "<country>India</country>"
|
||||
+ "<countrycode>IN</countrycode>"
|
||||
+ "<description>My Description</description>"
|
||||
+ "<error>90</error>"
|
||||
+ "<floor>top</floor>"
|
||||
+ "<lat>25.098345</lat>"
|
||||
+ "<locality>awesome</locality>"
|
||||
+ "<lon>77.992034</lon>"
|
||||
+ "<postalcode>110085</postalcode>"
|
||||
+ "<region>North</region>"
|
||||
+ "<room>small</room>"
|
||||
+ "<speed>250.0</speed>"
|
||||
+ "<street>Wall Street</street>"
|
||||
+ "<text>Unit Testing GeoLocation</text>"
|
||||
+ "<timestamp>2004-02-19</timestamp>"
|
||||
+ "<tzo>+5:30</tzo>"
|
||||
+ "<uri>http://xmpp.org</uri>"
|
||||
+ "</geoloc>"
|
||||
+ "</message>";
|
||||
// @formatter:on
|
||||
|
||||
Message messageWithGeoLocation = (Message) PacketParserUtils.parseStanza(geoLocationMessageString);
|
||||
|
|
|
@ -35,32 +35,32 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
public void testGeoLocationProviderWithNoDatumSet() throws Exception {
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+" to='bassanio@merchantofvenice.lit'>"
|
||||
+"<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+"<accuracy>23</accuracy>"
|
||||
+"<alt>1000</alt>"
|
||||
+"<area>Delhi</area>"
|
||||
+"<bearing>10</bearing>"
|
||||
+"<building>Small Building</building>"
|
||||
+"<country>India</country>"
|
||||
+"<countrycode>IN</countrycode>"
|
||||
+"<description>My Description</description>"
|
||||
+"<error>90</error>"
|
||||
+"<floor>top</floor>"
|
||||
+"<lat>25.098345</lat>"
|
||||
+"<locality>awesome</locality>"
|
||||
+"<lon>77.992034</lon>"
|
||||
+"<postalcode>110085</postalcode>"
|
||||
+"<region>North</region>"
|
||||
+"<room>small</room>"
|
||||
+"<speed>250.0</speed>"
|
||||
+"<street>Wall Street</street>"
|
||||
+"<text>Unit Testing GeoLocation</text>"
|
||||
+"<timestamp>2004-02-19</timestamp>"
|
||||
+"<tzo>+5:30</tzo>"
|
||||
+"<uri>http://xmpp.org</uri>"
|
||||
+"</geoloc>"
|
||||
+"</message>";
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>23</accuracy>"
|
||||
+ "<alt>1000</alt>"
|
||||
+ "<area>Delhi</area>"
|
||||
+ "<bearing>10</bearing>"
|
||||
+ "<building>Small Building</building>"
|
||||
+ "<country>India</country>"
|
||||
+ "<countrycode>IN</countrycode>"
|
||||
+ "<description>My Description</description>"
|
||||
+ "<error>90</error>"
|
||||
+ "<floor>top</floor>"
|
||||
+ "<lat>25.098345</lat>"
|
||||
+ "<locality>awesome</locality>"
|
||||
+ "<lon>77.992034</lon>"
|
||||
+ "<postalcode>110085</postalcode>"
|
||||
+ "<region>North</region>"
|
||||
+ "<room>small</room>"
|
||||
+ "<speed>250.0</speed>"
|
||||
+ "<street>Wall Street</street>"
|
||||
+ "<text>Unit Testing GeoLocation</text>"
|
||||
+ "<timestamp>2004-02-19</timestamp>"
|
||||
+ "<tzo>+5:30</tzo>"
|
||||
+ "<uri>http://xmpp.org</uri>"
|
||||
+ "</geoloc>"
|
||||
+ "</message>";
|
||||
// @formatter:on
|
||||
|
||||
Message messageWithGeoLocation = (Message) PacketParserUtils.parseStanza(geoLocationString);
|
||||
|
@ -101,33 +101,33 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+" to='bassanio@merchantofvenice.lit'>"
|
||||
+"<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+"<accuracy>23</accuracy>"
|
||||
+"<alt>1000</alt>"
|
||||
+"<area>Delhi</area>"
|
||||
+"<bearing>10</bearing>"
|
||||
+"<building>Small Building</building>"
|
||||
+"<country>India</country>"
|
||||
+"<countrycode>IN</countrycode>"
|
||||
+"<datum>Test Datum</datum>"
|
||||
+"<description>My Description</description>"
|
||||
+"<error>90</error>"
|
||||
+"<floor>top</floor>"
|
||||
+"<lat>25.098345</lat>"
|
||||
+"<locality>awesome</locality>"
|
||||
+"<lon>77.992034</lon>"
|
||||
+"<postalcode>110085</postalcode>"
|
||||
+"<region>North</region>"
|
||||
+"<room>small</room>"
|
||||
+"<speed>250.0</speed>"
|
||||
+"<street>Wall Street</street>"
|
||||
+"<text>Unit Testing GeoLocation</text>"
|
||||
+"<timestamp>2004-02-19</timestamp>"
|
||||
+"<tzo>+5:30</tzo>"
|
||||
+"<uri>http://xmpp.org</uri>"
|
||||
+"</geoloc>"
|
||||
+"</message>";
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>23</accuracy>"
|
||||
+ "<alt>1000</alt>"
|
||||
+ "<area>Delhi</area>"
|
||||
+ "<bearing>10</bearing>"
|
||||
+ "<building>Small Building</building>"
|
||||
+ "<country>India</country>"
|
||||
+ "<countrycode>IN</countrycode>"
|
||||
+ "<datum>Test Datum</datum>"
|
||||
+ "<description>My Description</description>"
|
||||
+ "<error>90</error>"
|
||||
+ "<floor>top</floor>"
|
||||
+ "<lat>25.098345</lat>"
|
||||
+ "<locality>awesome</locality>"
|
||||
+ "<lon>77.992034</lon>"
|
||||
+ "<postalcode>110085</postalcode>"
|
||||
+ "<region>North</region>"
|
||||
+ "<room>small</room>"
|
||||
+ "<speed>250.0</speed>"
|
||||
+ "<street>Wall Street</street>"
|
||||
+ "<text>Unit Testing GeoLocation</text>"
|
||||
+ "<timestamp>2004-02-19</timestamp>"
|
||||
+ "<tzo>+5:30</tzo>"
|
||||
+ "<uri>http://xmpp.org</uri>"
|
||||
+ "</geoloc>"
|
||||
+ "</message>";
|
||||
// @formatter:on
|
||||
|
||||
Message messageWithGeoLocation = (Message) PacketParserUtils.parseStanza(geoLocationString);
|
||||
|
@ -168,11 +168,11 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+" to='bassanio@merchantofvenice.lit'>"
|
||||
+"<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+"<error>90</error>"
|
||||
+"</geoloc>"
|
||||
+"</message>";
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<error>90</error>"
|
||||
+ "</geoloc>"
|
||||
+ "</message>";
|
||||
// @formatter:on
|
||||
|
||||
Message messageWithGeoLocation = (Message) PacketParserUtils.parseStanza(geoLocationString);
|
||||
|
@ -188,11 +188,11 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+" to='bassanio@merchantofvenice.lit'>"
|
||||
+"<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+"<accuracy>90</accuracy>"
|
||||
+"</geoloc>"
|
||||
+"</message>";
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>90</accuracy>"
|
||||
+ "</geoloc>"
|
||||
+ "</message>";
|
||||
// @formatter:on
|
||||
|
||||
Message messageWithGeoLocation = (Message) PacketParserUtils.parseStanza(geoLocationString);
|
||||
|
@ -208,12 +208,12 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+" to='bassanio@merchantofvenice.lit'>"
|
||||
+"<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+"<accuracy>90</accuracy>"
|
||||
+"<error>100</error>"
|
||||
+"</geoloc>"
|
||||
+"</message>";
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>90</accuracy>"
|
||||
+ "<error>100</error>"
|
||||
+ "</geoloc>"
|
||||
+ "</message>";
|
||||
// @formatter:on
|
||||
|
||||
Message messageWithGeoLocation = (Message) PacketParserUtils.parseStanza(geoLocationString);
|
||||
|
|
|
@ -82,7 +82,7 @@ public class ConfigureFormTest extends InitExtensions
|
|||
}
|
||||
}
|
||||
|
||||
@Test (expected=SmackException.class)
|
||||
@Test(expected = SmackException.class)
|
||||
public void getConfigFormWithTimeout() throws XMPPException, SmackException, InterruptedException
|
||||
{
|
||||
ThreadedDummyConnection con = new ThreadedDummyConnection();
|
||||
|
|
|
@ -111,11 +111,11 @@ public class ItemValidationTest extends InitExtensions {
|
|||
assertEquals(EventElementType.items, event.getEventType());
|
||||
assertEquals(1, event.getExtensions().size());
|
||||
assertTrue(event.getExtensions().get(0) instanceof ItemsExtension);
|
||||
assertEquals(1, ((ItemsExtension)event.getExtensions().get(0)).items.size());
|
||||
assertEquals(1, ((ItemsExtension) event.getExtensions().get(0)).items.size());
|
||||
|
||||
ExtensionElement itemExt = ((ItemsExtension)event.getExtensions().get(0)).items.get(0);
|
||||
ExtensionElement itemExt = ((ItemsExtension) event.getExtensions().get(0)).items.get(0);
|
||||
assertTrue(itemExt instanceof Item);
|
||||
assertEquals("testid1", ((Item)itemExt).getId());
|
||||
assertEquals("testid1", ((Item) itemExt).getId());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -137,10 +137,10 @@ public class ItemValidationTest extends InitExtensions {
|
|||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
ExtensionElement eventExt = message.getExtension(PubSubNamespace.EVENT.getXmlns());
|
||||
EventElement event = (EventElement) eventExt;
|
||||
ExtensionElement itemExt = ((ItemsExtension)event.getExtensions().get(0)).items.get(0);
|
||||
ExtensionElement itemExt = ((ItemsExtension) event.getExtensions().get(0)).items.get(0);
|
||||
|
||||
assertTrue(itemExt instanceof PayloadItem<?>);
|
||||
PayloadItem<?> item = (PayloadItem<?>)itemExt;
|
||||
PayloadItem<?> item = (PayloadItem<?>) itemExt;
|
||||
|
||||
assertEquals("testid1", item.getId());
|
||||
assertTrue(item.getPayload() instanceof SimplePayload);
|
||||
|
@ -184,10 +184,10 @@ public class ItemValidationTest extends InitExtensions {
|
|||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
ExtensionElement eventExt = message.getExtension(PubSubNamespace.EVENT.getXmlns());
|
||||
EventElement event = (EventElement) eventExt;
|
||||
ExtensionElement itemExt = ((ItemsExtension)event.getExtensions().get(0)).items.get(0);
|
||||
ExtensionElement itemExt = ((ItemsExtension) event.getExtensions().get(0)).items.get(0);
|
||||
|
||||
assertTrue(itemExt instanceof PayloadItem<?>);
|
||||
PayloadItem<?> item = (PayloadItem<?>)itemExt;
|
||||
PayloadItem<?> item = (PayloadItem<?>) itemExt;
|
||||
|
||||
assertEquals("testid1", item.getId());
|
||||
assertTrue(item.getPayload() instanceof SimplePayload);
|
||||
|
@ -222,15 +222,15 @@ public class ItemValidationTest extends InitExtensions {
|
|||
assertEquals(EventElementType.items, event.getEventType());
|
||||
assertEquals(1, event.getExtensions().size());
|
||||
assertTrue(event.getExtensions().get(0) instanceof ItemsExtension);
|
||||
assertEquals(1, ((ItemsExtension)event.getExtensions().get(0)).items.size());
|
||||
assertEquals(1, ((ItemsExtension) event.getExtensions().get(0)).items.size());
|
||||
|
||||
ExtensionElement itemExt = ((ItemsExtension)event.getExtensions().get(0)).items.get(0);
|
||||
ExtensionElement itemExt = ((ItemsExtension) event.getExtensions().get(0)).items.get(0);
|
||||
assertTrue(itemExt instanceof PayloadItem<?>);
|
||||
PayloadItem<?> item = (PayloadItem<?>)itemExt;
|
||||
PayloadItem<?> item = (PayloadItem<?>) itemExt;
|
||||
|
||||
assertEquals("testid1", item.getId());
|
||||
assertTrue(item.getPayload() instanceof SimplePayload);
|
||||
|
||||
assertXMLEqual(itemContent, ((SimplePayload)item.getPayload()).toXML().toString());
|
||||
assertXMLEqual(itemContent, ((SimplePayload) item.getPayload()).toXML().toString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class DeliveryReceiptTest extends InitExtensions {
|
|||
parser = PacketParserUtils.getParserFor(control);
|
||||
Message p = PacketParserUtils.parseMessage(parser);
|
||||
|
||||
DeliveryReceiptRequest drr = (DeliveryReceiptRequest)p.getExtension(
|
||||
DeliveryReceiptRequest drr = (DeliveryReceiptRequest) p.getExtension(
|
||||
DeliveryReceiptRequest.ELEMENT, DeliveryReceipt.NAMESPACE);
|
||||
assertNotNull(drr);
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ public class DataLayoutTest {
|
|||
assertEquals("Label - & \u00E9 \u00E1 ", layout.getLabel());
|
||||
section = (Section) layout.getPageLayout().get(1);
|
||||
assertEquals("section Label - & \u00E9 \u00E1 ", section.getLabel());
|
||||
Text text = (Text)layout.getPageLayout().get(2);
|
||||
Text text = (Text) layout.getPageLayout().get(2);
|
||||
assertEquals("PageText - & \u00E9 \u00E1 ", text.getText());
|
||||
section = (Section) layout.getPageLayout().get(3);
|
||||
assertEquals("<html>Number of Persons by<br/> Nationality and Status</html>", section.getLabel());
|
||||
|
@ -155,7 +155,7 @@ public class DataLayoutTest {
|
|||
assertEquals("Label - & \u00E9 \u00E1 ", layout.getLabel());
|
||||
Section section = (Section) layout.getPageLayout().get(1);
|
||||
assertEquals("section Label - & \u00E9 \u00E1 ", section.getLabel());
|
||||
Text text = (Text)layout.getPageLayout().get(2);
|
||||
Text text = (Text) layout.getPageLayout().get(2);
|
||||
assertEquals("PageText - & \u00E9 \u00E1 ", text.getText());
|
||||
section = (Section) layout.getPageLayout().get(3);
|
||||
assertEquals("<html>Number of Persons by<br/> Nationality and Status</html>", section.getLabel());
|
||||
|
|
|
@ -122,7 +122,7 @@ public class DataValidationTest {
|
|||
assertEquals(TEST_OUTPUT_RANGE2, output);
|
||||
}
|
||||
|
||||
@Test(expected=NumberFormatException.class)
|
||||
@Test(expected = NumberFormatException.class)
|
||||
public void testRangeFailure() throws IOException, XmlPullParserException {
|
||||
XmlPullParser parser = getParser(TEST_OUTPUT_FAIL);
|
||||
DataValidationProvider.parse(parser);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue