You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2021/02/09 04:29:33 UTC

[james-project] 05/33: [REFACTORING] Get rid of some JUNIT 4 usages in onami tests

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 492641111691ceba89839516a92ac3c031331d9d
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat Feb 6 10:03:01 2021 +0700

    [REFACTORING] Get rid of some JUNIT 4 usages in onami tests
---
 .../apache/james/onami/lifecycle/DefaultStagerTestCase.java    |  9 ++++-----
 .../apache/james/onami/lifecycle/MultiLifeCycleTestCase.java   | 10 +++++-----
 .../org/apache/james/onami/lifecycle/StagingOrderTestCase.java |  8 ++++----
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java b/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java
index ff1b81e..1017dd1 100644
--- a/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java
+++ b/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java
@@ -23,12 +23,11 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.junit.Test;
-
-public class DefaultStagerTestCase {
+import org.junit.jupiter.api.Test;
 
+class DefaultStagerTestCase {
     @Test
-    public void stagerShouldStageObjectsRegisteredWhileStaging() {
+    void stagerShouldStageObjectsRegisteredWhileStaging() {
         final Stager<TestAnnotationA> stager = new DefaultStager<>(TestAnnotationA.class);
         final AtomicBoolean staged = new AtomicBoolean();
         stager.register(stageHandler1 -> stager
@@ -47,7 +46,7 @@ public class DefaultStagerTestCase {
      * 3. the thread blocks on the lock in DefaultStager.register()
      */
     @Test
-    public void stagerShouldNotDeadlockWhileStagingObjectChains() {
+    void stagerShouldNotDeadlockWhileStagingObjectChains() {
         final AtomicBoolean staged = new AtomicBoolean();
         final Stager<TestAnnotationA> stager = new DefaultStager<>(TestAnnotationA.class);
         stager.register(stageHandler1 -> {
diff --git a/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/MultiLifeCycleTestCase.java b/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/MultiLifeCycleTestCase.java
index 5d60a53..93e10fc 100644
--- a/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/MultiLifeCycleTestCase.java
+++ b/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/MultiLifeCycleTestCase.java
@@ -28,16 +28,16 @@ import java.util.List;
 
 import javax.inject.Inject;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
 
-public class MultiLifeCycleTestCase {
+class MultiLifeCycleTestCase {
     @Test
-    public void testOrdering() {
+    void testOrdering() {
         Module lifeCycleModule = new TestLifeCycleModule(asList(TestAnnotationA.class, TestAnnotationB.class, TestAnnotationC.class));
         MultiLifeCycleObject obj = Guice.createInjector(lifeCycleModule).getInstance(MultiLifeCycleObject.class);
         assertThat(obj.toString()).isEqualTo("aaabbbc");
@@ -51,7 +51,7 @@ public class MultiLifeCycleTestCase {
     }
 
     @Test
-    public void testStaging() {
+    void testStaging() {
         Module moduleA = new TestLifeCycleStageModule(new DefaultStager<>(TestAnnotationA.class));
         Module moduleB = new TestLifeCycleStageModule(new DefaultStager<>(TestAnnotationB.class));
         Module moduleC = new TestLifeCycleStageModule(new DefaultStager<>(TestAnnotationC.class));
@@ -72,7 +72,7 @@ public class MultiLifeCycleTestCase {
     }
 
     @Test
-    public void testStagingOrdering() {
+    void testStagingOrdering() {
         Module moduleA = new TestLifeCycleStageModule(new DefaultStager<>(TestAnnotationA.class, DefaultStager.Order.FIRST_IN_FIRST_OUT));
         Module moduleB = new TestLifeCycleStageModule(new DefaultStager<>(TestAnnotationB.class, DefaultStager.Order.FIRST_IN_LAST_OUT));
 
diff --git a/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/StagingOrderTestCase.java b/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/StagingOrderTestCase.java
index dbb6723..b1c66c2 100644
--- a/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/StagingOrderTestCase.java
+++ b/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/StagingOrderTestCase.java
@@ -25,11 +25,11 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class StagingOrderTestCase {
+class StagingOrderTestCase {
     @Test
-    public void testFifo() {
+    void testFifo() {
         List<Integer> order = new ArrayList<>();
         DefaultStager<TestAnnotationA> stager = makeStager(order, DefaultStager.Order.FIRST_IN_FIRST_OUT);
         stager.stage();
@@ -38,7 +38,7 @@ public class StagingOrderTestCase {
     }
 
     @Test
-    public void testFilo() {
+    void testFilo() {
         List<Integer> order = new ArrayList<>();
         DefaultStager<TestAnnotationA> stager = makeStager(order, DefaultStager.Order.FIRST_IN_LAST_OUT);
         stager.stage();


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org