1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +02:00

Enable LeftCurly checkstyle check

This commit is contained in:
Florian Schmaus 2018-04-06 10:21:46 +02:00
parent 5a841ff0a8
commit 9b5dafe541
93 changed files with 549 additions and 1087 deletions

View file

@ -44,19 +44,16 @@ import org.junit.Test;
* @author Robin Collier
*
*/
public class ConfigureFormTest extends InitExtensions
{
public class ConfigureFormTest extends InitExtensions {
@Test
public void checkChildrenAssocPolicy()
{
public void checkChildrenAssocPolicy() {
ConfigureForm form = new ConfigureForm(DataForm.Type.submit);
form.setChildrenAssociationPolicy(ChildrenAssociationPolicy.owners);
assertEquals(ChildrenAssociationPolicy.owners, form.getChildrenAssociationPolicy());
}
@Test
public void getConfigFormWithInsufficientPrivileges() throws XMPPException, SmackException, IOException, InterruptedException
{
public void getConfigFormWithInsufficientPrivileges() throws XMPPException, SmackException, IOException, InterruptedException {
ThreadedDummyConnection con = ThreadedDummyConnection.newInstance();
PubSubManager mgr = new PubSubManager(con, PubSubManagerTest.DUMMY_PUBSUB_SERVICE);
DiscoverInfo info = new DiscoverInfo();
@ -75,20 +72,17 @@ public class ConfigureFormTest extends InitExtensions
errorIq.setError(error);
con.addIQReply(errorIq);
try
{
try {
node.getNodeConfiguration();
fail();
}
catch (XMPPErrorException e)
{
catch (XMPPErrorException e) {
Assert.assertEquals(XMPPError.Type.AUTH, e.getXMPPError().getType());
}
}
@Test(expected = SmackException.class)
public void getConfigFormWithTimeout() throws XMPPException, SmackException, InterruptedException
{
public void getConfigFormWithTimeout() throws XMPPException, SmackException, InterruptedException {
ThreadedDummyConnection con = new ThreadedDummyConnection();
PubSubManager mgr = new PubSubManager(con, PubSubManagerTest.DUMMY_PUBSUB_SERVICE);
DiscoverInfo info = new DiscoverInfo();

View file

@ -42,8 +42,7 @@ public class ItemValidationTest extends InitExtensions {
private ThreadedDummyConnection connection;
@Before
public void setUp() throws Exception
{
public void setUp() throws Exception {
// Uncomment this to enable debug output
// SmackConfiguration.DEBUG = true;
@ -53,15 +52,13 @@ public class ItemValidationTest extends InitExtensions {
}
@After
public void tearDown() throws Exception
{
public void tearDown() throws Exception {
if (connection != null)
connection.disconnect();
}
@Test
public void verifyBasicItem() throws Exception
{
public void verifyBasicItem() throws Exception {
Item simpleItem = new Item();
String simpleCtrl = "<item />";
assertXMLEqual(simpleCtrl, simpleItem.toXML());
@ -76,8 +73,7 @@ public class ItemValidationTest extends InitExtensions {
}
@Test
public void verifyPayloadItem() throws Exception
{
public void verifyPayloadItem() throws Exception {
SimplePayload payload = new SimplePayload(null, null, "<data>This is the payload</data>");
PayloadItem<SimplePayload> simpleItem = new PayloadItem<>(payload);
@ -94,8 +90,7 @@ public class ItemValidationTest extends InitExtensions {
}
@Test
public void parseBasicItem() throws Exception
{
public void parseBasicItem() throws Exception {
XmlPullParser parser = PacketParserUtils.getParserFor(
"<message from='pubsub.myserver.com' to='francisco@denmark.lit' id='foo'>" +
"<event xmlns='http://jabber.org/protocol/pubsub#event'>" +
@ -121,8 +116,7 @@ public class ItemValidationTest extends InitExtensions {
}
@Test
public void parseSimplePayloadItem() throws Exception
{
public void parseSimplePayloadItem() throws Exception {
String itemContent = "<foo xmlns='smack:test'>Some text</foo>";
XmlPullParser parser = PacketParserUtils.getParserFor(
@ -154,8 +148,7 @@ public class ItemValidationTest extends InitExtensions {
}
@Test
public void parseComplexItem() throws Exception
{
public void parseComplexItem() throws Exception {
String itemContent =
"<entry xmlns='http://www.w3.org/2005/Atom'>" +
"<title>Soliloquy</title>" +
@ -201,8 +194,7 @@ public class ItemValidationTest extends InitExtensions {
}
@Test
public void parseEmptyTag() throws Exception
{
public void parseEmptyTag() throws Exception {
String itemContent = "<foo xmlns='smack:test'><bar/></foo>";
XmlPullParser parser = PacketParserUtils.getParserFor(