Re: TOMEE-2984 Translate to Portuguese: examples/simple-singleton

2021-03-16 Thread Daniel Dias Dos Santos
Hi Alex,

thank you very much for your help, it will be very good :)


Em ter., 16 de mar. de 2021 às 21:38, Alex Rabelo Ferreira <
alexrabeloferreira@gmail.com> escreveu:

> I will help you tomorrow at morning.
>
> Em ter, 16 de mar de 2021 11:07, Daniel Dias Dos Santos <
> daniel.dias.analist...@gmail.com> escreveu:
>
> > Hello,
> >
> > I opened a ticket in Jira [1] and a PR [2], can anyone revise
> > the translation?
> >
> > thank you
> >
> > [1] https://issues.apache.org/jira/browse/TOMEE-2473
> > [2] https://github.com/apache/tomee/pull/775
> >
>


Re: TOMEE-2984 Translate to Portuguese: examples/simple-singleton

2021-03-16 Thread Alex Rabelo Ferreira
I will help you tomorrow at morning.

Em ter, 16 de mar de 2021 11:07, Daniel Dias Dos Santos <
daniel.dias.analist...@gmail.com> escreveu:

> Hello,
>
> I opened a ticket in Jira [1] and a PR [2], can anyone revise
> the translation?
>
> thank you
>
> [1] https://issues.apache.org/jira/browse/TOMEE-2473
> [2] https://github.com/apache/tomee/pull/775
>


[GitHub] [tomee] rzo1 commented on a change in pull request #767: TOMEE-2977 - Provide a ApplicationComposer JUnit 5 Extension

2021-03-16 Thread GitBox


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



##
File path: container/openejb-core/pom.xml
##
@@ -580,6 +580,22 @@
   org.apache.xbean
   xbean-bundleutils
 
+

Review comment:
   I think it would be (a) cleaner and (b) could allow user's to exclude 
the compile dependencies towards junit4  - so +1 for `openejb-junit5`. 
   
   Could also include the classes from `openejb-junit5-backward` (was not 
released yet -> so no problem in renaming / dropping it), so we have all junit 
5 related things in one module. wdyt?





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:
us...@infra.apache.org




[GitHub] [tomee] rzo1 commented on a change in pull request #767: TOMEE-2977 - Provide a ApplicationComposer JUnit 5 Extension

2021-03-16 Thread GitBox


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



##
File path: container/openejb-core/pom.xml
##
@@ -580,6 +580,22 @@
   org.apache.xbean
   xbean-bundleutils
 
+

Review comment:
   I think it would be (a) cleaner and (b) could allow user's to exclude 
the compile dependencies towards junit4  - so +1 for `openejb-junit5`. 
   
   Could also include the classes from `openejb-junit5-backward`, so we have 
all junit 5 related things in one module. wdyt?





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:
us...@infra.apache.org




[GitHub] [tomee] rzo1 commented on a change in pull request #767: TOMEE-2977 - Provide a ApplicationComposer JUnit 5 Extension

2021-03-16 Thread GitBox


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



