james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [21/21] james-project git commit: JAMES-1902 get rid of JmapJamesServer & GuiceJamesServerImpl
Date Tue, 14 Mar 2017 11:15:02 GMT
JAMES-1902 get rid of JmapJamesServer & GuiceJamesServerImpl


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

Branch: refs/heads/master
Commit: ac56c42221359c83c904021d12e83b2cadb79339
Parents: ddda1d7
Author: Antoine Duprat <aduprat@linagora.com>
Authored: Fri Jan 27 11:42:13 2017 +0100
Committer: benwa <btellier@linagora.com>
Committed: Tue Mar 14 18:13:55 2017 +0700

----------------------------------------------------------------------
 .../smtp/host/CassandraJamesSmtpHostSystem.java |  9 +-
 .../apache/james/CassandraJamesServerMain.java  |  2 +-
 .../apache/james/CassandraJamesServerTest.java  |  2 +-
 .../org/apache/james/CassandraJmapTestRule.java |  4 +-
 .../james/CassandraLogConfigurationTest.java    | 19 +++--
 .../CassandraMessageIdManagerInjectionTest.java |  2 +-
 .../org/apache/james/CassandraNodeConfTest.java |  2 +-
 .../java/org/apache/james/ESReporterTest.java   |  9 +-
 .../james/JamesCapabilitiesServerTest.java      |  6 +-
 .../james/CassandraLdapJamesServerMain.java     |  2 +-
 .../james/CassandraLdapJamesServerTest.java     |  2 +-
 .../apache/james/CassandraLdapJmapTestRule.java |  4 +-
 .../java/org/apache/james/GuiceJamesServer.java | 63 +++++++++++++-
 .../org/apache/james/GuiceJamesServerImpl.java  | 86 --------------------
 .../java/org/apache/james/JmapJamesServer.java  | 64 ---------------
 .../apache/james/AbstractJamesServerTest.java   |  4 +-
 .../james/AbstractJmapJamesServerTest.java      |  8 +-
 .../org/apache/james/JPAJamesServerMain.java    |  2 +-
 .../org/apache/james/JPAJamesServerTest.java    |  4 +-
 .../james/JamesCapabilitiesServerTest.java      |  2 +-
 server/container/guice/memory-guice/pom.xml     |  9 +-
 .../org/apache/james/MemoryJamesServerMain.java |  4 +-
 .../org/apache/james/MemoryJamesServerTest.java |  2 +-
 .../org/apache/james/MemoryJmapTestRule.java    |  4 +-
 server/mailet/integration-testing/pom.xml       |  6 ++
 .../james/mailets/TemporaryJamesServer.java     |  6 +-
 server/pom.xml                                  | 11 +++
 .../CassandraGetMailboxesMethodTest.java        |  4 +-
 .../CassandraGetMessageListMethodTest.java      |  4 +-
 .../CassandraGetVacationResponseTest.java       |  4 +-
 .../CassandraJmapAuthenticationTest.java        |  4 +-
 .../CassandraSetMailboxesMethodTest.java        |  4 +-
 .../CassandraSetMessagesMethodTest.java         |  4 +-
 .../CassandraSetVacationResponseTest.java       |  4 +-
 ...ssandraUserProvisionningConcurrencyTest.java |  4 +-
 .../CassandraVacationIntegrationTest.java       |  4 +-
 .../cassandra/cucumber/CassandraStepdefs.java   |  4 +-
 .../james/jmap/JMAPAuthenticationTest.java      | 10 +--
 .../jmap/UserProvisionningConcurrencyTest.java  | 13 ++-
 .../james/jmap/VacationIntegrationTest.java     | 10 +--
 .../integration/GetMailboxesMethodTest.java     | 12 +--
 .../integration/GetMessageListMethodTest.java   | 14 ++--
 .../integration/GetVacationResponseTest.java    | 10 +--
 .../integration/SetMailboxesMethodTest.java     | 12 +--
 .../integration/SetMessagesMethodTest.java      | 14 ++--
 .../integration/SetVacationResponseTest.java    | 10 +--
 .../cucumber/GetMessagesMethodStepdefs.java     |  3 +-
 .../integration/cucumber/MainStepdefs.java      |  8 +-
 .../memory-jmap-integration-testing/pom.xml     |  6 ++
 .../memory/MemoryGetMailboxesMethodTest.java    |  4 +-
 .../memory/MemoryGetMessageListMethodTest.java  |  4 +-
 .../MemoryGetVacationResponseMethodTest.java    |  4 +-
 .../memory/MemoryJmapAuthenticationTest.java    |  4 +-
 .../memory/MemorySetMailboxesMethodTest.java    |  4 +-
 .../memory/MemorySetMessagesMethodTest.java     |  4 +-
 .../MemorySetVacationResponseMethodTest.java    |  4 +-
 .../MemoryUserProvisionningConcurrencyTest.java |  4 +-
 .../memory/MemoryVacationIntegrationTest.java   |  4 +-
 .../jmap/memory/cucumber/MemoryStepdefs.java    |  4 +-
 .../WebAdminServerIntegrationTest.java          |  7 +-
 60 files changed, 243 insertions(+), 304 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java b/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
index d59a9ef..65311c3 100644
--- a/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
+++ b/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
@@ -22,7 +22,7 @@ package org.apache.james.mpt.smtp.host;
 import java.util.Iterator;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServerImpl;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.backends.es.EmbeddedElasticSearch;
 import org.apache.james.dnsservice.api.DNSService;
