james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [44/44] james-project git commit: JAMES-2266 Rebase AddFooter integration test
Date Fri, 05 Jan 2018 03:01:28 GMT
JAMES-2266 Rebase AddFooter integration test


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

Branch: refs/heads/master
Commit: 55dc6ff94fbc6e8ce1255455002c52b65a40710e
Parents: 4a34bf2
Author: benwa <btellier@linagora.com>
Authored: Thu Jan 4 09:51:43 2018 +0700
Committer: benwa <btellier@linagora.com>
Committed: Fri Jan 5 09:35:04 2018 +0700

----------------------------------------------------------------------
 .../james/mailets/BounceIntegrationTest.java    |   6 +-
 .../GatewayRemoteDeliveryIntegrationTest.java   |  12 +-
 .../apache/james/mailets/MailetErrorsTest.java  |  88 +++++------
 .../mailets/NetworkMatcherIntegrationTest.java  |   6 +-
 .../james/mailets/SmtpAuthIntegrationTest.java  |   8 +-
 .../james/mailets/TemporaryJamesServer.java     |  32 ++--
 .../mailets/configuration/MailetContainer.java  |   6 +-
 .../crypto/SMIMEDecryptIntegrationTest.java     |   6 +-
 .../crypto/SMIMESignIntegrationTest.java        |  16 +-
 .../james/smtp/SmtpAuthorizedAddressesTest.java |   2 +-
 .../james/transport/mailets/AddFooterTest.java  | 157 +++++++------------
 .../mailets/AmqpForwardAttachmentTest.java      |   4 +-
 .../transport/mailets/ContactExtractorTest.java |   4 +-
 .../transport/mailets/GroupMappingTest.java     |   2 +-
 .../mailets/ICSAttachmentWorkflowTest.java      |   4 +-
 .../transport/mailets/SpamAssassinTest.java     |   4 +-
 .../transport/mailets/StripAttachmentTest.java  |   4 +-
 17 files changed, 159 insertions(+), 202 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 910af99..120f5d3 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
@@ -247,10 +247,10 @@ public class BounceIntegrationTest {
     }
 
     private MailetContainer.Builder generateMailetContainerConfiguration(MailetConfiguration.Builder
redirectionMailetConfiguration) {
-        return TemporaryJamesServer.DEFAUL_MAILET_CONTAINER_CONFIGURATION
+        return TemporaryJamesServer.DEFAULT_MAILET_CONTAINER_CONFIGURATION
             .postmaster(POSTMASTER)
-            .addProcessor(transport())
-            .addProcessor(bounces(redirectionMailetConfiguration));
+            .putProcessor(transport())
+            .putProcessor(bounces(redirectionMailetConfiguration));
     }
 
     private ProcessorConfiguration.Builder transport() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 2eb4c77..5e780f1 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
@@ -216,7 +216,7 @@ public class GatewayRemoteDeliveryIntegrationTest {
             .withBase(SMTP_AND_IMAP_MODULE)
             .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
             .withMailetContainer(TemporaryJamesServer.SIMPLE_MAILET_CONTAINER_CONFIGURATION
-                .addProcessor(ProcessorConfiguration.transport()
+                .putProcessor(ProcessorConfiguration.transport()
                     .addMailet(MailetConfiguration.BCC_STRIPPER)
                     .addMailet(MailetConfiguration.LOCAL_DELIVERY)
                     .addMailet(MailetConfiguration.remoteDeliveryBuilderNoBounces()
@@ -243,10 +243,10 @@ public class GatewayRemoteDeliveryIntegrationTest {
             .withBase(SMTP_ONLY_MODULE)
             .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.simpleRoot())
-                .addProcessor(CommonProcessors.error())
-                .addProcessor(directResolutionTransport())
-                .addProcessor(CommonProcessors.bounces()))
+                .putProcessor(CommonProcessors.simpleRoot())
+                .putProcessor(CommonProcessors.error())
+                .putProcessor(directResolutionTransport())
+                .putProcessor(CommonProcessors.bounces()))
             .build(temporaryFolder);
 
         dataProbe = jamesServer.getProbe(DataProbeImpl.class);
@@ -268,7 +268,7 @@ public class GatewayRemoteDeliveryIntegrationTest {
 
     private MailetContainer.Builder generateMailetContainerConfiguration(String gatewayProperty)
{
         return TemporaryJamesServer.SIMPLE_MAILET_CONTAINER_CONFIGURATION
-            .addProcessor(relayAndLocalDeliveryTransport(gatewayProperty));
+            .putProcessor(relayAndLocalDeliveryTransport(gatewayProperty));
     }
 
     private ProcessorConfiguration.Builder relayAndLocalDeliveryTransport(String gatewayProperty)
{

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
index e912faa..9836af3 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
@@ -69,9 +69,9 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(All.class)
                         .mailet(ErrorMailet.class))))
@@ -88,9 +88,9 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(All.class)
                         .mailet(RuntimeErrorMailet.class))))
