Examples of ImapMailbox


Examples of org.apache.james.imapserver.store.ImapMailbox

     * Tests creation of mailboxes in the Store.
     */
    public void testCreate() throws Exception
    {
        // Get the user namespace.
        ImapMailbox root = imapStore.getMailbox( ImapConstants.USER_NAMESPACE );

        // Create a single mailbox.
        ImapMailbox test = create( root, "test" );
        assertMailbox( "test", true );

        // Create a single mailbox as noselect.
        ImapMailbox noSelect = imapStore.createMailbox( root, "noSelect", false );
        assertMailbox( "noSelect", false );

        // Create children for these mailboxes.
        create( test, "child" );
        create( noSelect, "child" );
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

        delete( "test" );
        assertNoMailbox( "test");

        // Create a chain and attempt to delete the parent.
        ImapMailbox one = create( "one" );
        create( one, "two" );
        assertMailbox( "one", true );
        assertMailbox( "one.two", true );

        try {
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

        coll = list("*");
        assertTrue( coll.isEmpty() );
        coll = list("%");
        assertTrue( coll.isEmpty() );

        ImapMailbox test = create( "test" );
        ImapMailbox testOne = create( test, "one" );
        ImapMailbox testTwo = create( test, "two" );
        ImapMailbox testTwoAaa = create( testTwo, "aaa" );
        ImapMailbox different = create( "different" );
        ImapMailbox differentOne = create( different, "one" );
        ImapMailbox differentTwo = create( different, "two" );

        coll = list("*");
        assertContents( coll, new ImapMailbox[]{test, testOne, testTwo, testTwoAaa, different, differentOne, differentTwo});

        coll = list("%");
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

     * Checks that a mailbox with the supplied name exists, and that its
     * NoSelect flag matches that expected.
     */
    private void assertMailbox( String name, boolean selectable )
    {
        ImapMailbox mailbox = imapStore.getMailbox( prefixUserNamespace( name ) );
        assertNotNull( "Mailbox <" + name + "> expected to exist in store.",
                       mailbox );
        if ( selectable )
        {
            assertTrue( "Mailbox <" + name + "> not selectable.",
                        mailbox.isSelectable() );
        }
        else
        {
            assertTrue( "Mailbox <" + name + "> should not be selectable.",
                        ! mailbox.isSelectable() );
        }
    }
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

    /**
     * Asserts that a mailbox with the supplied name doesn't exist.
     */
    private void assertNoMailbox( String name )
    {
        ImapMailbox mailbox = imapStore.getMailbox( prefixUserNamespace( name ));
        assertNull( "Mailbox <" + name + "> should not exist.",
                    mailbox );
    }
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

    /**
     * Creates a mailbox with the specified name in the root user namespace.
     */
    private ImapMailbox create( String name ) throws Exception
    {
        ImapMailbox root = imapStore.getMailbox( USER_NAMESPACE );
        return create( root, name );
    }
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

    /**
     * Deletes a mailbox from the store.
     */
    private void delete( String name ) throws MailboxException
    {
        ImapMailbox mailbox = imapStore.getMailbox( prefixUserNamespace( name ) );
        imapStore.deleteMailbox( mailbox );
    }
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

        super( s );
    }

    public void testAppend() throws Exception
    {
        ImapMailbox mailbox = getMailbox();

        MessageFlags flags = new MessageFlags();
        flags.setFlagged( true );

        Date datetime = new Date();
        String message =
        "Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)\r\n" +
        "From: Fred Foobar <foobar@Blurdybloop.COM>\r\n" +
        "Subject: afternoon meeting\r\n" +
        "To: mooch@owatagu.siam.edu\r\n" +
        "Message-Id: <B27397-0100000@Blurdybloop.COM>\r\n" +
        "MIME-Version: 1.0\r\n" +
        "Content-Type: TEXT/PLAIN; CHARSET=US-ASCII\r\n" +
        "\r\n" +
        "Hello Joe, do you think we can meet at 3:30 tomorrow?\r\n" +
        "\r\n";
        long uid = appendMessage( message, flags, datetime, mailbox );

        SimpleImapMessage imapMessage = mailbox.getMessage( uid );

        assertEquals( 1, mailbox.getMessageCount() );
        assertTrue( imapMessage.getFlags().isFlagged() );
        assertTrue( ! imapMessage.getFlags().isAnswered() );

        MimeMessage mime = imapMessage.getMimeMessage();
        assertEquals( "TEXT/PLAIN; CHARSET=US-ASCII", mime.getContentType() );
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

    }

    private ImapMailbox getMailbox() throws MailboxException
    {
        ImapStore store = new InMemoryStore();
        ImapMailbox root = store.getMailbox( ImapConstants.USER_NAMESPACE );
        ImapMailbox test = store.createMailbox( root, "test", true );
        return test;
    }
View Full Code Here

Examples of org.apache.james.imapserver.store.ImapMailbox

     * Checks that a mailbox with the supplied name exists, and that its
     * NoSelect flag matches that expected.
     */
    private void assertMailbox( String name, boolean selectable ) throws MailboxException
    {
        ImapMailbox mailbox = imapHost.getMailbox( user, name );
        assertNotNull( "Mailbox <" + name + "> expected to exist in store.",
                       mailbox );
        if ( selectable )
        {
            assertTrue( "Mailbox <" + name + "> not selectable.",
                        mailbox.isSelectable() );
        }
        else
        {
            assertTrue( "Mailbox <" + name + "> should not be selectable.",
                        ! mailbox.isSelectable() );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.