MAILBOX-270: Handle the input as binary and octet data
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/68fe3475 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/68fe3475 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/68fe3475 Branch: refs/heads/master Commit: 68fe3475c5f85cb27202b5ed4d478abac628b07c Parents: 5ae5c9e Author: Quynh Nguyen <[email protected]> Authored: Mon Sep 12 11:23:19 2016 +0700 Committer: Quynh Nguyen <[email protected]> Committed: Wed Nov 9 11:39:49 2016 +0700 ---------------------------------------------------------------------- .../imapmailbox/suite/MailboxAnnotation.java | 13 ++++++-- .../imap/scripts/AnnotationWithBinaryData.test | 34 ++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/68fe3475/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java ---------------------------------------------------------------------- diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java index 40a2377..94211c4 100644 --- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java +++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java @@ -28,6 +28,7 @@ import org.apache.james.mpt.api.ImapFeatures; import org.apache.james.mpt.api.ImapHostSystem; import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedInbox; import org.junit.Assume; +import org.junit.Before; import org.junit.Test; public class MailboxAnnotation extends BaseSelectedInbox { @@ -38,15 +39,23 @@ public class MailboxAnnotation extends BaseSelectedInbox { super(system); } + @Before + public void setup() throws Exception { + Assume.assumeTrue(system.supports(ImapFeatures.Feature.ANNOTATION_SUPPORT)); + } + @Test public void testAnnotationUS() throws Exception { - Assume.assumeTrue(system.supports(ImapFeatures.Feature.ANNOTATION_SUPPORT)); scriptTest("Annotation", Locale.US); } @Test public void testAnnotationWithLimitationUS() throws Exception { - Assume.assumeTrue(system.supports(ImapFeatures.Feature.ANNOTATION_SUPPORT)); scriptTest("AnnotationWithLimitation", Locale.US); } + + @Test + public void testAnnotationWithBinaryValue() throws Exception { + scriptTest("AnnotationWithBinaryData", Locale.US); + } } http://git-wip-us.apache.org/repos/asf/james-project/blob/68fe3475/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AnnotationWithBinaryData.test ---------------------------------------------------------------------- diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AnnotationWithBinaryData.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AnnotationWithBinaryData.test new file mode 100644 index 0000000..b16a81d --- /dev/null +++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AnnotationWithBinaryData.test @@ -0,0 +1,34 @@ +################################################################ +# Licensed to the Apache Software Foundation (ASF) under one # +# or more contributor license agreements. See the NOTICE file # +# distributed with this work for additional information # +# regarding copyright ownership. The ASF licenses this file # +# to you under the Apache License, Version 2.0 (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, # +# software distributed under the License is distributed on an # +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # +# KIND, either express or implied. See the License for the # +# specific language governing permissions and limitations # +# under the License. # +################################################################ +C: a0 CAPABILITY +S: \* CAPABILITY .* ANNOTATION .* +S: a0 OK CAPABILITY completed. + +C: a1 SETMETADATA INBOX (/private/comment {169} +S: \+ +C: Content-Type: image/jpeg +C: Content-Transfer-Encoding: base64 +C: R0lGODlhMQL1APAAAAAAAAAAACH5BAEAAAEALAAAAAAxAvUAAAL-jI-py-0PF5gUxIuz3rz7D4biSJbmiabqqlZuxcbyTNf2jef6zkfvT-kJ) +S: a1 OK SETMETADATA completed. + +C: a2 GETMETADATA INBOX /private/comment +S: \* METADATA "INBOX" \(\/private\/comment "Content-Type: image/jpeg +S: Content-Transfer-Encoding: base64 +S: R0lGODlhMQL1APAAAAAAAAAAACH5BAEAAAEALAAAAAAxAvUAAAL-jI-py-0PF5gUxIuz3rz7D4biSJbmiabqqlZuxcbyTNf2jef6zkfvT-kJ"\) +S: a2 OK GETMETADATA completed. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