@@ -45,7 +45,7 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
     private EmbeddedCassandra embeddedCassandra;
     private EmbeddedElasticSearch embeddedElasticSearch;
 
-    private GuiceJamesServerImpl jamesServer;
+    private GuiceJamesServer jamesServer;
     private InMemoryDNSService inMemoryDNSService;
 
 
@@ -106,9 +106,8 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
     public InMemoryDNSService getInMemoryDnsService() {
         return inMemoryDNSService;
     }
-
-    protected GuiceJamesServerImpl createJamesServer() {
-        return new GuiceJamesServerImpl()
+    protected GuiceJamesServer createJamesServer() {
+        return new GuiceJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule, new SMTPServerModule(), new ProtocolHandlerModule())
             .overrideWith(new CassandraJmapServerModule(folder::getRoot, embeddedElasticSearch, embeddedCassandra),
                 (binder) -> binder.bind(DNSService.class).toInstance(inMemoryDNSService));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
index 24705a7..fc2384d 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
@@ -70,7 +70,7 @@ public class CassandraJamesServerMain {
 
 
     public static void main(String[] args) throws Exception {
-        GuiceJamesServerImpl server = new GuiceJamesServerImpl()
+        GuiceJamesServer server = new GuiceJamesServer()
                     .combineWith(cassandraServerModule, protocols, new JMXServerModule());
         server.start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
index 579e30c..b15491e 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -27,7 +27,7 @@ public class CassandraJamesServerTest extends AbstractJmapJamesServerTest {
     public CassandraJmapTestRule cassandraJmap = CassandraJmapTestRule.defaultTestRule();
 
     @Override
-    protected JmapJamesServer createJamesServer() {
+    protected GuiceJamesServer createJamesServer() {
         return cassandraJmap.jmapServer();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
index d3588eb..8289b3c 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
@@ -45,8 +45,8 @@ public class CassandraJmapTestRule implements TestRule {
                     .aggregate(new TempFilesystemTestRule());
     }
 
-    public JmapJamesServer jmapServer(Module... additionals) {
-        return new JmapJamesServer()
+    public GuiceJamesServer jmapServer(Module... additionals) {
+        return new GuiceJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule, CassandraJamesServerMain.protocols)
             .overrideWith(new TestJMAPServerModule(LIMIT_TO_3_MESSAGES))
             .overrideWith(new TestESMetricReporterModule())

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraLogConfigurationTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraLogConfigurationTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraLogConfigurationTest.java
index 5d7f156..659453e 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraLogConfigurationTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraLogConfigurationTest.java
@@ -18,7 +18,14 @@
  ****************************************************************/
 package org.apache.james;
 
-import com.google.inject.ProvisionException;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
+
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.james.modules.mailbox.CassandraSessionConfiguration;
 import org.junit.After;
@@ -27,13 +34,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.SocketChannel;
-import java.nio.charset.Charset;
-
-import static org.assertj.core.api.Assertions.assertThat;
+import com.google.inject.ProvisionException;
 
 public class CassandraLogConfigurationTest {
 
@@ -48,7 +49,7 @@ public class CassandraLogConfigurationTest {
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
-    private GuiceJamesServerImpl jamesServer;
+    private GuiceJamesServer jamesServer;
     private SocketChannel socketChannel;
 
     @Before

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java
index b5e9dc2..e8395cb 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java
@@ -42,7 +42,7 @@ public class CassandraMessageIdManagerInjectionTest {
 
     @Rule
     public CassandraJmapTestRule cassandraJmap = CassandraJmapTestRule.defaultTestRule();
-    private JmapJamesServer server;
+    private GuiceJamesServer server;
 
     @Before
     public void test() throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraNodeConfTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraNodeConfTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraNodeConfTest.java
index 180aea6..9bc6de5 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraNodeConfTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraNodeConfTest.java
@@ -48,7 +48,7 @@ public class CassandraNodeConfTest {
     public CassandraJmapTestRule cassandraJmapTestRule = new CassandraJmapTestRule(dockerCassandraRule,
             new EmbeddedElasticSearchRule());
 
-    private GuiceJamesServerImpl jamesServer;
+    private GuiceJamesServer jamesServer;
     private SocketChannel socketChannel;
 
     @Before

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-guice/src/test/java/org/apache/james/ESReporterTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/ESReporterTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/ESReporterTest.java
index ef33b42..238a934 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/ESReporterTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/ESReporterTest.java
@@ -36,6 +36,7 @@ import org.apache.james.jmap.HttpJmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.modules.TestESMetricReporterModule;
 import org.apache.james.utils.GuiceServerProbe;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.elasticsearch.client.Client;
 import org.elasticsearch.index.query.QueryBuilders;
 import org.junit.After;
@@ -67,14 +68,14 @@ public class ESReporterTest {
     @Rule
     public CassandraJmapTestRule cassandraJmap = new CassandraJmapTestRule(embeddedElasticSearchRule, new EmbeddedCassandraRule());
 
-    private JmapJamesServer server;
+    private GuiceJamesServer server;
     private AccessToken accessToken;
 
     @Before
     public void setup() throws Exception {
         server = cassandraJmap.jmapServer();
         server.start();
-        GuiceServerProbe serverProbe = server.getGuiceProbeProvider().getProbe(GuiceServerProbe.class);
+        GuiceServerProbe serverProbe = server.getProbe(GuiceServerProbe.class);
         serverProbe.addDomain(DOMAIN);
         serverProbe.addUser(USERNAME, PASSWORD);
 
@@ -82,7 +83,7 @@ public class ESReporterTest {
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
                 .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                .setPort(server.getJmapProbe().getJmapPort())
+                .setPort(server.getProbe(JmapGuiceProbe.class).getJmapPort())
                 .build();
         accessToken = HttpJmapAuthentication.authenticateJamesUser(baseUri(), USERNAME, PASSWORD);
 
@@ -93,7 +94,7 @@ public class ESReporterTest {
         return new URIBuilder()
             .setScheme("http")
             .setHost("localhost")
-            .setPort(server.getJmapProbe().getJmapPort())
+            .setPort(server.getProbe(JmapGuiceProbe.class).getJmapPort())
             .setCharset(Charsets.UTF_8);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
index 69c20f3..3dbce73 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
@@ -49,7 +49,7 @@ import com.google.inject.Singleton;
 
 public class JamesCapabilitiesServerTest {
 
-    private GuiceJamesServerImpl server;
+    private GuiceJamesServer server;
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder, MailboxElasticsearchConstants.MAILBOX_INDEX);
 
@@ -61,10 +61,10 @@ public class JamesCapabilitiesServerTest {
         server.stop();
     }
     
-    private GuiceJamesServerImpl createCassandraJamesServer(final MailboxManager mailboxManager) {
+    private GuiceJamesServer createCassandraJamesServer(final MailboxManager mailboxManager) {
         Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
         
-        return new GuiceJamesServerImpl()
+        return new GuiceJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule, CassandraJamesServerMain.protocols)
             .overrideWith((binder) -> binder.bind(PersistenceAdapter.class).to(MemoryPersistenceAdapter.class))
             .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java b/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
index f2fe651..746abec 100644
--- a/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
+++ b/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
@@ -31,7 +31,7 @@ public class CassandraLdapJamesServerMain {
         .with(new LdapUsersRepositoryModule());
 
     public static void main(String[] args) throws Exception {
-        GuiceJamesServerImpl server = new GuiceJamesServerImpl()
+        GuiceJamesServer server = new GuiceJamesServer()
             .combineWith(cassandraLdapServerModule, new JMXServerModule());
 
         server.start();

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
index 0e93c50..de2ac6c 100644
--- a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
+++ b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
@@ -48,7 +48,7 @@ public class CassandraLdapJamesServerTest extends AbstractJmapJamesServerTest {
     public RuleChain ruleChain = RuleChain.outerRule(ldapContainer).around(cassandraLdapJmap);
 
     @Override
-    protected JmapJamesServer createJamesServer() {
+    protected GuiceJamesServer createJamesServer() {
         ldapContainer.start();
         return cassandraLdapJmap.jmapServer(ldapContainer.getLdapHost());
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapTestRule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapTestRule.java b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapTestRule.java
index a571818..aa6233d 100644
--- a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapTestRule.java
+++ b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapTestRule.java
@@ -51,8 +51,8 @@ public class CassandraLdapJmapTestRule implements TestRule {
                 .aggregate(new TempFilesystemTestRule());
     }
 
-    public JmapJamesServer jmapServer(String ldapIp, Module... additionals) {
-        return new JmapJamesServer()
+    public GuiceJamesServer jmapServer(String ldapIp, Module... additionals) {
+        return new GuiceJamesServer()
             .combineWith(CassandraLdapJamesServerMain.cassandraLdapServerModule,
                 binder -> binder.bind(String.class).annotatedWith(Names.named("ldapIp")).toInstance(ldapIp))
             .overrideWith(new TestJMAPServerModule(LIMIT_TO_3_MESSAGES))

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
index d77521b..20e4318 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -18,13 +18,68 @@
  ****************************************************************/
 package org.apache.james;
 
+import java.util.Arrays;
+
+import javax.annotation.PreDestroy;
+
+import org.apache.james.modules.CommonServicesModule;
+import org.apache.james.modules.MailetProcessingModule;
+import org.apache.james.onami.lifecycle.Stager;
+import org.apache.james.utils.ConfigurationsPerformer;
+import org.apache.james.utils.GuiceProbe;
+import org.apache.james.utils.GuiceProbeProvider;
 import org.apache.james.utils.GuiceServerProbe;
 
-public interface GuiceJamesServer {
+import com.google.common.collect.Iterables;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.Module;
+import com.google.inject.TypeLiteral;
+import com.google.inject.util.Modules;
+
+public class GuiceJamesServer {
+
+    protected final Module module;
+    private Stager<PreDestroy> preDestroy;
+    private GuiceProbeProvider guiceProbeProvider;
+
+    public GuiceJamesServer() {
+        this(Modules.combine(
+                        new CommonServicesModule(),
+                        new MailetProcessingModule()));
+    }
+
+    protected GuiceJamesServer(Module module) {
+        this.module = module;
+    }
+    
+    public GuiceJamesServer combineWith(Module... modules) {
+        return new GuiceJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
+    }
+
+    public GuiceJamesServer overrideWith(Module... overrides) {
+        return new GuiceJamesServer(Modules.override(module).with(overrides));
+    }
+
+    public void start() throws Exception {
+        Injector injector = Guice.createInjector(module);
+        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
+        injector.getInstance(ConfigurationsPerformer.class).initModules();
+        guiceProbeProvider = injector.getInstance(GuiceProbeProvider.class);
+    }
 
-    void start() throws Exception;
+    public void stop() {
+        if (preDestroy != null) {
+            preDestroy.stage();
+        }
+    }
 
-    void stop();
+    public GuiceServerProbe serverProbe() {
+        return guiceProbeProvider.getProbe(GuiceServerProbe.class);
+    }
 
-    GuiceServerProbe serverProbe();
+    public <T extends GuiceProbe> T getProbe(Class<T> probe) {
+        return guiceProbeProvider.getProbe(probe);
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
deleted file mode 100644
index 63d184d..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************
- * 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.james;
-
-import java.util.Arrays;
-
-import javax.annotation.PreDestroy;
-
-import org.apache.james.modules.CommonServicesModule;
-import org.apache.james.modules.MailetProcessingModule;
-import org.apache.james.onami.lifecycle.Stager;
-import org.apache.james.utils.ConfigurationsPerformer;
-import org.apache.james.utils.GuiceProbeProvider;
-import org.apache.james.utils.GuiceServerProbe;
-
-import com.google.common.collect.Iterables;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.Module;
-import com.google.inject.TypeLiteral;
-import com.google.inject.util.Modules;
-
-public class GuiceJamesServerImpl implements GuiceJamesServer {
-    protected final Module module;
-    private Stager<PreDestroy> preDestroy;
-    private GuiceProbeProvider guiceProbeProvider;
-
-    public GuiceJamesServerImpl() {
-        this(Modules.combine(
-                        new CommonServicesModule(),
-                        new MailetProcessingModule()));
-    }
-
-    protected GuiceJamesServerImpl(Module module) {
-        this.module = module;
-    }
-    
-    public GuiceJamesServerImpl combineWith(Module... modules) {
-        return new GuiceJamesServerImpl(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
-    }
-
-    public GuiceJamesServerImpl overrideWith(Module... overrides) {
-        return new GuiceJamesServerImpl(Modules.override(module).with(overrides));
-    }
-
-    @Override
-    public void start() throws Exception {
-        Injector injector = Guice.createInjector(module);
-        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
-        injector.getInstance(ConfigurationsPerformer.class).initModules();
-        guiceProbeProvider = injector.getInstance(GuiceProbeProvider.class);
-    }
-
-    @Override
-    public void stop() {
-        if (preDestroy != null) {
-            preDestroy.stage();
-        }
-    }
-
-    @Override
-    public GuiceServerProbe serverProbe() {
-        return guiceProbeProvider.getProbe(GuiceServerProbe.class);
-    }
-
-    protected GuiceProbeProvider getGuiceProbeProvider() {
-        return guiceProbeProvider;
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/guice-common/src/main/java/org/apache/james/JmapJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/JmapJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/JmapJamesServer.java
deleted file mode 100644
index 46122a8..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/JmapJamesServer.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************
- * 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.james;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.apache.james.utils.JmapGuiceProbe;
-import org.apache.james.utils.WebAdminGuiceProbe;
-
-import com.google.common.collect.Iterables;
-import com.google.inject.Module;
-import com.google.inject.util.Modules;
-
-public class JmapJamesServer extends GuiceJamesServerImpl implements GuiceJamesServer, JmapServer, WebAdminServer {
-
-    public JmapJamesServer() {
-        super();
-    }
-
-    private JmapJamesServer(Module module) {
-        super(module);
-    }
-
-    public JmapJamesServer combineWith(Module... modules) {
-        return new JmapJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
-    }
-
-    public JmapJamesServer overrideWith(Module... overrides) {
-        return overrideWith(Arrays.asList(overrides));
-    }
-
-    public JmapJamesServer overrideWith(Collection<Module> overrides) {
-        return new JmapJamesServer(Modules.override(module).with(overrides));
-    }
-
-    @Override
-    public JmapGuiceProbe getJmapProbe() {
-        return getGuiceProbeProvider().getProbe(JmapGuiceProbe.class);
-    }
-
-    @Override
-    public WebAdminGuiceProbe getWebAdminProbe() {
-        return getGuiceProbeProvider().getProbe(WebAdminGuiceProbe.class);
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
index 58039ea..fa85594 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
@@ -39,7 +39,7 @@ public abstract class AbstractJamesServerTest {
     private static final int SMTP_PORT = 1025;
     private static final int LMTP_PORT = 1024;
 
-    private GuiceJamesServerImpl server;
+    private GuiceJamesServer server;
     private SocketChannel socketChannel;
 
     @Before
@@ -49,7 +49,7 @@ public abstract class AbstractJamesServerTest {
         server.start();
     }
 
-    protected abstract GuiceJamesServerImpl createJamesServer();
+    protected abstract GuiceJamesServer createJamesServer();
 
     protected abstract void clean();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
index aff297f..de03298 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
@@ -30,6 +30,7 @@ import java.nio.ByteBuffer;
 import java.nio.channels.SocketChannel;
 import java.nio.charset.Charset;
 
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -49,7 +50,7 @@ public abstract class AbstractJmapJamesServerTest {
     protected static final String JAMES_SERVER_HOST = "127.0.0.1";
     protected static final int IMAP_PORT = 1143; // You need to be root (superuser) to bind to ports under 1024.
 
-    private JmapJamesServer server;
+    private GuiceJamesServer server;
     private SocketChannel socketChannel;
 
     @Before
@@ -62,12 +63,11 @@ public abstract class AbstractJmapJamesServerTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(server.getJmapProbe()
-                    .getJmapPort())
+        		.setPort(server.getProbe(JmapGuiceProbe.class).getJmapPort())
         		.build();
     }
 
-    protected abstract JmapJamesServer createJamesServer();
+    protected abstract GuiceJamesServer createJamesServer();
 
     protected abstract void clean();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
index ac99765..4cec352 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -58,7 +58,7 @@ public class JPAJamesServerMain {
         new RawPostDequeueDecoratorModule());
 
     public static void main(String[] args) throws Exception {
-        GuiceJamesServerImpl server = new GuiceJamesServerImpl()
+        GuiceJamesServer server = new GuiceJamesServer()
                     .combineWith(jpaServerModule, protocols, 
                             new JMXServerModule(), 
                             new LuceneSearchMailboxModule());

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
index 8ab4ad6..0684be1 100644
--- a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
@@ -29,8 +29,8 @@ public class JPAJamesServerTest extends AbstractJamesServerTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServerImpl createJamesServer() {
-        return new GuiceJamesServerImpl()
+    protected GuiceJamesServer createJamesServer() {
+        return new GuiceJamesServer()
             .combineWith(JPAJamesServerMain.jpaServerModule)
             .overrideWith(new TestFilesystemModule(temporaryFolder),
                     new TestJPAConfigurationModule());

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
index ad2a17c..82e728a 100644
--- a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
@@ -49,7 +49,7 @@ public class JamesCapabilitiesServerTest {
     private GuiceJamesServer createJPAJamesServer(final MailboxManager mailboxManager) {
         Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
         
-        return new GuiceJamesServerImpl()
+        return new GuiceJamesServer()
             .combineWith(JPAJamesServerMain.jpaServerModule)
             .overrideWith(
                 new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/memory-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/pom.xml b/server/container/guice/memory-guice/pom.xml
index 79ac0f4..8173aca 100644
--- a/server/container/guice/memory-guice/pom.xml
+++ b/server/container/guice/memory-guice/pom.xml
@@ -213,7 +213,14 @@
                     <artifactId>james-server-guice-common</artifactId>
                     <type>test-jar</type>
                     <scope>test</scope>
-                </dependency><dependency>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>james-server-guice-jmap</artifactId>
+                    <type>test-jar</type>
+                    <scope>test</scope>
+                </dependency>
+                <dependency>
                     <groupId>${project.groupId}</groupId>
                     <artifactId>apache-mailet-base</artifactId>
                     <type>test-jar</type>

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
index 54f95c3..084d83e 100644
--- a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
@@ -22,6 +22,7 @@ package org.apache.james;
 import org.apache.james.modules.data.MemoryDataJmapModule;
 import org.apache.james.modules.data.MemoryDataModule;
 import org.apache.james.modules.mailbox.MemoryMailboxModule;
+import org.apache.james.modules.protocols.IMAPServerModule;
 import org.apache.james.modules.protocols.JMAPServerModule;
 import org.apache.james.modules.server.JMXServerModule;
 import org.apache.james.modules.server.MemoryMailQueueModule;
@@ -34,6 +35,7 @@ public class MemoryJamesServerMain {
 
     public static final Module inMemoryServerModule = Modules.combine(
         new JMAPServerModule(),
+        new IMAPServerModule(),
         new MemoryDataModule(),
         new MemoryDataJmapModule(),
         new MemoryMailboxModule(),
@@ -41,7 +43,7 @@ public class MemoryJamesServerMain {
         new MemoryMailQueueModule());
 
     public static void main(String[] args) throws Exception {
-        new JmapJamesServer()
+        new GuiceJamesServer()
             .combineWith(inMemoryServerModule, new JMXServerModule())
             .start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
index 6da4804..3a4f2b9 100644
--- a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
+++ b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
@@ -27,7 +27,7 @@ public class MemoryJamesServerTest extends AbstractJmapJamesServerTest {
     public MemoryJmapTestRule memoryJmap = new MemoryJmapTestRule();
 
     @Override
-    protected JmapJamesServer createJamesServer() {
+    protected GuiceJamesServer createJamesServer() {
         return memoryJmap.jmapServer();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJmapTestRule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJmapTestRule.java b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJmapTestRule.java
index 6d48111..6653cd9 100644
--- a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJmapTestRule.java
+++ b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJmapTestRule.java
@@ -34,8 +34,8 @@ public class MemoryJmapTestRule implements TestRule {
     
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
-    public JmapJamesServer jmapServer() {
-        return new JmapJamesServer()
+    public GuiceJamesServer jmapServer() {
+        return new GuiceJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new TestFilesystemModule(temporaryFolder),
                         new TestJMAPServerModule(LIMIT_TO_3_MESSAGES))

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/mailet/integration-testing/pom.xml
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/pom.xml b/server/mailet/integration-testing/pom.xml
index d553be7..af2a2e6 100644
--- a/server/mailet/integration-testing/pom.xml
+++ b/server/mailet/integration-testing/pom.xml
@@ -176,6 +176,12 @@
               </dependency>
               <dependency>
                   <groupId>org.apache.james</groupId>
+                  <artifactId>james-server-guice-jmap</artifactId>
+                  <scope>test</scope>
+                  <type>test-jar</type>
+              </dependency>
+              <dependency>
+                  <groupId>org.apache.james</groupId>
                   <artifactId>james-server-mailetcontainer-camel</artifactId>
               </dependency>
               <dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
index 9f7919e..86dad85 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
@@ -30,7 +30,7 @@ import org.apache.activemq.store.PersistenceAdapter;
 import org.apache.activemq.store.memory.MemoryPersistenceAdapter;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.io.IOUtils;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.TestJMAPServerModule;
@@ -46,13 +46,13 @@ public class TemporaryJamesServer {
 
     private static final int LIMIT_TO_3_MESSAGES = 3;
 
-    private final JmapJamesServer jamesServer;
+    private final GuiceJamesServer jamesServer;
 
 
     public TemporaryJamesServer(TemporaryFolder temporaryFolder, MailetContainer mailetContainer, Module... additionalModules) throws Exception {
         appendMailetConfigurations(temporaryFolder, mailetContainer);
 
-        jamesServer = new JmapJamesServer()
+        jamesServer = new GuiceJamesServer()
             .combineWith(MemoryJamesServerMain.inMemoryServerModule)
             .overrideWith((binder) -> binder.bind(PersistenceAdapter.class).to(MemoryPersistenceAdapter.class))
             .overrideWith(ImmutableList.<Module>builder().addAll(Arrays.asList(additionalModules))

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index e28a324..b8dc69c 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -246,6 +246,17 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
+                <artifactId>james-server-guice-jmap</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>james-server-guice-jmap</artifactId>
+                <version>${project.version}</version>
+                <type>test-jar</type>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
                 <artifactId>james-server-jetty</artifactId>
                 <version>${project.version}</version>
             </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
index 299a8f1..ce824ef 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.methods.integration.GetMailboxesMethodTest;
 import org.junit.Rule;
 
@@ -30,7 +30,7 @@ public class CassandraGetMailboxesMethodTest extends GetMailboxesMethodTest {
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
     
     @Override
-    protected JmapJamesServer createJmapServer() {
+    protected GuiceJamesServer createJmapServer() {
         return rule.jmapServer();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
index cae3a6d..8207859 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.methods.integration.GetMessageListMethodTest;
 import org.junit.Rule;
 
@@ -30,7 +30,7 @@ public class CassandraGetMessageListMethodTest extends GetMessageListMethodTest
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
     
     @Override
-    protected JmapJamesServer createJmapServer() {
+    protected GuiceJamesServer createJmapServer() {
         return rule.jmapServer();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
index c50f048..96101bc 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.methods.integration.GetVacationResponseTest;
 import org.apache.james.util.date.ZonedDateTimeProvider;
 import org.junit.Rule;
@@ -31,7 +31,7 @@ public class CassandraGetVacationResponseTest extends GetVacationResponseTest {
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
     
     @Override
-    protected JmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
+    protected GuiceJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
         return rule.jmapServer()
                 .overrideWith(binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
index d4027aa..71a42c3 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
@@ -19,7 +19,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
 import org.apache.james.jmap.JMAPAuthenticationTest;
 import org.apache.james.util.date.ZonedDateTimeProvider;
@@ -31,7 +31,7 @@ public class CassandraJmapAuthenticationTest extends JMAPAuthenticationTest {
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
     
     @Override
-    protected JmapJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
+    protected GuiceJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
         return rule.jmapServer()
                 .overrideWith(binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
index 7aea5d8..cdad450 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.methods.integration.SetMailboxesMethodTest;
 import org.junit.Ignore;
 import org.junit.Rule;
@@ -31,7 +31,7 @@ public class CassandraSetMailboxesMethodTest extends SetMailboxesMethodTest {
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
     
     @Override
-    protected JmapJamesServer createJmapServer() {
+    protected GuiceJamesServer createJmapServer() {
         return rule.jmapServer();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
index e0e36c5..9a56d2b 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.methods.integration.SetMessagesMethodTest;
 import org.apache.james.mailbox.cassandra.CassandraMessageId;
 import org.apache.james.mailbox.model.MessageId;
@@ -32,7 +32,7 @@ public class CassandraSetMessagesMethodTest extends SetMessagesMethodTest {
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
 
     @Override
-    protected JmapJamesServer createJmapServer() {
+    protected GuiceJamesServer createJmapServer() {
         return rule.jmapServer();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
index 6300459..ca9af6b 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.methods.integration.SetVacationResponseTest;
 import org.junit.Rule;
 
@@ -30,7 +30,7 @@ public class CassandraSetVacationResponseTest extends SetVacationResponseTest {
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
     
     @Override
-    protected JmapJamesServer createJmapServer() {
+    protected GuiceJamesServer createJmapServer() {
         return rule.jmapServer();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraUserProvisionningConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraUserProvisionningConcurrencyTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraUserProvisionningConcurrencyTest.java
index efd5be7..ea63d10 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraUserProvisionningConcurrencyTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraUserProvisionningConcurrencyTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.UserProvisionningConcurrencyTest;
 import org.junit.Rule;
 
@@ -29,7 +29,7 @@ public class CassandraUserProvisionningConcurrencyTest extends UserProvisionning
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
 
     @Override
-    protected JmapJamesServer createJmapServer() {
+    protected GuiceJamesServer createJmapServer() {
         return rule.jmapServer();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
index adbb077..186a3ce 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJmapTestRule;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.VacationIntegrationTest;
 import org.junit.Rule;
 
@@ -31,7 +31,7 @@ public class CassandraVacationIntegrationTest extends VacationIntegrationTest {
     public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
     
     @Override
-    protected JmapJamesServer createJmapServer() {
+    protected GuiceJamesServer createJmapServer() {
         return rule.jmapServer();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
index abae9bd..249cc06 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
@@ -26,7 +26,7 @@ import javax.inject.Inject;
 import org.apache.activemq.store.PersistenceAdapter;
 import org.apache.activemq.store.memory.MemoryPersistenceAdapter;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.backends.es.EmbeddedElasticSearch;
 import org.apache.james.jmap.methods.integration.cucumber.MainStepdefs;
@@ -59,7 +59,7 @@ public class CassandraStepdefs {
         temporaryFolder.create();
         embeddedElasticSearch.before();
         mainStepdefs.messageIdFactory = new CassandraMessageId.Factory();
-        mainStepdefs.jmapServer = new JmapJamesServer()
+        mainStepdefs.jmapServer = new GuiceJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule, CassandraJamesServerMain.protocols)
                 .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra))
                 .overrideWith((binder) -> binder.bind(PersistenceAdapter.class).to(MemoryPersistenceAdapter.class));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
index 41104ab..8580562 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
@@ -32,8 +32,9 @@ import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.UUID;
 
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.model.ContinuationToken;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -49,11 +50,11 @@ public abstract class JMAPAuthenticationTest {
     private static final ZonedDateTime newDate = ZonedDateTime.parse("2011-12-03T10:16:30+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
     private static final ZonedDateTime afterExpirationDate = ZonedDateTime.parse("2011-12-03T10:30:31+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
 
-    protected abstract JmapJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider);
+    protected abstract GuiceJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider);
 
     private UserCredentials userCredentials;
     private FixedDateZonedDateTimeProvider zonedDateTimeProvider;
-    private JmapJamesServer jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -63,8 +64,7 @@ public abstract class JMAPAuthenticationTest {
         jmapServer.start();
         RestAssured.requestSpecification = new RequestSpecBuilder()
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapProbe()
-                    .getJmapPort())
+        		.setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort())
         		.build();
         
         userCredentials = UserCredentials.builder()

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/UserProvisionningConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/UserProvisionningConcurrencyTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/UserProvisionningConcurrencyTest.java
index 643500d..b210e4c 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/UserProvisionningConcurrencyTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/UserProvisionningConcurrencyTest.java
@@ -31,8 +31,9 @@ import static org.hamcrest.Matchers.hasSize;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.util.concurrency.ConcurrentTestRunner;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -47,9 +48,9 @@ public abstract class UserProvisionningConcurrencyTest {
     private static final String DOMAIN = "mydomain.tld";
     private static final String USER = "myuser@" + DOMAIN;
     private static final String PASSWORD = "secret";
-    protected abstract JmapJamesServer createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
-    private JmapJamesServer jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -57,8 +58,7 @@ public abstract class UserProvisionningConcurrencyTest {
         jmapServer.start();
         RestAssured.requestSpecification = new RequestSpecBuilder()
             .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-            .setPort(jmapServer.getJmapProbe()
-                .getJmapPort())
+            .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort())
             .build();
 
         jmapServer.serverProbe().addDomain(DOMAIN);
@@ -101,8 +101,7 @@ public abstract class UserProvisionningConcurrencyTest {
         return new URIBuilder()
             .setScheme("http")
             .setHost("localhost")
-            .setPort(jmapServer.getJmapProbe()
-                .getJmapPort())
+            .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort())
             .setCharset(Charsets.UTF_8);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
index d3221f0..9d0b4a1 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
@@ -32,7 +32,7 @@ import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.VacationPatch;
@@ -64,10 +64,10 @@ public abstract class VacationIntegrationTest {
     public static final String ORIGINAL_MESSAGE_TEXT_BODY = "Hello someone, and thank you for joining example.com!";
 
     private ConditionFactory calmlyAwait;
-    private JmapJamesServer guiceJamesServer;
+    private GuiceJamesServer guiceJamesServer;
     private JmapGuiceProbe jmapGuiceProbe;
 
-    protected abstract JmapJamesServer createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
@@ -86,7 +86,7 @@ public abstract class VacationIntegrationTest {
         guiceJamesServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, USER_2, DefaultMailboxes.INBOX);
         await();
 
-        jmapGuiceProbe = guiceJamesServer.getJmapProbe();
+        jmapGuiceProbe = guiceJamesServer.getProbe(JmapGuiceProbe.class);
         RestAssured.requestSpecification = new RequestSpecBuilder()
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
@@ -103,7 +103,7 @@ public abstract class VacationIntegrationTest {
         return new URIBuilder()
             .setScheme("http")
             .setHost("localhost")
-            .setPort(guiceJamesServer.getJmapProbe()
+            .setPort(guiceJamesServer.getProbe(JmapGuiceProbe.class)
                 .getJmapPort())
             .setCharset(Charsets.UTF_8);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
index 49caa3e..301e862 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
@@ -39,7 +39,7 @@ import java.util.Locale;
 import javax.mail.Flags;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.DefaultMailboxes;
 import org.apache.james.jmap.HttpJmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
@@ -47,6 +47,7 @@ import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -61,11 +62,11 @@ public abstract class GetMailboxesMethodTest {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    protected abstract JmapJamesServer createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
     private AccessToken accessToken;
     private String username;
-    private JmapJamesServer jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -76,8 +77,7 @@ public abstract class GetMailboxesMethodTest {
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
                 .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                .setPort(jmapServer.getJmapProbe()
-                    .getJmapPort())
+                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort())
                 .build();
 
         String domain = "domain.tld";
@@ -92,7 +92,7 @@ public abstract class GetMailboxesMethodTest {
         return new URIBuilder()
             .setScheme("http")
             .setHost("localhost")
-            .setPort(jmapServer.getJmapProbe()
+            .setPort(jmapServer.getProbe(JmapGuiceProbe.class)
                 .getJmapPort())
             .setCharset(Charsets.UTF_8);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
index 03b7bf2..b60906a 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
@@ -38,7 +38,7 @@ import java.util.Date;
 import javax.mail.Flags;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.HttpJmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.FlagsBuilder;
@@ -47,6 +47,7 @@ import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -61,14 +62,14 @@ public abstract class GetMessageListMethodTest {
     private static final String ARGUMENTS = "[0][1]";
     private static final ZoneId ZONE_ID = ZoneId.of("Europe/Paris");
 
-    protected abstract JmapJamesServer createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
     private String domain;
-    private JmapJamesServer jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -78,8 +79,7 @@ public abstract class GetMessageListMethodTest {
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
                 .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                .setPort(jmapServer.getJmapProbe()
-                    .getJmapPort())
+                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort())
                 .build();
 
         this.domain = "domain.tld";
@@ -94,7 +94,7 @@ public abstract class GetMessageListMethodTest {
         return new URIBuilder()
             .setScheme("http")
             .setHost("localhost")
-            .setPort(jmapServer.getJmapProbe()
+            .setPort(jmapServer.getProbe(JmapGuiceProbe.class)
                 .getJmapPort())
             .setCharset(Charsets.UTF_8);
     }
@@ -116,7 +116,7 @@ public abstract class GetMessageListMethodTest {
 
         await();
 
-        jmapServer.getJmapProbe().setInMailboxes(message.getMessageId(), username, mailbox.getMailboxId(), mailbox2.getMailboxId());
+        jmapServer.getProbe(JmapGuiceProbe.class).setInMailboxes(message.getMessageId(), username, mailbox.getMailboxId(), mailbox2.getMailboxId());
 
         given()
             .header("Authorization", accessToken.serialize())

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
index a1ff796..815cbe2 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
@@ -29,7 +29,7 @@ import static org.hamcrest.core.IsNull.nullValue;
 import java.time.ZonedDateTime;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
 import org.apache.james.jmap.HttpJmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
@@ -59,12 +59,12 @@ public abstract class GetVacationResponseTest {
     public static final ZonedDateTime DATE_2016 = ZonedDateTime.parse("2016-04-15T11:56:32.224+07:00[Asia/Vientiane]");
     private JmapGuiceProbe jmapGuiceProbe;
 
-    protected abstract JmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider);
+    protected abstract GuiceJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider);
 
     protected abstract void await();
 
     private AccessToken accessToken;
-    private JmapJamesServer jmapServer;
+    private GuiceJamesServer jmapServer;
     private FixedDateZonedDateTimeProvider fixedDateZonedDateTimeProvider;
 
     @Before
@@ -75,7 +75,7 @@ public abstract class GetVacationResponseTest {
         jmapServer = createJmapServer(fixedDateZonedDateTimeProvider);
         jmapServer.start();
 
-        jmapGuiceProbe = jmapServer.getJmapProbe();
+        jmapGuiceProbe = jmapServer.getProbe(JmapGuiceProbe.class);
         RestAssured.requestSpecification = new RequestSpecBuilder()
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
@@ -95,7 +95,7 @@ public abstract class GetVacationResponseTest {
         return new URIBuilder()
             .setScheme("http")
             .setHost("localhost")
-            .setPort(jmapServer.getJmapProbe()
+            .setPort(jmapServer.getProbe(JmapGuiceProbe.class)
                 .getJmapPort())
             .setCharset(Charsets.UTF_8);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac56c422/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
index 3a310f0..df568cf 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
@@ -39,13 +39,14 @@ import static org.hamcrest.collection.IsMapWithSize.aMapWithSize;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.JmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.jmap.DefaultMailboxes;
 import org.apache.james.jmap.HttpJmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.hamcrest.Matchers;
 import org.junit.After;
 import org.junit.Before;
@@ -63,13 +64,13 @@ public abstract class SetMailboxesMethodTest {
     private static final String USERS_DOMAIN = "domain.tld";
     private static int MAILBOX_NAME_LENGTH_64K = 65536;
 
-    protected abstract JmapJamesServer createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
-    private JmapJamesServer jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -80,8 +81,7 @@ public abstract class SetMailboxesMethodTest {
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
                 .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                .setPort(jmapServer.getJmapProbe()
-                    .getJmapPort())
+                .setPort(jmapServer.getProbe(JmapGuiceProbe.class).getJmapPort())
                 .build();
         RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
 
@@ -99,7 +99,7 @@ public abstract class SetMailboxesMethodTest {
         return new URIBuilder()
             .setScheme("http")
             .setHost("localhost")
-            .setPort(jmapServer.getJmapProbe()
+            .setPort(jmapServer.getProbe(JmapGuiceProbe.class)
                 .getJmapPort())
             .setCharset(Charsets.UTF_8);
     }


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