##
File path: 
tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/junit/jupiter/TomEEEmbeddedExtension.java
##
@@ -0,0 +1,86 @@
+/*
+ * 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.tomee.embedded.junit.jupiter;
+
+import org.apache.openejb.OpenEJBRuntimeException;
+import org.apache.openejb.junit.jupiter.ApplicationComposerExtensionBase;
+import org.apache.tomee.embedded.junit.TomEEEmbeddedBase;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.extension.*;
+
+import java.util.List;
+import java.util.Optional;
+
+public class TomEEEmbeddedExtension extends ApplicationComposerExtensionBase 
implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback, 
AfterEachCallback {

Review comment:
   Good catch. `ApplicationComposerExtensionBase` isn't needed nor is it 
used. 





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:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos merged pull request #775: TOMEE-2984 Translate to Portuguese: examples/simple-singleton

2021-03-16 Thread GitBox


Daniel-Dos merged pull request #775:
URL: https://github.com/apache/tomee/pull/775


   



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:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on pull request #775: TOMEE-2984 Translate to Portuguese: examples/simple-singleton

2021-03-16 Thread GitBox


Daniel-Dos commented on pull request #775:
URL: https://github.com/apache/tomee/pull/775#issuecomment-800438231


   thanks @jrxxjr  for review : )



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:
us...@infra.apache.org




[GitHub] [tomee] rmannibucau commented on a change in pull request #767: TOMEE-2977 - Provide a ApplicationComposer JUnit 5 Extension

2021-03-16 Thread GitBox


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



##
File path: 
container/openejb-core/src/main/java/org/apache/openejb/junit/jupiter/ApplicationComposerExtension.java
##
@@ -0,0 +1,155 @@
+/*
+ * 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.apache.openejb.testing.SingleApplicationComposerBase;
+import org.junit.jupiter.api.extension.*;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+public class ApplicationComposerExtension extends 
ApplicationComposerExtensionBase implements BeforeAllCallback, 
AfterAllCallback, BeforeEachCallback, AfterEachCallback {
+
+private static final ExtensionContext.Namespace NAMESPACE = 
ExtensionContext.Namespace.create(ApplicationComposerExtension.class.getName());
+private static final SingleApplicationComposerBase BASE = new 
SingleApplicationComposerBase();
+
+@Override
+public void beforeAll(ExtensionContext context) throws Exception {
+
+if (isPerJvm(context)) {

Review comment:
   If you have per jvm and per test/class at the same time what happens? 
Options I see:
   
   1. test if per jvm is started and fail perall/pereach cases
   2. make it work (we did in meecrowave, it is mainly a matter of having a JVM 
singleton/lock to switch the tccl for the bootstrap time + a few singleton 
fixes)
   
   I'd start with 1 keeping 2 in mind (since it requires more work) so 
something like 'if !JVM && BASE.isStarted() => fail', isStarted is just matter 
of testing one of the atomic ref of the single instance.

##
File path: 
container/openejb-core/src/main/java/org/apache/openejb/junit/jupiter/ApplicationComposerExtension.java
##
@@ -0,0 +1,155 @@
+/*
+ * 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.apache.openejb.testing.SingleApplicationComposerBase;
+import org.junit.jupiter.api.extension.*;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+public class ApplicationComposerExtension extends 
ApplicationComposerExtensionBase implements BeforeAllCallback, 
AfterAllCallback, BeforeEachCallback, AfterEachCallback {
+
+private static final ExtensionContext.Namespace NAMESPACE = 
ExtensionContext.Namespace.create(ApplicationComposerExtension.class.getName());
+private static final SingleApplicationComposerBase BASE = new 
SingleApplicationComposerBase();
+
+@Override
+public void beforeAll(ExtensionContext context) throws Exception {
+
+if (isPerJvm(context)) {
+BASE.start(context.getTestClass().orElse(null));
+} else if (isPerAll(context)) {
+doStart(context);
+} else if (isPerDefault(context)) {
+if (isPerClass(context)) {
+doStart(context);
+}
+}
+
+if (isPerClass(context)) {
+doInject(context);
+}
+}
+
+@Override
+public void afterAll(ExtensionContext context) throws Exception {
+if (isPerJvm(context) || isPerAll(context)) {
+d

[GitHub] [tomee] jrxxjr commented on pull request #775: TOMEE-2984 Translate to Portuguese: examples/simple-singleton

2021-03-16 Thread GitBox


jrxxjr commented on pull request #775:
URL: https://github.com/apache/tomee/pull/775#issuecomment-800389920


   The translation is ok



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:
us...@infra.apache.org




[GitHub] [tomee] rzo1 commented on a change in pull request #767: TOMEE-2977 - Provide a ApplicationComposer JUnit 5 Extension

2021-03-16 Thread GitBox


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



##
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:
   Thx. Changed it.





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:
us...@infra.apache.org




[GitHub] [tomee] rmannibucau commented on a change in pull request #767: TOMEE-2977 - Provide a ApplicationComposer JUnit 5 Extension

2021-03-16 Thread GitBox


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:
us...@infra.apache.org




[GitHub] [tomee] rzo1 commented on a change in pull request #767: TOMEE-2977 - Provide a ApplicationComposer JUnit 5 Extension

2021-03-16 Thread GitBox


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, so I added the related commits here.





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:
us...@infra.apache.org




TOMEE-2984 Translate to Portuguese: examples/simple-singleton

2021-03-16 Thread Daniel Dias Dos Santos
Hello,

I opened a ticket in Jira [1] and a PR [2], can anyone revise
the translation?

thank you

[1] https://issues.apache.org/jira/browse/TOMEE-2473
[2] https://github.com/apache/tomee/pull/775


[GitHub] [tomee] Daniel-Dos opened a new pull request #775: TOMEE-2984 Translate to Portuguese: examples/simple-singleton

2021-03-16 Thread GitBox


Daniel-Dos opened a new pull request #775:
URL: https://github.com/apache/tomee/pull/775


   - Translate to Portuguese
   - fix in format code Java in Spanish
   
   link to jira: https://issues.apache.org/jira/browse/TOMEE-2473



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:
us...@infra.apache.org