mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12: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:
parent
75e35e8db6
commit
328da5a7e2
1 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue