rzo1 commented on a change in pull request #767:
URL: https://github.com/apache/tomee/pull/767#discussion_r590638509



##########
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:
       Thanks for the details! 
   
   > The split of an app composer app in multiple class is actually what you 
use ;). The constructor of ApplicationComposers takes N objects, just pass all 
test classes if you want a single deployment for all tests and enable each test 
to deploy part of the app.
   
   Afaik the extension context only provides the related test class. So it 
would be something like
   
   - Get inner classes from the test class
   - Create instances of these inner test classes
   - Supply the test class as well as the N instances of the inner test classes 
to  `ApplicationComposers` (like it is done in 
`AppComposerAsJUnitRuleWithReusableModulesTest` via JUnit 4 rules)  ?
   
   > About the lifecycle it is not 1-1 with test instance lifecycle but the 
same idea for the container lifecycle (but you can have one test instance per 
test and one container instance for all tests of a single class when you want 
to reset another extension data/field instances for example). We can align on 
the default if nothing is set (so add to the enum an AUTO mode ;)) but must be 
configurable.
   
   Thanks!  I think, I am now getting a better understanding of the idea. I 
also checked the JUnit 5 extension impl of meecrowave, which was really helpful.
   
   
   
   




----------------------------------------------------------------
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]


Reply via email to