Package org.apache.james.imap.message.response

Examples of org.apache.james.imap.message.response.NamespaceResponse


    @Test
    public void testNamespaceResponseIsAcceptable() throws Exception {
        assertFalse(subject.isAcceptable(context.mock(ImapMessage.class)));
        assertTrue(subject
                .isAcceptable(new NamespaceResponse(null, null, null)));
    }
View Full Code Here


        super(next);
    }

    @Override
    protected void doEncode(ImapMessage acceptableMessage, ImapResponseComposer composer, ImapSession session) throws IOException {
        final NamespaceResponse response = (NamespaceResponse) acceptableMessage;
        composer.untagged();
        composer.commandName(ImapConstants.NAMESPACE_COMMAND_NAME);

        final List<NamespaceResponse.Namespace> personal = response.getPersonal();
        encode(personal, composer);
        final List<NamespaceResponse.Namespace> users = response.getUsers();
        encode(users, composer);
        final List<NamespaceResponse.Namespace> shared = response.getShared();
        encode(shared, composer);

        composer.end();
    }
View Full Code Here

            ignoring(mailboxSessionStub);
            ignoring(mailboxManagerStub);
            ignoring(statusResponseStub);
        }});
       
        final NamespaceResponse response = buildResponse(null);
       
        final Responder responderMock = expectResponse(response);
       
        subject.doProcess(namespaceRequest, responderMock, imapSessionStub);
    }
View Full Code Here

        this.sharedSpaces.add(sharedSpaceStub);
       
       
        final List<NamespaceResponse.Namespace> sharedSpaces = new ArrayList<NamespaceResponse.Namespace>();
        sharedSpaces.add(new NamespaceResponse.Namespace(SHARED_PREFIX, MailboxConstants.DEFAULT_DELIMITER));
        final NamespaceResponse response = buildResponse(sharedSpaces);
       
        final Responder responderMock = expectResponse(response);
       
        subject.doProcess(namespaceRequest, responderMock, imapSessionStub);
    }
View Full Code Here

        final List<NamespaceResponse.Namespace> personalSpaces = new ArrayList<NamespaceResponse.Namespace>();
        personalSpaces.add(new NamespaceResponse.Namespace(PERSONAL_PREFIX, MailboxConstants.DEFAULT_DELIMITER));
        final List<NamespaceResponse.Namespace> otherUsersSpaces = new ArrayList<NamespaceResponse.Namespace>();
        otherUsersSpaces.add(new NamespaceResponse.Namespace(USERS_PREFIX, MailboxConstants.DEFAULT_DELIMITER));
       
        final NamespaceResponse response = new NamespaceResponse(personalSpaces, otherUsersSpaces, sharedSpaces);
        return response;
    }
View Full Code Here

TOP

Related Classes of org.apache.james.imap.message.response.NamespaceResponse

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.