james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [09/44] james-project git commit: JAMES-2267 MailetContainer integration: Provide a default value for Mailet container configuration
Date Fri, 05 Jan 2018 02:56:28 GMT
JAMES-2267 MailetContainer integration: Provide a default value for Mailet container configuration


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

Branch: refs/heads/improve-mailet-testing-experience-v1
Commit: 91e887105453480c0e8644501f0b08563c8d7dd2
Parents: a537bce
Author: benwa <btellier@linagora.com>
Authored: Tue Dec 19 13:56:26 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Fri Jan 5 09:13:51 2018 +0700

----------------------------------------------------------------------
 .../james/mailets/AddDeliveredToHeaderTest.java | 15 +----
 .../james/mailets/BounceIntegrationTest.java    | 68 +++++++++++---------
 .../mailets/CommonMailetConfigurationTest.java  | 15 +----
 .../GatewayRemoteDeliveryIntegrationTest.java   | 33 ++++++----
 .../mailets/NetworkMatcherIntegrationTest.java  | 12 ++--
 .../RecipientRewriteTableIntegrationTest.java   | 15 +----
 .../org/apache/james/mailets/SieveDelivery.java | 15 +----
 .../james/mailets/SmtpAuthIntegrationTest.java  |  3 +-
 .../james/mailets/TemporaryJamesServer.java     | 28 +++++++-
 .../crypto/SMIMEDecryptIntegrationTest.java     |  3 +-
 .../crypto/SMIMESignIntegrationTest.java        |  3 +-
 .../james/smtp/SmtpAuthorizedAddressesTest.java |  3 +-
 .../james/smtp/SmtpBracketEnforcementTest.java  |  3 +-
 .../smtp/SmtpIdentityVerificationTest.java      |  3 +-
 .../james/smtp/SmtpSizeLimitationTest.java      |  3 +-
 .../mailets/AmqpForwardAttachmentTest.java      |  3 +-
 .../transport/mailets/ContactExtractorTest.java |  3 +-
 .../transport/mailets/GroupMappingTest.java     |  3 +-
 .../mailets/ICSAttachmentWorkflowTest.java      |  3 +-
 .../transport/mailets/StripAttachmentTest.java  |  3 +-
 20 files changed, 115 insertions(+), 122 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/AddDeliveredToHeaderTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/AddDeliveredToHeaderTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/AddDeliveredToHeaderTest.java
index 662a6df..e281064 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/AddDeliveredToHeaderTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/AddDeliveredToHeaderTest.java
@@ -20,8 +20,6 @@
 package org.apache.james.mailets;
 
 import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailets.configuration.CommonProcessors;
-import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.MailboxProbeImpl;
 import org.apache.james.probe.DataProbe;
 import org.apache.james.transport.mailets.AddDeliveredToHeader;
