1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

Throw IAE on wrong signature (after|before)Class methods

as otherwhise the reflective invokation will eventually throw an
Exception like

Exception in thread "main" java.lang.NullPointerException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runTests(SmackIntegrationTestFramework.java:412)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.run(SmackIntegrationTestFramework.java:163)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.main(SmackIntegrationTestFramework.java:89)
:smack-integration-test:run FAILED
This commit is contained in:
Florian Schmaus 2015-04-04 17:38:00 +02:00
parent 75e35e8db6
commit 328da5a7e2

View file

@ -334,7 +334,7 @@ public class SmackIntegrationTestFramework {
Set<Method> allBeforeClassMethods = getAllMethods(testClass, withAnnotation(BeforeClass.class));
allBeforeClassMethods.removeAll(beforeClassMethods);
if (!allBeforeClassMethods.isEmpty()) {
LOGGER.warning("@BeforeClass methods with wrong signature found");
throw new IllegalArgumentException("@BeforeClass methods with wrong signature found");
}
if (beforeClassMethods.size() == 1) {
@ -403,7 +403,7 @@ public class SmackIntegrationTestFramework {
Set<Method> allAfterClassMethods = getAllMethods(testClass, withAnnotation(AfterClass.class));
allAfterClassMethods.removeAll(afterClassMethods);
if (!allAfterClassMethods.isEmpty()) {
LOGGER.warning("@AfterClass methods with wrong signature found");
throw new IllegalArgumentException("@AfterClass methods with wrong signature found");
}
if (afterClassMethods.size() == 1) {