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

[sinttest] Properly handle AbstractSmackSpecificLowLevelIntegrationTest

Subclasses of AbstractSmackSpecificLowLevelIntegrationTest have test
methods with no parameters. This was, after the refactoring in
c5bb15c631 ("[sinttest] Add UnconnectedConnectionSource for
low-level tests") not handled properly.

Fixes: c5bb15c631 ("[sinttest] Add UnconnectedConnectionSource for low-level tests")
This commit is contained in:
Florian Schmaus 2023-03-17 20:26:29 +01:00
parent 6d2216858c
commit 24782558d6

View file

@ -889,6 +889,9 @@ public class SmackIntegrationTestFramework {
};
testMethod.invoke(test, source);
break;
case noParamSpecificLowLevel:
testMethod.invoke(test);
break;
}
}
@ -919,6 +922,11 @@ public class SmackIntegrationTestFramework {
* testMethod(UnconnectedConnectionSource unconnectedConnectionSource)
*/
unconnectedConnectionSource,
/**
* A no-parameter method of a {@link AbstractSmackSpecificLowLevelIntegrationTest}.
*/
noParamSpecificLowLevel,
};
static TestMethodParameterType determineTestMethodParameterType(Method testMethod) {
@ -928,6 +936,9 @@ public class SmackIntegrationTestFramework {
static TestMethodParameterType determineTestMethodParameterType(Method testMethod, Class<? extends AbstractXMPPConnection> connectionClass) {
Class<?>[] parameterTypes = testMethod.getParameterTypes();
if (parameterTypes.length == 0) {
if (AbstractSmackSpecificLowLevelIntegrationTest.class.isAssignableFrom(testMethod.getDeclaringClass())) {
return TestMethodParameterType.noParamSpecificLowLevel;
}
return null;
}