1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-06 21:21:08 +01:00

Add more checkstyle tests

- Lines containing tab(s) after space
- Usage of printStackTrace
- Usage of println
- Add SupressionCommentFilter module

SuppressionCommentFilter can be enabled with
// CHECKSTYLE:OFF
and disabled with
// CHECKSTYLE:ON
This commit is contained in:
Florian Schmaus 2015-03-17 21:19:06 +01:00
parent 4f64bb1036
commit b2221d5483
59 changed files with 382 additions and 202 deletions

View file

@ -233,7 +233,7 @@ public class JingleManagerTest extends SmackTestCase {
assertTrue(valCounter() > 0);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
fail("An error occured with Jingle");
}
}
@ -278,7 +278,7 @@ public class JingleManagerTest extends SmackTestCase {
JingleSession session1 = request.accept();
session1.startIncoming();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
});
@ -293,7 +293,7 @@ public class JingleManagerTest extends SmackTestCase {
assertTrue(valCounter() > 0);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
fail("An error occured with Jingle");
}
}
@ -369,7 +369,7 @@ public class JingleManagerTest extends SmackTestCase {
session1.startIncoming();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
});
@ -384,7 +384,7 @@ public class JingleManagerTest extends SmackTestCase {
assertTrue(valCounter() == 1);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
fail("An error occured with Jingle");
}
}
@ -456,7 +456,7 @@ public class JingleManagerTest extends SmackTestCase {
session1.startIncoming();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
});
@ -498,7 +498,7 @@ public class JingleManagerTest extends SmackTestCase {
assertTrue(valCounter() == 2);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
fail("An error occured with Jingle");
}
}
@ -542,7 +542,7 @@ public class JingleManagerTest extends SmackTestCase {
session.startIncoming();
session.terminate();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -588,7 +588,7 @@ public class JingleManagerTest extends SmackTestCase {
assertTrue(valCounter() > 0);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
fail("An error occured with Jingle");
}
}
@ -625,7 +625,7 @@ public class JingleManagerTest extends SmackTestCase {
incCounter();
}
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
}
@ -666,11 +666,11 @@ public class JingleManagerTest extends SmackTestCase {
ds1.close();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -737,7 +737,7 @@ public class JingleManagerTest extends SmackTestCase {
session.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -783,7 +783,7 @@ public class JingleManagerTest extends SmackTestCase {
Thread.sleep(3000);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
System.out.println(valCounter());
@ -871,7 +871,7 @@ public class JingleManagerTest extends SmackTestCase {
session.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -893,7 +893,7 @@ public class JingleManagerTest extends SmackTestCase {
Thread.sleep(15000);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -941,7 +941,7 @@ public class JingleManagerTest extends SmackTestCase {
//
// ses.startIncoming();
// } catch (Exception e) {
// e.printStackTrace();
// LOGGER.log(Level.WARNING, "exception", e);
// }
// }
// });
@ -984,7 +984,7 @@ public class JingleManagerTest extends SmackTestCase {
// assertTrue(valCounter() > 0);
//
// } catch (Exception e) {
// e.printStackTrace();
// LOGGER.log(Level.WARNING, "exception", e);
// fail("An error occured with Jingle");
// }
// }

View file

@ -96,7 +96,7 @@ public class JingleMediaTest extends SmackTestCase {
// });
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -122,7 +122,7 @@ public class JingleMediaTest extends SmackTestCase {
Thread.sleep(60000);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -165,11 +165,11 @@ public class JingleMediaTest extends SmackTestCase {
try {
Thread.sleep(12000);
} catch (InterruptedException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
session.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -203,7 +203,7 @@ public class JingleMediaTest extends SmackTestCase {
}
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -238,7 +238,7 @@ public class JingleMediaTest extends SmackTestCase {
session.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -257,7 +257,7 @@ public class JingleMediaTest extends SmackTestCase {
x1.disconnect();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -293,7 +293,7 @@ public class JingleMediaTest extends SmackTestCase {
session.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -312,7 +312,7 @@ public class JingleMediaTest extends SmackTestCase {
x1.disconnect();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -355,7 +355,7 @@ public class JingleMediaTest extends SmackTestCase {
session.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -381,7 +381,7 @@ public class JingleMediaTest extends SmackTestCase {
x1.disconnect();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
});
@ -392,7 +392,7 @@ public class JingleMediaTest extends SmackTestCase {
try {
Thread.sleep(250000);
} catch (InterruptedException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -429,7 +429,7 @@ public class JingleMediaTest extends SmackTestCase {
session.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -459,7 +459,7 @@ public class JingleMediaTest extends SmackTestCase {
x1.disconnect();
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -480,7 +480,7 @@ public class JingleMediaTest extends SmackTestCase {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
audioChannel0.stop();
@ -489,10 +489,10 @@ public class JingleMediaTest extends SmackTestCase {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
}
@ -515,7 +515,7 @@ public class JingleMediaTest extends SmackTestCase {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
audioChannel0.stop();
@ -524,11 +524,11 @@ public class JingleMediaTest extends SmackTestCase {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}

View file

@ -106,7 +106,7 @@ public class BridgedResolverTest extends SmackTestCase {
Thread.sleep(1000);
}
catch (InterruptedException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
assertTrue(valCounter() == 1);

View file

@ -175,9 +175,9 @@ public class STUNResolverTest extends SmackTestCase {
System.out.println("C: " + candidate.getAddress().getInetAddress() + "|"
+ candidate.getBase().getAddress().getInetAddress() + " p:" + candidate.getPriority());
} catch (UtilityException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
} catch (UnknownHostException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
Candidate candidate = cc.getSortedCandidates().get(0);
@ -251,7 +251,7 @@ public class STUNResolverTest extends SmackTestCase {
Thread.sleep(55000);
assertTrue(valCounter() > 0);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
@ -353,7 +353,7 @@ public class STUNResolverTest extends SmackTestCase {
});
session1.startIncoming();
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
}
}
});
@ -395,7 +395,7 @@ public class STUNResolverTest extends SmackTestCase {
assertTrue(valCounter() == 2);
} catch (Exception e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
fail("An error occured with Jingle");
}
}

View file

@ -52,7 +52,7 @@ public class TransportResolverTest extends SmackTestCase {
try {
tr.resolve(null);
} catch (XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "exception", e);
fail("Error resolving");
}
}