james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [02/11] james-project git commit: JAMES-1746 Remplace JMock uses by mockito
Date Wed, 08 Jun 2016 11:36:00 GMT
JAMES-1746 Remplace JMock uses by mockito

JMock versions used clashed with junit-contracts


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/b555ae80
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/b555ae80
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/b555ae80

Branch: refs/heads/master
Commit: b555ae809ab8e9d3618739162b6b3f4702a187cb
Parents: 9068b59
Author: Benoit Tellier <btellier@linagora.com>
Authored: Mon Jun 6 16:59:38 2016 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Wed Jun 8 17:09:04 2016 +0700

----------------------------------------------------------------------
 mailbox/api/pom.xml                                | 10 ----------
 mailbox/caching/pom.xml                            | 10 ----------
 mailbox/pom.xml                                    | 13 +++----------
 mailbox/store/pom.xml                              | 10 ----------
 .../mailbox/store/MailboxEventDispatcherTest.java  | 17 +++++------------
 5 files changed, 8 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b555ae80/mailbox/api/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/api/pom.xml b/mailbox/api/pom.xml
index c8a2d9e..c892d7e 100644
--- a/mailbox/api/pom.xml
+++ b/mailbox/api/pom.xml
@@ -55,16 +55,6 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jmock</groupId>
-            <artifactId>jmock</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.jmock</groupId>
-            <artifactId>jmock-junit4</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
             <version>${assertj-1.version}</version>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b555ae80/mailbox/caching/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/caching/pom.xml b/mailbox/caching/pom.xml
index cd2f90d..01501b1 100644
--- a/mailbox/caching/pom.xml
+++ b/mailbox/caching/pom.xml
@@ -58,15 +58,5 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.jmock</groupId>
-            <artifactId>jmock</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.jmock</groupId>
-            <artifactId>jmock-junit4</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b555ae80/mailbox/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/pom.xml b/mailbox/pom.xml
index e7f50df..3dbefd9 100644
--- a/mailbox/pom.xml
+++ b/mailbox/pom.xml
@@ -415,16 +415,9 @@
                 <scope>test</scope>
             </dependency>
             <dependency>
-                <groupId>org.jmock</groupId>
-                <artifactId>jmock</artifactId>
-                <version>${jmock.version}</version>
-                <scope>test</scope>
-            </dependency>
-            <dependency>
-                <groupId>org.jmock</groupId>
-                <artifactId>jmock-junit4</artifactId>
-                <version>${jmock.version}</version>
-                <scope>test</scope>
+                <groupId>org.xenei</groupId>
+                <artifactId>junit-contracts</artifactId>
+                <version>0.1.5</version>
             </dependency>
             <dependency>
                 <groupId>org.mockito</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b555ae80/mailbox/store/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/store/pom.xml b/mailbox/store/pom.xml
index 720cd60..3add150 100644
--- a/mailbox/store/pom.xml
+++ b/mailbox/store/pom.xml
@@ -108,16 +108,6 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jmock</groupId>
-            <artifactId>jmock</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.jmock</groupId>
-            <artifactId>jmock-junit4</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b555ae80/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
index d34c3b2..df99cd1 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherTest.java
@@ -19,6 +19,9 @@
 
 package org.apache.james.mailbox.store;
 
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -39,15 +42,9 @@ import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.util.EventCollector;
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
 
-@RunWith(JMock.class)
 public class MailboxEventDispatcherTest {
 
     MailboxEventDispatcher dispatcher;
@@ -66,8 +63,6 @@ public class MailboxEventDispatcherTest {
         
     };
 
-    private  Mockery mockery = new JUnit4Mockery();
-
     private Mailbox mailbox = new Mailbox() {
 
         @Override
@@ -124,10 +119,8 @@ public class MailboxEventDispatcherTest {
         collector = new EventCollector();
 
         dispatcher = new MailboxEventDispatcher(collector);
-        result = mockery.mock(MessageResult.class);
-        mockery.checking(new Expectations() {{
-            allowing(result).getUid();will(returnValue(23L));
-        }});
+        result = mock(MessageResult.class);
+        when(result.getUid()).thenReturn(23L);
     }
 
 


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


Mime
View raw message