|
24 | 24 | import java.util.Objects; |
25 | 25 | import java.util.Optional; |
26 | 26 | import java.util.ServiceLoader; |
27 | | -import java.util.Set; |
28 | 27 | import java.util.concurrent.CompletionException; |
29 | 28 | import java.util.concurrent.CopyOnWriteArrayList; |
30 | 29 | import java.util.concurrent.Executors; |
|
54 | 53 | import org.junit.jupiter.api.extension.BeforeAllCallback; |
55 | 54 | import org.junit.jupiter.api.extension.BeforeEachCallback; |
56 | 55 | import org.junit.jupiter.api.extension.BeforeTestExecutionCallback; |
57 | | -import org.junit.jupiter.api.extension.ConditionEvaluationResult; |
58 | | -import org.junit.jupiter.api.extension.ExecutionCondition; |
59 | 56 | import org.junit.jupiter.api.extension.ExtensionContext; |
60 | 57 | import org.junit.jupiter.api.extension.InvocationInterceptor; |
61 | 58 | import org.junit.jupiter.api.extension.ParameterContext; |
|
105 | 102 | public class QuarkusTestExtension extends AbstractJvmQuarkusTestExtension |
106 | 103 | implements BeforeEachCallback, BeforeTestExecutionCallback, AfterTestExecutionCallback, AfterEachCallback, |
107 | 104 | BeforeAllCallback, InvocationInterceptor, AfterAllCallback, |
108 | | - ParameterResolver, ExecutionCondition { |
| 105 | + ParameterResolver { |
109 | 106 |
|
110 | 107 | private static final Logger log = Logger.getLogger(QuarkusTestExtension.class); |
111 | 108 |
|
@@ -1136,42 +1133,6 @@ private boolean testMethodInvokerHandlesParamType(Object testMethodInvoker, Para |
1136 | 1133 | } |
1137 | 1134 | } |
1138 | 1135 |
|
1139 | | - @Override |
1140 | | - public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { |
1141 | | - if (!context.getTestClass().isPresent()) { |
1142 | | - return ConditionEvaluationResult.enabled("No test class specified"); |
1143 | | - } |
1144 | | - if (context.getTestInstance().isPresent()) { |
1145 | | - return ConditionEvaluationResult.enabled("Quarkus Test Profile tags only affect classes"); |
1146 | | - } |
1147 | | - String tagsStr = System.getProperty("quarkus.test.profile.tags"); |
1148 | | - if ((tagsStr == null) || tagsStr.isEmpty()) { |
1149 | | - return ConditionEvaluationResult.enabled("No Quarkus Test Profile tags"); |
1150 | | - } |
1151 | | - Class<? extends QuarkusTestProfile> testProfile = getQuarkusTestProfile(context); |
1152 | | - if (testProfile == null) { |
1153 | | - return ConditionEvaluationResult.disabled("Test '" + context.getRequiredTestClass() |
1154 | | - + "' is not annotated with '@QuarkusTestProfile' but 'quarkus.profile.test.tags' was set"); |
1155 | | - } |
1156 | | - QuarkusTestProfile profileInstance; |
1157 | | - try { |
1158 | | - profileInstance = testProfile.getConstructor().newInstance(); |
1159 | | - } catch (Exception e) { |
1160 | | - throw new RuntimeException(e); |
1161 | | - } |
1162 | | - Set<String> testProfileTags = profileInstance.tags(); |
1163 | | - String[] tags = tagsStr.split(","); |
1164 | | - for (String tag : tags) { |
1165 | | - String trimmedTag = tag.trim(); |
1166 | | - if (testProfileTags.contains(trimmedTag)) { |
1167 | | - return ConditionEvaluationResult.enabled("Tag '" + trimmedTag + "' is present on '" + testProfile |
1168 | | - + "' which is used on test '" + context.getRequiredTestClass()); |
1169 | | - } |
1170 | | - } |
1171 | | - return ConditionEvaluationResult.disabled("Test '" + context.getRequiredTestClass() |
1172 | | - + "' disabled because 'quarkus.profile.test.tags' don't match the tags of '" + testProfile + "'"); |
1173 | | - } |
1174 | | - |
1175 | 1136 | public static class ExtensionState extends QuarkusTestExtensionState { |
1176 | 1137 |
|
1177 | 1138 | public ExtensionState(Closeable testResourceManager, Closeable resource, Runnable clearCallbacks) { |
|
0 commit comments