Package org.apache.james.test.mock.mailet

Examples of org.apache.james.test.mock.mailet.MockMailContext


    }

    private void setupMatcher() throws MessagingException {
        matcher = new All();
        MockMatcherConfig mci = new MockMatcherConfig("All",
                new MockMailContext());
        matcher.init(mci);
    }
View Full Code Here


    private void setupMatcher() throws MessagingException {
        setupMockedMimeMessage();
        matcher = new HasMailAttributeWithValueRegex();
        MockMatcherConfig mci = new MockMatcherConfig("HasMailAttribute="
                + MAIL_ATTRIBUTE_NAME + ", " + regex, new MockMailContext());
        matcher.init(mci);
    }
View Full Code Here

    private void setupMatcher() throws MessagingException {

        matcher = new IsSingleRecipient();
        MockMatcherConfig mci = new MockMatcherConfig("IsSingleRecipient",
                new MockMailContext());
        matcher.init(mci);
    }
View Full Code Here

    private MockServiceManager setUpServiceManager() throws Exception {
        m_serviceManager = new MockServiceManager();
        SimpleConnectionManager connectionManager = new SimpleConnectionManager();
        ContainerUtil.enableLogging(connectionManager, new MockLogger());
        m_serviceManager.put(JamesConnectionManager.ROLE, connectionManager);
        m_serviceManager.put("org.apache.mailet.MailetContext", new MockMailContext());
        m_mailServer = new MockMailServer();
        m_serviceManager.put(MailServer.ROLE, m_mailServer);
        m_serviceManager.put(UsersRepository.ROLE, m_usersRepository);
        m_serviceManager.put(SocketManager.ROLE, new MockSocketManager(m_smtpListenerPort));
        m_serviceManager.put(ThreadManager.ROLE, new MockThreadManager());
View Full Code Here

        outgoingSpool = new InMemorySpoolRepository();
        ((MockStore) m_serviceManager.lookup(Store.ROLE)).add("outgoing", outgoingSpool);
       
        RemoteDelivery rd = new RemoteDelivery();
       
        MockMailContext mmc = new MockMailContext();
        mmc.setAttribute(Constants.AVALON_COMPONENT_MANAGER,m_serviceManager);
        mmc.setAttribute(Constants.HELLO_NAME,"localhost");
        MockMailetConfig mci = new MockMailetConfig("Test",mmc,getStandardParameters());
        mci.setProperty("bind", "127.0.0.1");
        mci.setProperty("gateway","127.0.0.1");
        mci.setProperty("gatewayPort",""+m_smtpListenerPort);
        rd.init(mci);
View Full Code Here

        outgoingSpool = new InMemorySpoolRepository();
        ((MockStore) m_serviceManager.lookup(Store.ROLE)).add("outgoing", outgoingSpool);
       
        RemoteDelivery rd = new RemoteDelivery();
       
        MockMailContext mmc = new MockMailContext();
        mmc.setAttribute(Constants.AVALON_COMPONENT_MANAGER,m_serviceManager);
        mmc.setAttribute(Constants.HELLO_NAME,"localhost");
        MockMailetConfig mci = new MockMailetConfig("Test",mmc,getStandardParameters());
        mci.setProperty("gateway","127.0.0.1");
        mci.setProperty("gatewayPort",""+m_smtpListenerPort);
        rd.init(mci);
       
View Full Code Here

    private void setupMatcher() throws MessagingException {
        setupMockedMimeMessage();
        matcher = new HostIs();
        MockMatcherConfig mci = new MockMatcherConfig("HostIs=" + HOST_NAME,
                new MockMailContext());
        matcher.init(mci);
    }
View Full Code Here

    private void setupMatcher() throws MessagingException {

        matcher = new IsSingleRecipient();
        MockMatcherConfig mci = new MockMatcherConfig("IsSingleRecipient",
                new MockMailContext());
        matcher.init(mci);
    }
View Full Code Here

    }

    private void setupMailet() throws MessagingException {
        mailet = new ToProcessor();
        MockMailetConfig mci = new MockMailetConfig("Test",
                new MockMailContext());
        if (processor != null) {
            mci.setProperty("processor", processor);
        }
        if (notice != null) {
            mci.setProperty("notice", notice);
View Full Code Here

    private String processAddFooter(String asciisource, String footer)
            throws MessagingException, IOException {
        Mailet mailet = new AddFooter();

        MockMailetConfig mci = new MockMailetConfig("Test",new MockMailContext());
        mci.setProperty("text",footer);

        mailet.init(mci);

        Mail mail = new MailImpl(new MimeMessage(Session
View Full Code Here

TOP

Related Classes of org.apache.james.test.mock.mailet.MockMailContext

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.