Package org.apache.james.mailbox.model

Examples of org.apache.james.mailbox.model.MailboxQuery


                + SECOND_PART.substring(1)));
    }

    @Test
    public void testSimpleMixedWildcards() throws Exception {
        MailboxQuery expression = create(SECOND_PART + '%' + PART + '*'
                + SECOND_PART);
        assertTrue(expression.isExpressionMatch(SECOND_PART + PART
                + SECOND_PART));
        assertFalse(expression.isExpressionMatch(SECOND_PART + '.' + PART
                + SECOND_PART));
        assertTrue(expression.isExpressionMatch(SECOND_PART + PART + '.'
                + SECOND_PART));
       
        // Disable this tests as these are wrong. See MAILBOX-65
        //assertTrue(expression.isExpressionMatch(SECOND_PART + PART
        //        + SECOND_PART + "Whatever"));
View Full Code Here


        //        + SECOND_PART + ".Whatever."));
    }

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

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

        assertTrue(expression.isExpressionMatch(PART + '.' + SECOND_PART));
    }
   
    @Test
    public void testMailbox65() throws Exception {
        MailboxQuery expression = create("*.test");
        assertTrue(expression.isExpressionMatch("blah.test"));
        assertFalse(expression.isExpressionMatch("blah.test.go"));

        assertFalse(expression.isExpressionMatch("blah.test3"));

    }
View Full Code Here

    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

TOP

Related Classes of org.apache.james.mailbox.model.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.