rmannibucau commented on a change in pull request #767:
URL: https://github.com/apache/tomee/pull/767#discussion_r595289263
##########
File path:
container/openejb-core/src/main/java/org/apache/openejb/junit/jupiter/ApplicationComposerExtensionBase.java
##########
@@ -26,4 +27,36 @@ boolean isPerClass(final ExtensionContext context) {
.map(it -> it.equals(TestInstance.Lifecycle.PER_CLASS))
.orElse(false);
}
+
+ boolean isPerEach(final ExtensionContext context) {
+ return checkMode(context, ExtensionMode.PER_EACH);
+ }
+
+ boolean isPerAll(final ExtensionContext context) {
+ return checkMode(context, ExtensionMode.PER_ALL);
+ }
+
+ boolean isPerJvm(final ExtensionContext context) {
+ return checkMode(context, ExtensionMode.PER_JVM);
+ }
+
+ boolean isPerDefault(final ExtensionContext context) {
+ return checkMode(context, ExtensionMode.AUTO);
+ }
+
+ boolean checkMode(final ExtensionContext context, ExtensionMode
extensionMode ) {
+ return extensionMode == getModeFromAnnotation(context);
+ }
+
+ ExtensionMode getModeFromAnnotation(final ExtensionContext context) {
+ if (context.getTestClass().isPresent()) {
+
+ RunWithApplicationComposer a =
context.getTestClass().get().getAnnotation(RunWithApplicationComposer.class);
Review comment:
AnnotationUtils.findAnnotation ;) (will support junit5 stereotypes
otherwise you loose it by pure reflection)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]