james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [26/44] james-project git commit: JAMES-2267 Sieve integration test target mailbox should be a constant
Date Fri, 05 Jan 2018 03:01:10 GMT
JAMES-2267 Sieve integration test target mailbox should be a constant


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

Branch: refs/heads/master
Commit: 578b5f126a4297cc76aaf06cc59f9f90443395b3
Parents: ca7051a
Author: benwa <btellier@linagora.com>
Authored: Tue Dec 19 17:47:24 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Fri Jan 5 09:33:19 2018 +0700

----------------------------------------------------------------------
 .../java/org/apache/mailet/base/test/FakeMail.java |  4 ++++
 .../org/apache/james/mailets/SieveDelivery.java    | 17 ++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/578b5f12/mailet/base/src/test/java/org/apache/mailet/base/test/FakeMail.java
----------------------------------------------------------------------
diff --git a/mailet/base/src/test/java/org/apache/mailet/base/test/FakeMail.java b/mailet/base/src/test/java/org/apache/mailet/base/test/FakeMail.java
index 90acb0d..bcb59f9 100644
--- a/mailet/base/src/test/java/org/apache/mailet/base/test/FakeMail.java
+++ b/mailet/base/src/test/java/org/apache/mailet/base/test/FakeMail.java
@@ -141,6 +141,10 @@ public class FakeMail implements Mail {
             return this;
         }
 
+        public Builder recipients() {
+            return this;
+        }
+
         public Builder recipients(List<MailAddress> recipients) {
             this.recipients.addAll(recipients);
             return this;

http://git-wip-us.apache.org/repos/asf/james-project/blob/578b5f12/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 7a2d064..3364b33 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
@@ -30,7 +30,6 @@ import static org.apache.james.mailets.configuration.Constants.SMTP_PORT;
 import static org.apache.james.mailets.configuration.Constants.calmlyAwait;
 
 import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.store.probe.MailboxProbe;
 import org.apache.james.modules.MailboxProbeImpl;
 import org.apache.james.modules.protocols.SieveProbeImpl;
 import org.apache.james.probe.DataProbe;
@@ -44,6 +43,8 @@ import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
 public class SieveDelivery {
+    private static final String TARGETED_MAILBOX = "INBOX.any";
+
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
     @Rule
@@ -52,21 +53,18 @@ public class SieveDelivery {
     public SMTPMessageSender messageSender = new SMTPMessageSender(DEFAULT_DOMAIN);
 
     private TemporaryJamesServer jamesServer;
-    private String targetedMailbox;
 
     @Before
     public void setup() throws Exception {
         jamesServer = TemporaryJamesServer.builder().build(temporaryFolder);
 
-        targetedMailbox = "INBOX.any";
-
         DataProbe dataProbe = jamesServer.getProbe(DataProbeImpl.class);
         dataProbe.addDomain(DEFAULT_DOMAIN);
         dataProbe.addUser(FROM, PASSWORD);
         dataProbe.addUser(RECIPIENT, PASSWORD);
 
-        MailboxProbe mailboxProbe = jamesServer.getProbe(MailboxProbeImpl.class);
-        mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, RECIPIENT, targetedMailbox);
+        jamesServer.getProbe(MailboxProbeImpl.class)
+            .createMailbox(MailboxConstants.USER_NAMESPACE, RECIPIENT, TARGETED_MAILBOX);
     }
 
     @After
@@ -76,9 +74,10 @@ public class SieveDelivery {
 
     @Test
     public void simpleMailShouldBeSent() throws Exception {
-        jamesServer.getProbe(SieveProbeImpl.class).addActiveSieveScript(RECIPIENT, "myscript.sieve",
"require \"fileinto\";\n" +
+        jamesServer.getProbe(SieveProbeImpl.class).addActiveSieveScript(RECIPIENT, "myscript.sieve",
+            "require \"fileinto\";\n" +
             "\n" +
-            "fileinto \"" + targetedMailbox + "\";");
+            "fileinto \"" + TARGETED_MAILBOX + "\";");
 
         messageSender.connect(LOCALHOST_IP, SMTP_PORT)
             .sendMessage(FROM, RECIPIENT)
@@ -86,7 +85,7 @@ public class SieveDelivery {
 
         imapMessageReader.connect(LOCALHOST_IP, IMAP_PORT)
             .login(RECIPIENT, PASSWORD)
-            .select(targetedMailbox)
+            .select(TARGETED_MAILBOX)
             .awaitMessage(calmlyAwait.atMost(ONE_MINUTE));
     }
 }


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