tkalkirill commented on a change in pull request #694:
URL: https://github.com/apache/ignite-3/pull/694#discussion_r816546372
##########
File path:
modules/configuration/src/test/java/org/apache/ignite/internal/configuration/testframework/ConfigurationExtension.java
##########
@@ -102,28 +111,42 @@ public void beforeEach(ExtensionContext context) throws
Exception {
ExecutorService pool = context.getStore(NAMESPACE).get(POOL_KEY,
ExecutorService.class);
- for (Field field : getMatchingFields(testInstance.getClass())) {
+ StorageRevisionListenerHolderImpl revisionListenerHolder = new
StorageRevisionListenerHolderImpl();
+
+ context.getStore(NAMESPACE).put(REVISION_LISTENER_HOLDER_KEY,
revisionListenerHolder);
+
+ for (Field field :
getInjectConfigurationFields(testInstance.getClass())) {
field.setAccessible(true);
InjectConfiguration annotation =
field.getAnnotation(InjectConfiguration.class);
- field.set(testInstance, cfgValue(field.getType(), annotation,
cgen, pool));
+ field.set(testInstance, cfgValue(field.getType(), annotation,
cgen, pool, revisionListenerHolder));
+ }
+
+ for (Field field :
getInjectRevisionListenerHolderFields(testInstance.getClass())) {
+ field.setAccessible(true);
+
+ field.set(testInstance, revisionListenerHolder);
}
}
/** {@inheritDoc} */
@Override
public void afterEach(ExtensionContext context) throws Exception {
context.getStore(NAMESPACE).remove(CGEN_KEY);
+ context.getStore(NAMESPACE).remove(REVISION_LISTENER_HOLDER_KEY);
}
/** {@inheritDoc} */
@Override
public boolean supportsParameter(
- ParameterContext parameterContext, ExtensionContext
extensionContext
+ ParameterContext parameterContext,
+ ExtensionContext extensionContext
) throws ParameterResolutionException {
- return parameterContext.isAnnotated(InjectConfiguration.class)
- && supportType(parameterContext.getParameter().getType());
+ Class<?> parametrType = parameterContext.getParameter().getType();
Review comment:
Fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]