Package org.apache.james.imap.api.message.request

Examples of org.apache.james.imap.api.message.request.SearchKey


        checkInvalid("senton 1-Jan-\r\n", key);
    }

    @Test
    public void testShouldParseSentSince() throws Exception {
        SearchKey key = SearchKey.buildSentSince(DATE);
        checkValid("SENTSINCE 1-Jan-2000\r\n", key);
        checkValid("sentsince 1-Jan-2000\r\n", key);
        checkValid("SentSince 1-Jan-2000\r\n", key);
        checkInvalid("s\r\n", key);
        checkInvalid("se\r\n", key);
View Full Code Here


        checkInvalid("sentsince 1-Jan-\r\n", key);
    }

    @Test
    public void testShouldParseSince() throws Exception {
        SearchKey key = SearchKey.buildSince(DATE);
        checkValid("SINCE 1-Jan-2000\r\n", key);
        checkValid("since 1-Jan-2000\r\n", key);
        checkValid("Since 1-Jan-2000\r\n", key);
        checkInvalid("s \r\n", key);
        checkInvalid("si \r\n", key);
View Full Code Here

        checkInvalid("since 1-Jan-\r\n", key);
    }

    @Test
    public void testShouldParseBefore() throws Exception {
        SearchKey key = SearchKey.buildBefore(DATE);
        checkValid("BEFORE 1-Jan-2000\r\n", key);
        checkValid("before 1-Jan-2000\r\n", key);
        checkValid("BEforE 1-Jan-2000\r\n", key);
        checkInvalid("b\r\n", key);
        checkInvalid("B\r\n", key);
View Full Code Here

        checkInvalid("BEforE 1-Jan-\r\n", key);
    }

    @Test
    public void testShouldParseBody() throws Exception {
        SearchKey key = SearchKey.buildBody("Text");
        checkValid("BODY Text\r\n", key);
        checkValid("BODY \"Text\"\r\n", key);
        checkValid("body Text\r\n", key);
        checkValid("body \"Text\"\r\n", key);
        checkValid("BodY Text\r\n", key);
View Full Code Here

        checkInvalid("Bodym\r\n", key);
    }

    @Test
    public void testShouldParseTo() throws Exception {
        SearchKey key = SearchKey.buildTo("AnAddress");
        checkValid("TO AnAddress\r\n", key);
        checkValid("TO \"AnAddress\"\r\n", key);
        checkValid("to AnAddress\r\n", key);
        checkValid("to \"AnAddress\"\r\n", key);
        checkValid("To AnAddress\r\n", key);
View Full Code Here

        checkInvalid("to \r\n", key);
    }

    @Test
    public void testShouldParseText() throws Exception {
        SearchKey key = SearchKey.buildText("SomeText");
        checkValid("TEXT SomeText\r\n", key);
        checkValid("TEXT \"SomeText\"\r\n", key);
        checkValid("text SomeText\r\n", key);
        checkValid("text \"SomeText\"\r\n", key);
        checkValid("Text SomeText\r\n", key);
View Full Code Here

        checkInvalid("text \r\n", key);
    }

    @Test
    public void testShouldParseSubject() throws Exception {
        SearchKey key = SearchKey.buildSubject("ASubject");
        checkValid("SUBJECT ASubject\r\n", key);
        checkValid("SUBJECT \"ASubject\"\r\n", key);
        checkValid("subject ASubject\r\n", key);
        checkValid("subject \"ASubject\"\r\n", key);
        checkValid("Subject ASubject\r\n", key);
View Full Code Here

        checkInvalid("subject \r\n", key);
    }

    @Test
    public void testShouldParseCc() throws Exception {
        SearchKey key = SearchKey.buildCc("SomeText");
        checkValid("CC SomeText\r\n", key);
        checkValid("CC \"SomeText\"\r\n", key);
        checkValid("cc SomeText\r\n", key);
        checkValid("cc \"SomeText\"\r\n", key);
        checkValid("Cc SomeText\r\n", key);
View Full Code Here

        checkInvalid("ccc\r\n", key);
    }

    @Test
    public void testShouldParseFrom() throws Exception {
        SearchKey key = SearchKey.buildFrom("Someone");
        checkValid("FROM Someone\r\n", key);
        checkValid("FROM \"Someone\"\r\n", key);
        checkValid("from Someone\r\n", key);
        checkValid("from \"Someone\"\r\n", key);
        checkValid("FRom Someone\r\n", key);
View Full Code Here

        checkInvalid("froml\r\n", key);
    }

    @Test
    public void testShouldParseKeyword() throws Exception {
        SearchKey key = SearchKey.buildKeyword("AFlag");
        checkValid("KEYWORD AFlag\r\n", key);
        checkInvalid("KEYWORD \"AFlag\"\r\n", key);
        checkValid("keyword AFlag\r\n", key);
        checkInvalid("keyword \"AFlag\"\r\n", key);
        checkValid("KEYword AFlag\r\n", key);
View Full Code Here

TOP

Related Classes of org.apache.james.imap.api.message.request.SearchKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.