Package org.apache.mailet.base.test

Examples of org.apache.mailet.base.test.FakeMailContext


    public void testSimpleAttachment2() throws MessagingException, IOException {
        Mailet mailet = new StripAttachment();

        FakeMailetConfig mci = new FakeMailetConfig("Test",
                new FakeMailContext());
        mci.setProperty("directory", "./");
        mci.setProperty("remove", "all");
        mci.setProperty("notpattern", "^(winmail\\.dat$)");
        mailet.init(mci);
View Full Code Here


    public void testToAndFromAttributes() throws MessagingException,
            IOException {
        Mailet strip = new StripAttachment();
        FakeMailetConfig mci = new FakeMailetConfig("Test",
                new FakeMailContext());
        mci.setProperty("attribute", "my.attribute");
        mci.setProperty("remove", "all");
        mci.setProperty("notpattern", ".*\\.tmp.*");
        strip.init(mci);

        Mailet recover = new RecoverAttachment();
        FakeMailetConfig mci2 = new FakeMailetConfig("Test",
                new FakeMailContext());
        mci2.setProperty("attribute", "my.attribute");
        recover.init(mci2);

        Mailet onlyText = new OnlyText();
        onlyText.init(new FakeMailetConfig("Test", new FakeMailContext()));

        MimeMessage message = new MimeMessage(Session
                .getDefaultInstance(new Properties()));

        MimeMultipart mm = new MimeMultipart();
View Full Code Here

    private Mailet initMailet() throws MessagingException {
        Mailet mailet = new StripAttachment();

        FakeMailetConfig mci = new FakeMailetConfig("Test",
                new FakeMailContext());
        mci.setProperty("directory", "./");
        mci.setProperty("remove", "all");
        mci.setProperty("pattern", ".*\\.tmp");
        mci.setProperty("decodeFilename", "true");
        mci.setProperty("replaceFilenamePattern",
View Full Code Here

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

        FakeMailetConfig mci = new FakeMailetConfig("Test",new FakeMailContext());
        mci.setProperty("text",footer);

        mailet.init(mci);

        Mail mail = new FakeMail();
View Full Code Here

    }

    private void setupMailet() throws MessagingException {
        mailet = new SetMailAttribute();
        FakeMailetConfig mci = new FakeMailetConfig("Test",
                new FakeMailContext());
        mci.setProperty(ATTRIBUTE_NAME1, "true");
        mci.setProperty(ATTRIBUTE_NAME2, "true");

        mailet.init(mci);
    }
View Full Code Here

    }

    private void setupMailet() throws MessagingException {
        mailet = new SetMimeHeader();
        FakeMailetConfig mci = new FakeMailetConfig("Test",
                new FakeMailContext());
        mci.setProperty("name", HEADER_NAME);
        mci.setProperty("value", HEADER_VALUE);

        mailet.init(mci);
    }
View Full Code Here

    }

    protected void setupMatcher() throws MessagingException {
        matcher = createMatcher();
        FakeMatcherConfig mci = new FakeMatcherConfig(getConfigOption()
                + getConfigValue(), new FakeMailContext());
        matcher.init(mci);
    }
View Full Code Here

    }

    private void setupMatcher(String size) throws MessagingException {
        matcher = new SizeGreaterThan();
        FakeMatcherConfig mci = new FakeMatcherConfig("SizeGreaterThan=" + size,
                new FakeMailContext());
        matcher.init(mci);
    }
View Full Code Here

    }

    protected void setupMatcher() throws MessagingException {
        matcher = createMatcher();
        FakeMatcherConfig mci = new FakeMatcherConfig(getConfigOption()
                + getSubjectName(), new FakeMailContext());
        matcher.init(mci);
    }
View Full Code Here

    private void setupMatcher() throws MessagingException {
        setupMockedMimeMessage();
        matcher = new FetchedFrom();
        FakeMatcherConfig mci = new FakeMatcherConfig("FetchedFrom="
                + HEADER_VALUE, new FakeMailContext());
        matcher.init(mci);
    }
View Full Code Here

TOP

Related Classes of org.apache.mailet.base.test.FakeMailContext

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.