rmannibucau commented on a change in pull request #767: URL: https://github.com/apache/tomee/pull/767#discussion_r590380714
########## File path: container/openejb-core/src/main/java/org/apache/openejb/junit/jupiter/ApplicationComposerExtension.java ########## @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.openejb.junit.jupiter; + +import org.apache.openejb.OpenEJBRuntimeException; +import org.apache.openejb.testing.ApplicationComposers; +import org.junit.jupiter.api.extension.*; + +public class ApplicationComposerExtension implements BeforeEachCallback, AfterEachCallback { Review comment: 1. to inject anything yes but you don't always have to inject. That said point was the opposite: what if you split your test definition in multiple classes? What if you use a dynamic test? I suspect it can be worth a `@ApplicationComposer(mode = [PER_JVM|PER_ALL|PER_EACH])` - note that per_all/per_each are not great but per_class/per_method are not accurate with junit5 so feel free to find a better name, just sharing the concept I have in mind. 2. no getRoot(), ensure to align the scope on the actual one: ` context.getStore(NAMESPACE)` with `private static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace.create(TheExtension.class.getName());` probably 3. right but do not used required accessor but optional one ;) ---------------------------------------------------------------- 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]