@@ -107,10 +107,10 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(customProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(customProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(All.class)
                         .mailet(ErrorMailet.class)
@@ -129,10 +129,10 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(customProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(customProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(All.class)
                         .mailet(RuntimeErrorMailet.class)
@@ -150,10 +150,10 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(customProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(customProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(All.class)
                         .mailet(RuntimeErrorMailet.class)
@@ -175,10 +175,10 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(customProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(customProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(All.class)
                         .mailet(ErrorMailet.class)
@@ -200,9 +200,9 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(ErrorMatcher.class)
                         .mailet(NoopMailet.class))))
@@ -219,9 +219,9 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(RuntimeErrorMatcher.class)
                         .mailet(NoopMailet.class))))
@@ -238,10 +238,10 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(customProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(customProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(ErrorMatcher.class)
                         .mailet(NoopMailet.class)
@@ -259,10 +259,10 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(customProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(customProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(RuntimeErrorMatcher.class)
                         .mailet(NoopMailet.class)
@@ -280,10 +280,10 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(customProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(customProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(RuntimeErrorMatcher.class)
                         .mailet(Null.class)
@@ -305,10 +305,10 @@ public class MailetErrorsTest {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
-                .addProcessor(CommonProcessors.deliverOnlyTransport())
-                .addProcessor(errorProcessor())
-                .addProcessor(customProcessor())
-                .addProcessor(ProcessorConfiguration.root()
+                .putProcessor(CommonProcessors.deliverOnlyTransport())
+                .putProcessor(errorProcessor())
+                .putProcessor(customProcessor())
+                .putProcessor(ProcessorConfiguration.root()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(ErrorMatcher.class)
                         .mailet(Null.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 2f87c73..362f5af 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
@@ -62,9 +62,9 @@ public class NetworkMatcherIntegrationTest {
     private TemporaryJamesServer createJamesServerWithRootProcessor(ProcessorConfiguration.Builder
rootProcessor) throws Exception {
         TemporaryJamesServer temporaryJamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
-            .withMailetContainer(TemporaryJamesServer.DEFAUL_MAILET_CONTAINER_CONFIGURATION
-                .addProcessor(rootProcessor)
-                .addProcessor(CommonProcessors.deliverOnlyTransport()))
+            .withMailetContainer(TemporaryJamesServer.DEFAULT_MAILET_CONTAINER_CONFIGURATION
+                .putProcessor(rootProcessor)
+                .putProcessor(CommonProcessors.deliverOnlyTransport()))
             .build(temporaryFolder);
 
         DataProbe dataProbe = temporaryJamesServer.getProbe(DataProbeImpl.class);

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 a47e393..19a3b5d 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
@@ -70,10 +70,10 @@ public class SmtpAuthIntegrationTest {
                 .addProperty("processor", ProcessorConfiguration.STATE_TRANSPORT))
             .addMailet(MailetConfiguration.TO_BOUNCE);
 
-        MailetContainer.Builder mailetContainer = TemporaryJamesServer.DEFAUL_MAILET_CONTAINER_CONFIGURATION
-            .addProcessor(rootProcessor)
-            .addProcessor(CommonProcessors.deliverOnlyTransport())
-            .addProcessor(bounces());
+        MailetContainer.Builder mailetContainer = TemporaryJamesServer.DEFAULT_MAILET_CONTAINER_CONFIGURATION
+            .putProcessor(rootProcessor)
+            .putProcessor(CommonProcessors.deliverOnlyTransport())
+            .putProcessor(bounces());
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 265580c..a621caa 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
@@ -49,23 +49,23 @@ import com.google.inject.Module;
 
 public class TemporaryJamesServer {
 
-    public static final MailetContainer.Builder 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());
+    public static final MailetContainer.Builder DEFAULT_MAILET_CONTAINER_CONFIGURATION =
MailetContainer.builder()
+        .putProcessor(CommonProcessors.root())
+        .putProcessor(CommonProcessors.error())
+        .putProcessor(CommonProcessors.transport())
+        .putProcessor(CommonProcessors.spam())
+        .putProcessor(CommonProcessors.localAddressError())
+        .putProcessor(CommonProcessors.relayDenied())
+        .putProcessor(CommonProcessors.bounces())
+        .putProcessor(CommonProcessors.sieveManagerCheck());
 
     public static final MailetContainer.Builder SIMPLE_MAILET_CONTAINER_CONFIGURATION = MailetContainer.builder()
-        .addProcessor(CommonProcessors.simpleRoot())
-        .addProcessor(CommonProcessors.error())
-        .addProcessor(CommonProcessors.transport())
-        .addProcessor(CommonProcessors.localAddressError())
-        .addProcessor(CommonProcessors.relayDenied())
-        .addProcessor(CommonProcessors.bounces());
+        .putProcessor(CommonProcessors.simpleRoot())
+        .putProcessor(CommonProcessors.error())
+        .putProcessor(CommonProcessors.transport())
+        .putProcessor(CommonProcessors.localAddressError())
+        .putProcessor(CommonProcessors.relayDenied())
+        .putProcessor(CommonProcessors.bounces());
 
     public static class Builder {
         private ImmutableList.Builder<Module> overrideModules;
@@ -112,7 +112,7 @@ public class TemporaryJamesServer {
         public TemporaryJamesServer build(TemporaryFolder temporaryFolder) throws Exception
{
             return new TemporaryJamesServer(
                 temporaryFolder,
-                mailetConfiguration.orElse(DEFAUL_MAILET_CONTAINER_CONFIGURATION.build()),
+                mailetConfiguration.orElse(DEFAULT_MAILET_CONTAINER_CONFIGURATION.build()),
                 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/55dc6ff9/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetContainer.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetContainer.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetContainer.java
index c9ed6bb..0e2c3db 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetContainer.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetContainer.java
@@ -59,13 +59,13 @@ public class MailetContainer implements SerializableAsXml {
             return this;
         }
 
-        public Builder addProcessor(ProcessorConfiguration processorConfiguration) {
+        public Builder putProcessor(ProcessorConfiguration processorConfiguration) {
             this.processors.put(processorConfiguration.getState(), processorConfiguration);
             return this;
         }
 
-        public Builder addProcessor(ProcessorConfiguration.Builder processorConfiguration)
{
-            return this.addProcessor(processorConfiguration.build());
+        public Builder putProcessor(ProcessorConfiguration.Builder processorConfiguration)
{
+            return this.putProcessor(processorConfiguration.build());
         }
 
         public MailetContainer build() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 2d2275d..cb821ef 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
@@ -64,9 +64,9 @@ public class SMIMEDecryptIntegrationTest {
     @Before
     public void setup() throws Exception {
         MailetContainer mailetContainer = MailetContainer.builder()
-            .addProcessor(CommonProcessors.root())
-            .addProcessor(CommonProcessors.error())
-            .addProcessor(ProcessorConfiguration.transport()
+            .putProcessor(CommonProcessors.root())
+            .putProcessor(CommonProcessors.error())
+            .putProcessor(ProcessorConfiguration.transport()
                 .addMailet(MailetConfiguration.BCC_STRIPPER)
                 .addMailet(MailetConfiguration.builder()
                     .mailet(SMIMEDecrypt.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 ebf46f8..3870876 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
@@ -68,9 +68,9 @@ public class SMIMESignIntegrationTest {
     @Before
     public void setup() throws Exception {
         MailetContainer mailetContainer = MailetContainer.builder()
-            .addProcessor(CommonProcessors.root())
-            .addProcessor(CommonProcessors.error())
-            .addProcessor(ProcessorConfiguration.transport()
+            .putProcessor(CommonProcessors.root())
+            .putProcessor(CommonProcessors.error())
+            .putProcessor(ProcessorConfiguration.transport()
                 .addMailet(MailetConfiguration.builder()
                     .matcher(HasMailAttribute.class)
                     .matcherCondition("org.apache.james.SMIMECheckSignature")
@@ -86,11 +86,11 @@ public class SMIMESignIntegrationTest {
                     .addProperty("keyStoreType", "PKCS12")
                     .addProperty("debug", "true"))
                 .addMailet(MailetConfiguration.LOCAL_DELIVERY))
-            .addProcessor(CommonProcessors.spam())
-            .addProcessor(CommonProcessors.localAddressError())
-            .addProcessor(CommonProcessors.relayDenied())
-            .addProcessor(CommonProcessors.bounces())
-            .addProcessor(CommonProcessors.sieveManagerCheck())
+            .putProcessor(CommonProcessors.spam())
+            .putProcessor(CommonProcessors.localAddressError())
+            .putProcessor(CommonProcessors.relayDenied())
+            .putProcessor(CommonProcessors.bounces())
+            .putProcessor(CommonProcessors.sieveManagerCheck())
             .build();
 
         jamesServer = TemporaryJamesServer.builder()

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 5fef6bb..db71574 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
@@ -69,7 +69,7 @@ public class SmtpAuthorizedAddressesTest {
 
     private void createJamesServer(SmtpConfiguration.Builder smtpConfiguration) throws Exception
{
         MailetContainer.Builder mailetContainer = TemporaryJamesServer.SIMPLE_MAILET_CONTAINER_CONFIGURATION
-            .addProcessor(ProcessorConfiguration.transport()
+            .putProcessor(ProcessorConfiguration.transport()
                 .addMailetsFrom(CommonProcessors.deliverOnlyTransport())
                 .addMailet(MailetConfiguration.remoteDeliveryBuilder()
                     .matcher(SMTPIsAuthNetwork.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
index 5c43c22..a50e3ed 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
@@ -19,25 +19,26 @@
 
 package org.apache.james.transport.mailets;
 
+import static org.apache.james.mailets.configuration.Constants.DEFAULT_DOMAIN;
+import static org.apache.james.mailets.configuration.Constants.FROM;
+import static org.apache.james.mailets.configuration.Constants.IMAP_PORT;
+import static org.apache.james.mailets.configuration.Constants.LOCALHOST_IP;
+import static org.apache.james.mailets.configuration.Constants.PASSWORD;
+import static org.apache.james.mailets.configuration.Constants.RECIPIENT;
+import static org.apache.james.mailets.configuration.Constants.SMTP_PORT;
+import static org.apache.james.mailets.configuration.Constants.awaitOneMinute;
 import static org.assertj.core.api.Assertions.assertThat;
 
-import javax.mail.internet.MimeMessage;
-
-import org.apache.james.MemoryJamesServerMain;
-import org.apache.james.core.MailAddress;
 import org.apache.james.mailets.TemporaryJamesServer;
 import org.apache.james.mailets.configuration.CommonProcessors;
 import org.apache.james.mailets.configuration.MailetConfiguration;
-import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.mailets.configuration.ProcessorConfiguration;
 import org.apache.james.modules.server.ActiveMQQueueModule;
 import org.apache.james.probe.DataProbe;
 import org.apache.james.transport.matchers.All;
-import org.apache.james.transport.matchers.RecipientIsLocal;
 import org.apache.james.utils.DataProbeImpl;
 import org.apache.james.utils.IMAPMessageReader;
 import org.apache.james.utils.SMTPMessageSender;
-import org.apache.mailet.Mail;
 import org.apache.mailet.base.test.FakeMail;
 import org.apache.mailet.base.test.MimeMessageBuilder;
 import org.junit.After;
@@ -46,65 +47,33 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
-import com.jayway.awaitility.Awaitility;
-import com.jayway.awaitility.Duration;
-import com.jayway.awaitility.core.ConditionFactory;
-
 public class AddFooterTest {
-
-    private static final String LOCALHOST_IP = "127.0.0.1";
-    private static final int IMAP_PORT = 1143;
-    private static final int SMTP_PORT = 1025;
-    private static final String PASSWORD = "secret";
-
-    private static final String JAMES_APACHE_ORG = "james.org";
-
-    private static final String FROM = "fromUser@" + JAMES_APACHE_ORG;
-    private static final String RECIPIENT = "touser@" + JAMES_APACHE_ORG;
     public static final String MATCH_ME = "Match me";
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @Rule
+    public SMTPMessageSender smtpMessageSender = new SMTPMessageSender(DEFAULT_DOMAIN);
+    @Rule
+    public IMAPMessageReader imapMessageReader = new IMAPMessageReader();
 
     private TemporaryJamesServer jamesServer;
-    private ConditionFactory calmlyAwait;
 
     @Before
     public void setup() throws Exception {
-        MailetContainer mailetContainer = MailetContainer.builder()
-            .postmaster("postmaster@" + JAMES_APACHE_ORG)
-            .threads(5)
-            .addProcessor(CommonProcessors.root())
-            .addProcessor(CommonProcessors.error())
-            .addProcessor(ProcessorConfiguration.builder()
-                .state("transport")
-                .enableJmx(true)
-                .addMailet(MailetConfiguration.builder()
-                    .matcher(All.class)
-                    .mailet(RemoveMimeHeader.class)
-                    .addProperty("name", "bcc")
-                    .build())
-                .addMailet(MailetConfiguration.builder()
-                    .matcher(All.class)
-                    .mailet(AddFooter.class)
-                    .addProperty("text", MATCH_ME)
-                    .build())
-                .addMailet(MailetConfiguration.builder()
-                    .matcher(RecipientIsLocal.class)
-                    .mailet(LocalDelivery.class)
-                    .build())
-                .build())
-            .build();
-
         jamesServer = TemporaryJamesServer.builder()
-            .withBase(MemoryJamesServerMain.SMTP_AND_IMAP_MODULE)
             .withOverrides(new ActiveMQQueueModule())
-            .build(temporaryFolder, mailetContainer);
-        Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
-        calmlyAwait = Awaitility.with().pollInterval(slowPacedPollInterval).and().with().pollDelay(slowPacedPollInterval).await();
+            .withMailetContainer(TemporaryJamesServer.SIMPLE_MAILET_CONTAINER_CONFIGURATION
+                .putProcessor(ProcessorConfiguration.transport()
+                    .addMailet(MailetConfiguration.builder()
+                        .matcher(All.class)
+                        .mailet(AddFooter.class)
+                        .addProperty("text", MATCH_ME))
+                    .addMailetsFrom(CommonProcessors.transport())))
+            .build(temporaryFolder);
 
         DataProbe dataProbe = jamesServer.getProbe(DataProbeImpl.class);
-        dataProbe.addDomain(JAMES_APACHE_ORG);
+        dataProbe.addDomain(DEFAULT_DOMAIN);
         dataProbe.addUser(RECIPIENT, PASSWORD);
     }
 
@@ -115,57 +84,45 @@ public class AddFooterTest {
 
     @Test
     public void shouldAddFooterWhenSimpleMessage() throws Exception {
-        MimeMessage message = MimeMessageBuilder.mimeMessageBuilder()
-            .setText("Any content")
-            .setSubject("test")
-            .build();
-
-        Mail mail = FakeMail.builder()
-            .mimeMessage(message)
-            .sender(new MailAddress(FROM))
-            .recipient(new MailAddress(RECIPIENT))
-            .build();
-
-        try (SMTPMessageSender messageSender = SMTPMessageSender.noAuthentication(LOCALHOST_IP,
SMTP_PORT, JAMES_APACHE_ORG);
-             IMAPMessageReader imapMessageReader = new IMAPMessageReader(LOCALHOST_IP, IMAP_PORT))
{
-            messageSender.sendMessage(mail);
-            calmlyAwait.atMost(Duration.ONE_MINUTE).until(messageSender::messageHasBeenSent);
-
-            calmlyAwait.atMost(Duration.ONE_MINUTE).until(() -> imapMessageReader.userReceivedMessage(RECIPIENT,
PASSWORD));
-            String processedMessage = imapMessageReader.readFirstMessageInInbox(RECIPIENT,
PASSWORD);
-            assertThat(processedMessage).contains(MATCH_ME);
-        }
+        smtpMessageSender.connect(LOCALHOST_IP, SMTP_PORT)
+            .sendMessage(FakeMail.builder()
+                .mimeMessage(MimeMessageBuilder.mimeMessageBuilder()
+                    .setText("Any content")
+                    .setSubject("test"))
+                .sender(FROM)
+                .recipient(RECIPIENT))
+            .awaitSent(awaitOneMinute);
+
+        imapMessageReader.connect(LOCALHOST_IP, IMAP_PORT)
+            .login(RECIPIENT, PASSWORD)
+            .select(IMAPMessageReader.INBOX)
+            .awaitMessage(awaitOneMinute);
+        String processedMessage = imapMessageReader.readFirstMessage();
+        assertThat(processedMessage).contains(MATCH_ME);
     }
 
     @Test
     public void shouldAddFooterWhenMultipartMessage() throws Exception {
-        MimeMessage message = MimeMessageBuilder.mimeMessageBuilder()
-            .setMultipartWithBodyParts(
-                MimeMessageBuilder.bodyPartBuilder()
-                    .type("text/plain")
-                    .data("Text message")
-                    .build(),
-                MimeMessageBuilder.bodyPartBuilder()
-                    .data("IMAGE")
-                    .type("application/data")
-                    .build())
-            .setSubject("test")
-            .build();
-
-        Mail mail = FakeMail.builder()
-            .mimeMessage(message)
-            .sender(new MailAddress(FROM))
-            .recipient(new MailAddress(RECIPIENT))
-            .build();
-
-        try (SMTPMessageSender messageSender = SMTPMessageSender.noAuthentication(LOCALHOST_IP,
SMTP_PORT, JAMES_APACHE_ORG);
-             IMAPMessageReader imapMessageReader = new IMAPMessageReader(LOCALHOST_IP, IMAP_PORT))
{
-            messageSender.sendMessage(mail);
-            calmlyAwait.atMost(Duration.ONE_MINUTE).until(messageSender::messageHasBeenSent);
-
-            calmlyAwait.atMost(Duration.ONE_MINUTE).until(() -> imapMessageReader.userReceivedMessage(RECIPIENT,
PASSWORD));
-            String processedMessage = imapMessageReader.readFirstMessageInInbox(RECIPIENT,
PASSWORD);
-            assertThat(processedMessage).contains(MATCH_ME);
-        }
+        smtpMessageSender.connect(LOCALHOST_IP, SMTP_PORT)
+            .sendMessage(FakeMail.builder()
+                .mimeMessage(MimeMessageBuilder.mimeMessageBuilder()
+                    .setMultipartWithBodyParts(
+                        MimeMessageBuilder.bodyPartBuilder()
+                            .type("text/plain")
+                            .data("Text message"),
+                        MimeMessageBuilder.bodyPartBuilder()
+                            .data("IMAGE")
+                            .type("application/data"))
+                    .setSubject("test"))
+                .sender(FROM)
+                .recipient(RECIPIENT))
+            .awaitSent(awaitOneMinute);
+
+        imapMessageReader.connect(LOCALHOST_IP, IMAP_PORT)
+            .login(RECIPIENT, PASSWORD)
+            .select(IMAPMessageReader.INBOX)
+            .awaitMessage(awaitOneMinute);
+        String processedMessage = imapMessageReader.readFirstMessage();
+        assertThat(processedMessage).contains(MATCH_ME);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 6bf3f33..54d7a79 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
@@ -79,8 +79,8 @@ public class AmqpForwardAttachmentTest {
 
     @Before
     public void setup() throws Exception {
-        MailetContainer.Builder mailetContainer = TemporaryJamesServer.DEFAUL_MAILET_CONTAINER_CONFIGURATION
-            .addProcessor(ProcessorConfiguration.transport()
+        MailetContainer.Builder mailetContainer = TemporaryJamesServer.DEFAULT_MAILET_CONTAINER_CONFIGURATION
+            .putProcessor(ProcessorConfiguration.transport()
                 .addMailet(MailetConfiguration.builder()
                     .matcher(All.class)
                     .mailet(StripAttachment.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 aba1652..52d7bbc 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
@@ -79,9 +79,9 @@ public class ContactExtractorTest {
     @Before
     public void setup() throws Exception {
         String attribute = "ExtractedContacts";
-        MailetContainer.Builder mailets = TemporaryJamesServer.DEFAUL_MAILET_CONTAINER_CONFIGURATION
+        MailetContainer.Builder mailets = TemporaryJamesServer.DEFAULT_MAILET_CONTAINER_CONFIGURATION
             .postmaster(SENDER)
-            .addProcessor(
+            .putProcessor(
                 ProcessorConfiguration.transport()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(SMTPAuthSuccessful.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 36dc533..87e24f6 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
@@ -87,7 +87,7 @@ public class GroupMappingTest {
     @Before
     public void setup() throws Exception {
         MailetContainer.Builder mailetContainer = TemporaryJamesServer.SIMPLE_MAILET_CONTAINER_CONFIGURATION
-            .addProcessor(ProcessorConfiguration.transport()
+            .putProcessor(ProcessorConfiguration.transport()
                 .addMailet(MailetConfiguration.builder()
                     .matcher(All.class)
                     .mailet(RecipientRewriteTable.class))

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 1745adc..c697124 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
@@ -446,8 +446,8 @@ public class ICSAttachmentWorkflowTest {
 
     @Before
     public void setup() throws Exception {
-        MailetContainer.Builder mailetContainer = TemporaryJamesServer.DEFAUL_MAILET_CONTAINER_CONFIGURATION
-            .addProcessor(ProcessorConfiguration.transport()
+        MailetContainer.Builder mailetContainer = TemporaryJamesServer.DEFAULT_MAILET_CONTAINER_CONFIGURATION
+            .putProcessor(ProcessorConfiguration.transport()
                 .addMailet(MailetConfiguration.builder()
                     .matcher(All.class)
                     .mailet(StripAttachment.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java
index f20a7e2..e5b97b4 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java
@@ -71,8 +71,8 @@ public class SpamAssassinTest {
 
     @Before
     public void setup() throws Exception {
-        MailetContainer.Builder mailets = TemporaryJamesServer.DEFAUL_MAILET_CONTAINER_CONFIGURATION
-            .addProcessor(
+        MailetContainer.Builder mailets = TemporaryJamesServer.DEFAULT_MAILET_CONTAINER_CONFIGURATION
+            .putProcessor(
                 ProcessorConfiguration.transport()
                     .addMailet(MailetConfiguration.builder()
                         .matcher(All.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/55dc6ff9/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 bd17057..065db56 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
@@ -63,8 +63,8 @@ public class StripAttachmentTest {
 
     @Before
     public void setup() throws Exception {
-        MailetContainer.Builder mailetContainer = TemporaryJamesServer.DEFAUL_MAILET_CONTAINER_CONFIGURATION
-            .addProcessor(ProcessorConfiguration.transport()
+        MailetContainer.Builder mailetContainer = TemporaryJamesServer.DEFAULT_MAILET_CONTAINER_CONFIGURATION
+            .putProcessor(ProcessorConfiguration.transport()
                 .addMailet(MailetConfiguration.builder()
                     .matcher(All.class)
                     .mailet(StripAttachment.class)


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