Package org.apache.james.mailbox

Examples of org.apache.james.mailbox.MailboxQuery


    private static final String BASE = "BASE";
    private static final MailboxPath BASE_PATH = new MailboxPath(null, null, BASE);


    private MailboxQuery create(String expression) {
        return new MailboxQuery(BASE_PATH, expression, '.');
    }
View Full Code Here


        assertFalse(create("ONE").isWild());
    }

    @Test
    public void testCombinedNameEmptyPart() throws Exception {
        MailboxQuery expression = new MailboxQuery(BASE_PATH, "", '.');
        assertEquals(BASE, expression.getCombinedName());
    }
View Full Code Here

        assertEquals(BASE, expression.getCombinedName());
    }

    @Test
    public void testNullCombinedName() throws Exception {
        MailboxQuery expression = new MailboxQuery(new MailboxPath(null, null, null), null, '.');
        assertNotNull(expression.getCombinedName());
    }
View Full Code Here

        assertNotNull(expression.getCombinedName());
    }

    @Test
    public void testSimpleCombinedName() throws Exception {
        MailboxQuery expression = create(PART);
        assertEquals(BASE + "." + PART, expression.getCombinedName());
    }
View Full Code Here

        assertEquals(BASE + "." + PART, expression.getCombinedName());
    }

    @Test
    public void testCombinedNamePartStartsWithDelimiter() throws Exception {
        MailboxQuery expression = create("." + PART);
        assertEquals(BASE + "." + PART, expression.getCombinedName());
    }
View Full Code Here

        assertEquals(BASE + "." + PART, expression.getCombinedName());
    }

    @Test
    public void testCombinedNameBaseEndsWithDelimiter() throws Exception {
        MailboxQuery expression = new MailboxQuery(new MailboxPath(null, null, BASE + '.'), PART, '.');
        assertEquals(BASE + "." + PART, expression.getCombinedName());
    }
View Full Code Here

    }

    @Test
    public void testCombinedNameBaseEndsWithDelimiterPartStarts()
            throws Exception {
        MailboxQuery expression = new MailboxQuery(new MailboxPath(null, null, BASE + '.'), '.' + PART, '.');
        assertEquals(BASE + "." + PART, expression.getCombinedName());
    }
View Full Code Here

        assertEquals(BASE + "." + PART, expression.getCombinedName());
    }

    @Test
    public void testSimpleExpression() throws Exception {
        MailboxQuery expression = create(PART);
        assertTrue(expression.isExpressionMatch(PART));
        assertFalse(expression.isExpressionMatch('.' + PART));
        assertFalse(expression.isExpressionMatch(PART + '.'));
        assertFalse(expression.isExpressionMatch(SECOND_PART));
    }
View Full Code Here

        assertFalse(expression.isExpressionMatch(SECOND_PART));
    }

    @Test
    public void testEmptyExpression() throws Exception {
        MailboxQuery expression = create("");
        assertTrue(expression.isExpressionMatch(""));
        assertFalse(expression.isExpressionMatch("whatever"));
        assertFalse(expression.isExpressionMatch(BASE + '.' + "whatever"));
        assertFalse(expression.isExpressionMatch(BASE + "whatever"));
    }
View Full Code Here

        assertFalse(expression.isExpressionMatch(BASE + "whatever"));
    }

    @Test
    public void testOnlyLocalWildcard() throws Exception {
        MailboxQuery expression = create("%");
        assertTrue(expression.isExpressionMatch(""));
        assertTrue(expression.isExpressionMatch(SECOND_PART));
        assertTrue(expression.isExpressionMatch(PART));
        assertTrue(expression.isExpressionMatch(PART + SECOND_PART));
        assertFalse(expression.isExpressionMatch(PART + '.' + SECOND_PART));
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.MailboxQuery

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.