You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/03/01 08:29:39 UTC
[GitHub] [ignite-3] tkalkirill commented on a change in pull request #694: IGNITE-16545 Subscription to revision update in the test configuration framwork
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org