org.apache.james.imap.scripts.StringArgs.test Maven / Gradle / Ivy
################################################################
# 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. #
################################################################
# The following tests check the parsing of string arguments of various formats.
# The STATUS command is used for testing all types of string arguments.
# The argument of the STATUS command is of type "mailbox", which
# may be either (case-insensitive) "INBOX" or an "astring". "astring", in turn,
# may be an "atom", a "quoted" string, or a "literal" ( format "{xxx[+]}\nXXXX" )
# INBOX special case
C: a001 STATUS INBOX (MESSAGES)
S: \* STATUS \"INBOX\" \(MESSAGES \d+\)
S: a001 OK STATUS completed.
# Case-insensitive inbox
C: a001 STATUS InBoX (MESSAGES)
S: \* STATUS \"INBOX\" \(MESSAGES \d+\)
S: a001 OK STATUS completed.
# Tests with an atomic mailbox name.
C: a1 CREATE atomMailbox
S: a1 OK CREATE completed.
# atom
C: a001 STATUS atomMailbox (MESSAGES)
S: \* STATUS \"atomMailbox\" \(MESSAGES \d+\)
S: a001 OK STATUS completed.
# quoted
C: a001 STATUS "atomMailbox" (MESSAGES)
S: \* STATUS \"atomMailbox\" \(MESSAGES \d+\)
S: a001 OK STATUS completed.
# non-synchronized literal
C: a001 STATUS {11}
S: \+
C: atomMailbox (MESSAGES)
S: \* STATUS \"atomMailbox\" \(MESSAGES \d+\)
S: a001 OK STATUS completed.
# synchronized literal
C: a001 STATUS {11+}
C: atomMailbox (MESSAGES)
S: \* STATUS \"atomMailbox\" \(MESSAGES \d+\)
S: a001 OK STATUS completed.
# Cleanup
C: a1 DELETE atomMailbox
S: a1 OK DELETE completed.