@@ -54,18 +52,7 @@ public class AddDeliveredToHeaderTest {
 
     @Before
     public void setup() throws Exception {
-        MailetContainer mailetContainer = MailetContainer.builder()
-            .addProcessor(CommonProcessors.root())
-            .addProcessor(CommonProcessors.error())
-            .addProcessor(CommonProcessors.transport())
-            .addProcessor(CommonProcessors.spam())
-            .addProcessor(CommonProcessors.localAddressError())
-            .addProcessor(CommonProcessors.relayDenied())
-            .addProcessor(CommonProcessors.bounces())
-            .addProcessor(CommonProcessors.sieveManagerCheck())
-            .build();
-
-        jamesServer = TemporaryJamesServer.builder().build(temporaryFolder, mailetContainer);
+        jamesServer = TemporaryJamesServer.builder().build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with()
             .pollInterval(slowPacedPollInterval)

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/BounceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/BounceIntegrationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/BounceIntegrationTest.java
index 5c65644..41c642a 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/BounceIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/BounceIntegrationTest.java
@@ -89,11 +89,12 @@ public class BounceIntegrationTest {
     public void dsnBounceMailetShouldDeliverBounce() throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder,
-            generateMailetContainerConfiguration(MailetConfiguration.builder()
+            .withMailetContainer(
+                generateMailetContainerConfiguration(MailetConfiguration.builder()
                 .matcher(All.class)
                 .mailet(DSNBounce.class)
-                .addProperty("passThrough", "false")));
+                .addProperty("passThrough", "false")))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -113,11 +114,12 @@ public class BounceIntegrationTest {
     public void bounceMailetShouldDeliverBounce() throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder,
-            generateMailetContainerConfiguration(MailetConfiguration.builder()
+            .withMailetContainer(
+                generateMailetContainerConfiguration(MailetConfiguration.builder()
                 .matcher(All.class)
                 .mailet(Bounce.class)
-                .addProperty("passThrough", "false")));
+                .addProperty("passThrough", "false")))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -137,12 +139,12 @@ public class BounceIntegrationTest {
     public void forwardMailetShouldDeliverBounce() throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder,
-            generateMailetContainerConfiguration(MailetConfiguration.builder()
+            .withMailetContainer(generateMailetContainerConfiguration(MailetConfiguration.builder()
                 .matcher(All.class)
                 .mailet(Forward.class)
                 .addProperty("forwardTo", BOUNCE_RECEIVER)
-                .addProperty("passThrough", "false")));
+                .addProperty("passThrough", "false")))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -162,12 +164,13 @@ public class BounceIntegrationTest {
     public void redirectMailetShouldDeliverBounce() throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder,
-            generateMailetContainerConfiguration(MailetConfiguration.builder()
-                .matcher(All.class)
-                .mailet(Redirect.class)
-                .addProperty("recipients", BOUNCE_RECEIVER)
-                .addProperty("passThrough", "false")));
+            .withMailetContainer(
+                generateMailetContainerConfiguration(MailetConfiguration.builder()
+                    .matcher(All.class)
+                    .mailet(Redirect.class)
+                    .addProperty("recipients", BOUNCE_RECEIVER)
+                    .addProperty("passThrough", "false")))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -187,12 +190,13 @@ public class BounceIntegrationTest {
     public void resendMailetShouldDeliverBounce() throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder,
-            generateMailetContainerConfiguration(MailetConfiguration.builder()
-                .matcher(All.class)
-                .mailet(Resend.class)
-                .addProperty("recipients", BOUNCE_RECEIVER)
-                .addProperty("passThrough", "false")));
+            .withMailetContainer(
+                generateMailetContainerConfiguration(MailetConfiguration.builder()
+                    .matcher(All.class)
+                    .mailet(Resend.class)
+                    .addProperty("recipients", BOUNCE_RECEIVER)
+                    .addProperty("passThrough", "false")))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -212,11 +216,12 @@ public class BounceIntegrationTest {
     public void notifySenderMailetShouldDeliverBounce() throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder,
-            generateMailetContainerConfiguration(MailetConfiguration.builder()
-                .matcher(All.class)
-                .mailet(NotifySender.class)
-                .addProperty("passThrough", "false")));
+            .withMailetContainer(
+                generateMailetContainerConfiguration(MailetConfiguration.builder()
+                    .matcher(All.class)
+                    .mailet(NotifySender.class)
+                    .addProperty("passThrough", "false")))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -236,11 +241,12 @@ public class BounceIntegrationTest {
     public void notifyPostmasterMailetShouldDeliverBounce() throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder,
-            generateMailetContainerConfiguration(MailetConfiguration.builder()
-                .matcher(All.class)
-                .mailet(NotifyPostmaster.class)
-                .addProperty("passThrough", "false")));
+            .withMailetContainer(
+                generateMailetContainerConfiguration(MailetConfiguration.builder()
+                    .matcher(All.class)
+                    .mailet(NotifyPostmaster.class)
+                    .addProperty("passThrough", "false")))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/CommonMailetConfigurationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/CommonMailetConfigurationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/CommonMailetConfigurationTest.java
index 27c94c2..89409a2 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/CommonMailetConfigurationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/CommonMailetConfigurationTest.java
@@ -20,8 +20,6 @@
 package org.apache.james.mailets;
 
 import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailets.configuration.CommonProcessors;
-import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.MailboxProbeImpl;
 import org.apache.james.probe.DataProbe;
 import org.apache.james.utils.DataProbeImpl;
@@ -53,18 +51,7 @@ public class CommonMailetConfigurationTest {
 
     @Before
     public void setup() throws Exception {
-        MailetContainer mailetContainer = MailetContainer.builder()
-            .addProcessor(CommonProcessors.root())
-            .addProcessor(CommonProcessors.error())
-            .addProcessor(CommonProcessors.transport())
-            .addProcessor(CommonProcessors.spam())
-            .addProcessor(CommonProcessors.localAddressError())
-            .addProcessor(CommonProcessors.relayDenied())
-            .addProcessor(CommonProcessors.bounces())
-            .addProcessor(CommonProcessors.sieveManagerCheck())
-            .build();
-
-        jamesServer = TemporaryJamesServer.builder().build(temporaryFolder, mailetContainer);
+        jamesServer = TemporaryJamesServer.builder().build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/GatewayRemoteDeliveryIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/GatewayRemoteDeliveryIntegrationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/GatewayRemoteDeliveryIntegrationTest.java
index 37458f2..a2ae2e9 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/GatewayRemoteDeliveryIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/GatewayRemoteDeliveryIntegrationTest.java
@@ -130,7 +130,8 @@ public class GatewayRemoteDeliveryIntegrationTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
-            .build(temporaryFolder, generateMailetContainerConfiguration(gatewayProperty));
+            .withMailetContainer(generateMailetContainerConfiguration(gatewayProperty))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -149,7 +150,8 @@ public class GatewayRemoteDeliveryIntegrationTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
-            .build(temporaryFolder, generateMailetContainerConfiguration(gatewayProperty));
+            .withMailetContainer(generateMailetContainerConfiguration(gatewayProperty))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -168,7 +170,8 @@ public class GatewayRemoteDeliveryIntegrationTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
-            .build(temporaryFolder, generateMailetContainerConfiguration(gatewayProperty));
+            .withMailetContainer(generateMailetContainerConfiguration(gatewayProperty))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -187,7 +190,8 @@ public class GatewayRemoteDeliveryIntegrationTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
-            .build(temporaryFolder, generateMailetContainerConfiguration(gatewayProperty));
+            .withMailetContainer(generateMailetContainerConfiguration(gatewayProperty))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -210,7 +214,8 @@ public class GatewayRemoteDeliveryIntegrationTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
-            .build(temporaryFolder, generateMailetContainerConfiguration(gatewayProperty));
+            .withMailetContainer(generateMailetContainerConfiguration(gatewayProperty))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -237,13 +242,13 @@ public class GatewayRemoteDeliveryIntegrationTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_AND_IMAP_MODULE)
             .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
-            .build(temporaryFolder, MailetContainer.builder()
+            .withMailetContainer(MailetContainer.builder()
                 .postmaster("postmaster@" + JAMES_APACHE_ORG)
                 .addProcessor(root())
                 .addProcessor(CommonProcessors.error())
                 .addProcessor(relayAndLocalDeliveryTransport(gatewayProperty))
-                .addProcessor(CommonProcessors.bounces())
-                .build());
+                .addProcessor(CommonProcessors.bounces()))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -268,7 +273,7 @@ public class GatewayRemoteDeliveryIntegrationTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_AND_IMAP_MODULE)
             .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
-            .build(temporaryFolder, MailetContainer.builder()
+            .withMailetContainer(MailetContainer.builder()
                 .postmaster("postmaster@" + JAMES_APACHE_ORG)
                 .addProcessor(root())
                 .addProcessor(CommonProcessors.error())
@@ -291,8 +296,8 @@ public class GatewayRemoteDeliveryIntegrationTest {
                         .addProperty("deliveryThreads", "2")
                         .addProperty("sendpartial", "true")
                         .addProperty("gateway", gatewayProperty)))
-                .addProcessor(CommonProcessors.bounces())
-                .build());
+                .addProcessor(CommonProcessors.bounces()))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);
@@ -316,13 +321,13 @@ public class GatewayRemoteDeliveryIntegrationTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
-            .build(temporaryFolder, MailetContainer.builder()
+            .withMailetContainer(MailetContainer.builder()
                 .postmaster("postmaster@" + JAMES_APACHE_ORG)
                 .addProcessor(root())
                 .addProcessor(CommonProcessors.error())
                 .addProcessor(directResolutionTransport())
-                .addProcessor(CommonProcessors.bounces())
-                .build());
+                .addProcessor(CommonProcessors.bounces()))
+            .build(temporaryFolder);
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
 
         dataProbe.addDomain(JAMES_APACHE_ORG);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/NetworkMatcherIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/NetworkMatcherIntegrationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/NetworkMatcherIntegrationTest.java
