Package org.apache.james.mailbox

Examples of org.apache.james.mailbox.MailboxQuery


        assertFalse(expression.isExpressionMatch(PART + '.' + SECOND_PART));
    }

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


        assertTrue(expression.isExpressionMatch(PART + '.' + SECOND_PART));
    }

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

        assertFalse(expression.isExpressionMatch(PART + '.' + SECOND_PART));
    }

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

        assertFalse(expression.isExpressionMatch(SECOND_PART));
    }

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

        assertFalse(expression.isExpressionMatch(SECOND_PART + "w.hat.eve.r" + PART));
    }

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

        assertTrue(expression.isExpressionMatch(PART + '.' + SECOND_PART));
    }

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

        assertFalse(expression.isExpressionMatch(SECOND_PART));
    }

    @Test
    public void testContainsFreeWildcard() throws Exception {
        MailboxQuery expression = create(SECOND_PART + '*' + PART);
        assertFalse(expression.isExpressionMatch(""));
        assertFalse(expression.isExpressionMatch(SECOND_PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + '.' + PART));
        assertFalse(expression.isExpressionMatch(PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + "w.hat.eve.r" + PART));
    }
View Full Code Here

        assertTrue(expression.isExpressionMatch(SECOND_PART + "w.hat.eve.r" + PART));
    }

    @Test
    public void testDoubleFreeWildcard() throws Exception {
        MailboxQuery expression = create(SECOND_PART + "**" + PART);
        assertFalse(expression.isExpressionMatch(""));
        assertFalse(expression.isExpressionMatch(SECOND_PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + '.' + PART));
        assertFalse(expression.isExpressionMatch(PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + "w.hat.eve.r" + PART));
    }
View Full Code Here

        assertTrue(expression.isExpressionMatch(SECOND_PART + "w.hat.eve.r" + PART));
    }

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

        assertTrue(expression.isExpressionMatch(SECOND_PART + "w.hat.eve.r" + PART));
    }

    @Test
    public void testLocalFreeWildcard() throws Exception {
        MailboxQuery expression = create(SECOND_PART + "%*" + PART);
        assertFalse(expression.isExpressionMatch(""));
        assertFalse(expression.isExpressionMatch(SECOND_PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + '.' + PART));
        assertFalse(expression.isExpressionMatch(PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + "w.hat.eve.r" + 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.