JAMES-1898 Add integration test for duplicated attachment
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/1c27eb6d Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/1c27eb6d Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/1c27eb6d Branch: refs/heads/master Commit: 1c27eb6d6abcd73664b57f360e55ceb222d9b719 Parents: 4ed7c60 Author: Benoit Tellier <btell...@linagora.com> Authored: Mon Dec 26 16:16:42 2016 +0700 Committer: Benoit Tellier <btell...@linagora.com> Committed: Mon Dec 26 16:21:49 2016 +0700 ---------------------------------------------------------------------- .../cucumber/GetMessagesMethodStepdefs.java | 5 ++ .../test/resources/cucumber/GetMessages.feature | 8 +- .../test/resources/eml/twoSameAttachments.eml | 77 ++++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/1c27eb6d/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java index f699b51..26b1e29 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java @@ -152,6 +152,11 @@ public class GetMessagesMethodStepdefs { appendMessage(messageName, "eml/twoAttachmentsTextPlain.eml"); } + @Given("^the user has a message \"([^\"]*)\" in \"([^\"]*)\" mailbox with two same attachments in text$") + public void appendTextMessageWithTwoSameAttachments(String messageName, String mailbox) throws Throwable { + appendMessage(messageName, "eml/twoSameAttachments.eml"); + } + @Given("^the user has a multipart message \"([^\"]*)\" in \"([^\"]*)\" mailbox$") public void appendMultipartMessageWithOneAttachments(String messageName, String arg1) throws Throwable { appendMessage(messageName, "eml/htmlAndTextMultipartWithOneAttachment.eml"); http://git-wip-us.apache.org/repos/asf/james-project/blob/1c27eb6d/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature index 6d78cfd..a559e08 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature @@ -202,9 +202,15 @@ Feature: GetMessages method And the textBody of the message is "Hello text body\n" And the htmlBody of the message is "<html>Hello html body</html>\n" -Scenario: Retrieving message with more than 1000 char by line should return message when exists + Scenario: Retrieving message with more than 1000 char by line should return message when exists Given the user has a message "m1" in "inbox" mailbox beginning by a long line When the user ask for messages "m1" Then no error is returned And the list should contain 1 message And the id of the message is "m1" + + Scenario: + Given the user has a message "m1" in "inbox" mailbox with two same attachments in text + When the user ask for messages "m1" + Then no error is returned + And the list of attachments of the message contains 2 attachments \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/1c27eb6d/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoSameAttachments.eml ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoSameAttachments.eml b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoSameAttachments.eml new file mode 100644 index 0000000..b76a6fe --- /dev/null +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/twoSameAttachments.eml @@ -0,0 +1,77 @@ +Return-Path: <f...@linagora.com> +Received: from alderaan.linagora.com (smtp.linagora.dc1 [172.16.18.53]) + by imap (Cyrus v2.2.13-Debian-2.2.13-19+squeeze3) with LMTPA; + Fri, 27 Feb 2015 20:32:14 +0100 +X-Sieve: CMU Sieve 2.2 +Received: from canondir.par.lng (unknown [92.103.166.6]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by alderaan.linagora.com (Postfix) with ESMTPSA id BAB0D728 + for <t...@linagora.com>; Fri, 27 Feb 2015 20:31:38 +0100 (CET) +X-Priority: 3 (Normal) +From: "From" + <f...@linagora.com> +To: "To" + <t...@linagora.com> +Subject: [8/10]Attached Image light with text +Date: Fri, 27 Mar 2015 21:48:38 +0100 +Message-Id: <20150227203838.0011.canontxno.4...@canondir.par.lng> +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="AHNPACBLDCDIDAGGGDDFAABECGCA" + +--AHNPACBLDCDIDAGGGDDFAABECGCA +Content-Type: text/html; charset=utf-8; format=flowed +Content-Transfer-Encoding: 8bit + +<b>html</b> + +--AHNPACBLDCDIDAGGGDDFAABECGCA +Content-Type: image/jpeg; + name="4037_014.jpg" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="4037_014.jpg" + +/9j/4X2cRXhpZgAASUkqAAgAAAANAA8BAgAKAAAAqgAAABABAgAJAAAAtAAAABIBAwABAAAA +AQAAABoBBQABAAAAvgAAABsBBQABAAAAxgAAACgBAwABAAAAAgAAADEBAgAKAAAAzgAAADIB +AgAUAAAA2AAAABMCAwABAAAAAgAAAGmHBAABAAAAfAIAAKXEBwDQAAAA7AAAANLGBwBAAAAA +vAEAANPGBwCAAAAA/AEAAEwqAABQYW5hc29uaWMARE1DLUZaNDUAALQAAAABAAAAtAAAAAEA +AABWZXIuMS4wICAAMjAxNDowMjoyNSAxMDozMjowOQBQcmludElNADAyNTAAAA4AAQAWABYA +AgAAAAAAAwBkAAAABwAAAAAACAAAAAAACQAAAAAACgAAAAAACwCsAAAADAAAAAAADQAAAAAA +DgDEAAAAAAEFAAAAAQEBAAAAEAGAAAAACREAABAnAAALDwAAECcAAJcFAAAQJwAAsAgAABAn +AAABHAAAECcAAF4CAAAQJwAAiwAAABAnAADLAwAAECcAAOUbAAAQJwAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + +--AHNPACBLDCDIDAGGGDDFAABECGCA +Content-Type: image/jpeg; + name="4037_014.jpg" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="4037_014.jpg" + +/9j/4X2cRXhpZgAASUkqAAgAAAANAA8BAgAKAAAAqgAAABABAgAJAAAAtAAAABIBAwABAAAA +AQAAABoBBQABAAAAvgAAABsBBQABAAAAxgAAACgBAwABAAAAAgAAADEBAgAKAAAAzgAAADIB +AgAUAAAA2AAAABMCAwABAAAAAgAAAGmHBAABAAAAfAIAAKXEBwDQAAAA7AAAANLGBwBAAAAA +vAEAANPGBwCAAAAA/AEAAEwqAABQYW5hc29uaWMARE1DLUZaNDUAALQAAAABAAAAtAAAAAEA +AABWZXIuMS4wICAAMjAxNDowMjoyNSAxMDozMjowOQBQcmludElNADAyNTAAAA4AAQAWABYA +AgAAAAAAAwBkAAAABwAAAAAACAAAAAAACQAAAAAACgAAAAAACwCsAAAADAAAAAAADQAAAAAA +DgDEAAAAAAEFAAAAAQEBAAAAEAGAAAAACREAABAnAAALDwAAECcAAJcFAAAQJwAAsAgAABAn +AAABHAAAECcAAF4CAAAQJwAAiwAAABAnAADLAwAAECcAAOUbAAAQJwAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + +--AHNPACBLDCDIDAGGGDDFAABECGCA --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org