index 68af424..9d9b0ce 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/NetworkMatcherIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/NetworkMatcherIntegrationTest.java
@@ -75,15 +75,13 @@ public class NetworkMatcherIntegrationTest {
     }
 
     private TemporaryJamesServer createJamesServerWithRootProcessor(ProcessorConfiguration.Builder
rootProcessor) throws Exception {
-        MailetContainer mailetContainer = MailetContainer.builder()
-            .addProcessor(rootProcessor)
-            .addProcessor(CommonProcessors.error())
-            .addProcessor(deliverOnlyTransport())
-            .build();
-
         TemporaryJamesServer temporaryJamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(MailetContainer.builder()
+                .addProcessor(rootProcessor)
+                .addProcessor(CommonProcessors.error())
+                .addProcessor(deliverOnlyTransport()))
+            .build(temporaryFolder);
 
         DataProbe dataProbe = temporaryJamesServer.getProbe(DataProbeImpl.class);
         dataProbe.addDomain(JAMES_APACHE_ORG);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RecipientRewriteTableIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RecipientRewriteTableIntegrationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RecipientRewriteTableIntegrationTest.java
index 671a6b3..d5eef85 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RecipientRewriteTableIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RecipientRewriteTableIntegrationTest.java
@@ -20,8 +20,6 @@
 package org.apache.james.mailets;
 
 import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailets.configuration.CommonProcessors;
-import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.MailboxProbeImpl;
 import org.apache.james.probe.DataProbe;
 import org.apache.james.utils.DataProbeImpl;
@@ -64,18 +62,7 @@ public class RecipientRewriteTableIntegrationTest {
 
     @Before
     public void setup() throws Exception {
-        MailetContainer mailetContainer = MailetContainer.builder()
-            .addProcessor(CommonProcessors.root())
-            .addProcessor(CommonProcessors.error())
-            .addProcessor(CommonProcessors.transport())
-            .addProcessor(CommonProcessors.spam())
-            .addProcessor(CommonProcessors.localAddressError())
-            .addProcessor(CommonProcessors.relayDenied())
-            .addProcessor(CommonProcessors.bounces())
-            .addProcessor(CommonProcessors.sieveManagerCheck())
-            .build();
-
-        jamesServer = TemporaryJamesServer.builder().build(temporaryFolder, mailetContainer);
+        jamesServer = TemporaryJamesServer.builder().build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SieveDelivery.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SieveDelivery.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SieveDelivery.java
index bc9b77b..07dbae4 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SieveDelivery.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SieveDelivery.java
@@ -21,8 +21,6 @@ package org.apache.james.mailets;
 
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.store.probe.MailboxProbe;
-import org.apache.james.mailets.configuration.CommonProcessors;
-import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.MailboxProbeImpl;
 import org.apache.james.modules.protocols.SieveProbeImpl;
 import org.apache.james.probe.DataProbe;
@@ -55,18 +53,7 @@ public class SieveDelivery {
 
     @Before
     public void setup() throws Exception {
-        MailetContainer mailetContainer = MailetContainer.builder()
-            .addProcessor(CommonProcessors.root())
-            .addProcessor(CommonProcessors.error())
-            .addProcessor(CommonProcessors.transport())
-            .addProcessor(CommonProcessors.spam())
-            .addProcessor(CommonProcessors.localAddressError())
-            .addProcessor(CommonProcessors.relayDenied())
-            .addProcessor(CommonProcessors.bounces())
-            .addProcessor(CommonProcessors.sieveManagerCheck())
-            .build();
-
-        jamesServer = TemporaryJamesServer.builder().build(temporaryFolder, mailetContainer);
+        jamesServer = TemporaryJamesServer.builder().build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java
index 6c73a27..5b9b612 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/SmtpAuthIntegrationTest.java
@@ -86,7 +86,8 @@ public class SmtpAuthIntegrationTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
         DataProbe dataProbe = jamesServer.getProbe(DataProbeImpl.class);
         dataProbe.addDomain(JAMES_APACHE_ORG);
         dataProbe.addUser(FROM, PASSWORD);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/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 ebbe397..5e47f0e 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
@@ -35,6 +35,7 @@ import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.io.IOUtils;
 import org.apache.james.GuiceJamesServer;
 import org.apache.james.MemoryJamesServerMain;
+import org.apache.james.mailets.configuration.CommonProcessors;
 import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.mailets.configuration.SmtpConfiguration;
 import org.apache.james.modules.TestJMAPServerModule;
@@ -48,15 +49,28 @@ import com.google.inject.Module;
 
 public class TemporaryJamesServer {
 
+    public static final MailetContainer DEFAUL_MAILET_CONTAINER_CONFIGURATION = MailetContainer.builder()
+        .addProcessor(CommonProcessors.root())
+        .addProcessor(CommonProcessors.error())
+        .addProcessor(CommonProcessors.transport())
+        .addProcessor(CommonProcessors.spam())
+        .addProcessor(CommonProcessors.localAddressError())
+        .addProcessor(CommonProcessors.relayDenied())
+        .addProcessor(CommonProcessors.bounces())
+        .addProcessor(CommonProcessors.sieveManagerCheck())
+        .build();
+
     public static class Builder {
         private ImmutableList.Builder<Module> overrideModules;
         private Optional<Module> module;
         private Optional<SmtpConfiguration> smtpConfiguration;
+        private Optional<MailetContainer> mailetConfiguration;
 
         private Builder() {
             overrideModules = ImmutableList.builder();
             module = Optional.empty();
             smtpConfiguration = Optional.empty();
+            mailetConfiguration = Optional.empty();
         }
 
         public Builder withBase(Module module) {
@@ -69,15 +83,25 @@ public class TemporaryJamesServer {
             return this;
         }
 
+        public Builder withMailetContainer(MailetContainer mailetConfiguration) {
+            this.mailetConfiguration = Optional.of(mailetConfiguration);
+            return this;
+        }
+
+
+        public Builder withMailetContainer(MailetContainer.Builder mailetConfiguration) {
+            return withMailetContainer(mailetConfiguration.build());
+        }
+
         public Builder withOverrides(Module... modules) {
             this.overrideModules.addAll(Arrays.asList(modules));
             return this;
         }
 
-        public TemporaryJamesServer build(TemporaryFolder temporaryFolder, MailetContainer
mailetContainer) throws Exception {
+        public TemporaryJamesServer build(TemporaryFolder temporaryFolder) throws Exception
{
             return new TemporaryJamesServer(
                 temporaryFolder,
-                mailetContainer,
+                mailetConfiguration.orElse(DEFAUL_MAILET_CONTAINER_CONFIGURATION),
                 smtpConfiguration.orElse(SmtpConfiguration.DEFAULT),
                 module.orElse(MemoryJamesServerMain.IN_MEMORY_SERVER_AGGREGATE_MODULE),
                 overrideModules.build());

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java
index 7ed510e..c2894bd 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java
@@ -92,7 +92,8 @@ public class SMIMEDecryptIntegrationTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
             .withOverrides(binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(()
-> DATE_2015))
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMESignIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMESignIntegrationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMESignIntegrationTest.java
index f9ef2dc..90d01a4 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMESignIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMESignIntegrationTest.java
@@ -131,7 +131,8 @@ public class SMIMESignIntegrationTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
             .withOverrides(binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(()
-> DATE_2015))
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpAuthorizedAddressesTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpAuthorizedAddressesTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpAuthorizedAddressesTest.java
index 800262c..bdd1405 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpAuthorizedAddressesTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpAuthorizedAddressesTest.java
@@ -141,7 +141,8 @@ public class SmtpAuthorizedAddressesTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
             .withSmtpConfiguration(smtpConfiguration.build())
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
 
         DataProbe dataProbe = jamesServer.getProbe(DataProbeImpl.class);
         dataProbe.addDomain(JAMES_APACHE_ORG);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpBracketEnforcementTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpBracketEnforcementTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpBracketEnforcementTest.java
index 4db4a87..6ebe0a5 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpBracketEnforcementTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpBracketEnforcementTest.java
@@ -93,7 +93,8 @@ public class SmtpBracketEnforcementTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_ONLY_MODULE)
             .withSmtpConfiguration(smtpConfiguration.build())
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
 
         DataProbe dataProbe = jamesServer.getProbe(DataProbeImpl.class);
         dataProbe.addDomain(JAMES_APACHE_ORG);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpIdentityVerificationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpIdentityVerificationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpIdentityVerificationTest.java
index c1890e9..6f3e8a5 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpIdentityVerificationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpIdentityVerificationTest.java
@@ -91,7 +91,8 @@ public class SmtpIdentityVerificationTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_ONLY_MODULE)
             .withSmtpConfiguration(smtpConfiguration.build())
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
 
         DataProbe dataProbe = jamesServer.getProbe(DataProbeImpl.class);
         dataProbe.addDomain(JAMES_APACHE_ORG);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
index 295021b..20246bf 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/SmtpSizeLimitationTest.java
@@ -94,7 +94,8 @@ public class SmtpSizeLimitationTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_ONLY_MODULE)
             .withSmtpConfiguration(smtpConfiguration.build())
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
 
         DataProbe dataProbe = jamesServer.getProbe(DataProbeImpl.class);
         dataProbe.addDomain(JAMES_APACHE_ORG);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java
index 538c037..a3a350f 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java
@@ -116,7 +116,8 @@ public class AmqpForwardAttachmentTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with()
             .pollInterval(slowPacedPollInterval)

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
index f7ba334..380b64c 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
@@ -100,7 +100,8 @@ public class ContactExtractorTest {
             .build();
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(folder, mailets);
+            .withMailetContainer(mailets)
+            .build(folder);
         DataProbeImpl probe = jamesServer.getProbe(DataProbeImpl.class);
         probe.addDomain(JAMES_ORG);
         probe.addUser(SENDER, PASSWORD);

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingTest.java
index 69362eb..8419cd3 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingTest.java
@@ -152,7 +152,8 @@ public class GroupMappingTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
 
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java
index f6bd7ed..8be57ff 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java
@@ -500,7 +500,8 @@ public class ICSAttachmentWorkflowTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/91e88710/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
index 2419288..90621fa 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/StripAttachmentTest.java
@@ -97,7 +97,8 @@ public class StripAttachmentTest {
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .build(temporaryFolder, mailetContainer);
+            .withMailetContainer(mailetContainer)
+            .build(temporaryFolder);
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
         calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
 


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