Package org.apache.james.mailbox.model

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


        assertFalse(it4.hasNext());
    }
   
    @Test
    public void testSortSentDate() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.SentDate, false)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(2L, it4.next().longValue());
        assertEquals(3L, it4.next().longValue());
        assertEquals(1L, it4.next().longValue());
View Full Code Here


        assertFalse(it4.hasNext());
    }
   
    @Test
    public void testSortSentDateReverse() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.SentDate, true)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(1L, it4.next().longValue());
        assertEquals(3L, it4.next().longValue());
        assertEquals(2L, it4.next().longValue());
View Full Code Here

        assertEquals(2L, it4.next().longValue());
        assertFalse(it4.hasNext());
    }
    @Test
    public void testSortBaseSubject() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.BaseSubject, false)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(2L, it4.next().longValue());
        assertEquals(1L, it4.next().longValue());
        assertEquals(3L, it4.next().longValue());
View Full Code Here

        assertFalse(it4.hasNext());
    }
   
    @Test
    public void testSortBaseSubjectReverse() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.BaseSubject, true)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(3L, it4.next().longValue());
        assertEquals(1L, it4.next().longValue());
        assertEquals(2L, it4.next().longValue());
View Full Code Here

        assertFalse(it4.hasNext());
    }
   
    @Test
    public void testSortMailboxFrom() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.MailboxFrom, false)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(2L, it4.next().longValue());
        assertEquals(3L, it4.next().longValue());
        assertEquals(1L, it4.next().longValue());
View Full Code Here

        assertFalse(it4.hasNext());
    }
   
    @Test
    public void  testSortMailboxFromReverse() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.MailboxFrom, true)));
        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(1L, it4.next().longValue());
        assertEquals(3L, it4.next().longValue());
        assertEquals(2L, it4.next().longValue());
View Full Code Here

    }
   
   
    @Test
    public void testSortMailboxCc() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.MailboxCc, false)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(1L, it4.next().longValue());
        assertEquals(2L, it4.next().longValue());
        assertEquals(3L, it4.next().longValue());
View Full Code Here

        assertFalse(it4.hasNext());
    }
   
    @Test
    public void  testSortMailboxCcReverse() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.MailboxCc, true)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(2L, it4.next().longValue());
        assertEquals(3L, it4.next().longValue());
View Full Code Here

        assertFalse(it4.hasNext());
    }
   
    @Test
    public void testSortMailboxTo() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.MailboxTo, false)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);

        assertEquals(3L, it4.next().longValue());
        assertEquals(1L, it4.next().longValue());
View Full Code Here

        assertFalse(it4.hasNext());
    }
   
    @Test
    public void  testSortMailboxToReverse() throws Exception {
        SearchQuery q2 = new SearchQuery();
        q2.andCriteria(SearchQuery.all());
        q2.setSorts(Arrays.asList(new SearchQuery.Sort(SortClause.MailboxTo, true)));

        Iterator<Long> it4 = index.search(null, mailbox, q2);
        assertEquals(2L, it4.next().longValue());
        assertEquals(1L, it4.next().longValue());
        assertEquals(3L, it4.next().longValue());
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.model.SearchQuery

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.