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



##########
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:
       The current impl relies on the test's life cycle to start a container or 
perform related injections.
   
   Atm the impl contains annotations and extensions for
   
   - `RunWithSingleApplicationComposer`
   - `RunWithApplicationComposer`
   
   as well as a 
   
   - `TomEEEmbeddedExtension`
   
   From my understanding, the proposed `mode` is solely responsible to 
configure how (or when) the underlying container is started? I.e. one container 
to run all tests within a single test class (PER_ALL), one container for each 
test method of one test class (PER_EACH) and one container to run multiple test 
classes (PER_JVM), right?  Is this the same idea, which is currently conducted 
through different JUnit4 runners? 
   
   From my understanding of the current JUnit implementation, the 
`ApplicationComposer` seems to be something similar to the PER_ALL and the 
`EmbeddedTomEERunner` / `SingleApplicationComposer` to the PER_JVM; I think 
PER_EACH (test method) isn't implemented in the JUnit 4 runners yet.
   
   Probably I am missing something but I think, I do not have the whole process 
or related use-cases in mind ;) - Maybe you , @rmannibucau , can add some more 
ideas / thoughts on the `mode` idea? 
   
   EDIT-1: I added some code to draft my idea / thoughts related to `modes`. 
Might be better to understand from the code point of view than from my words, 
if I got the idea correctly: https://github.com/rzo1/tomee/pull/4/files




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