Package org.apache.jsieve.mail

Examples of org.apache.jsieve.mail.Action


    public void executeActions() throws SieveException
    {
        ListIterator actionsIter = getActionsIterator();
        while (actionsIter.hasNext())
        {
            Action action = (Action) actionsIter.next();
            getMailetContext().log("Executing action: " + action.toString());
            try
            {
                dispatcher.execute(action, getMail(), this);
            }
            catch (MessagingException e)
View Full Code Here


    }

    public void testGetActions() {
        assertNotNull(adapter.getActions());
        try {
            adapter.getActions().add(new Action() {});
            fail("Should not be able to modify collection");
        } catch (UnsupportedOperationException e) {
            // expected
        }
        adapter.addAction(action);
View Full Code Here

                .size());
        assertEquals("Two actions executed", action, adapter
                .getExecutedActions().get(0));
        assertEquals("Two actions executed", anotherAction, adapter
                .getExecutedActions().get(1));
        adapter.getExecutedActions().add(new Action(){});
        assertEquals("Two actions executed", 2, adapter.getExecutedActions()
                .size());
        assertEquals("Two actions executed", action, adapter
                .getExecutedActions().get(0));
        assertEquals("Two actions executed", anotherAction, adapter
View Full Code Here

     */
    public void executeActions() throws SieveException {
        boolean isDebugEnabled = log.isDebugEnabled();
        ListIterator actionsIter = getActionsIterator();
        while (actionsIter.hasNext()) {
            Action action = (Action) actionsIter.next();
            if (isDebugEnabled)
                log.debug("Executing " + action.toString());
        }

    }
View Full Code Here

    public void executeActions() throws SieveException {
        // Log log = Logger.getLog();
        // boolean isDebugEnabled = log.isDebugEnabled();
        ListIterator actionsIter = getActionsIterator();
        while (actionsIter.hasNext()) {
            Action action = (Action) actionsIter.next();
            getMailetContext().log("Executing action: " + action.toString());
            try {
                ActionDispatcher.getInstance().execute(action, getMail(),
                        getMailetContext());
            } catch (NoSuchMethodException e) {
                throw new SieveException(e.getMessage());
View Full Code Here

        Log log = Logger.getLog();
        boolean isDebugEnabled = log.isDebugEnabled();
        ListIterator actionsIter = getActionsIterator();
        while (actionsIter.hasNext())
        {
            Action action = (Action) actionsIter.next();
            if (isDebugEnabled)
                log.debug("Executing " + action.toString());
        }

    }
View Full Code Here

        MimeMessage mimeMessage = new MimeMessage(Session
                .getDefaultInstance(new Properties()));
        mimeMessage.setText("TEST");
        aMail.setMessage(mimeMessage);
        MailetContext aMailetContext = new MockMailetContext();
        Action action = new ActionKeep();
        try {
            ActionDispatcher.getInstance().execute(action, aMail,
                    aMailetContext);
            isTestPassed = true;
        } catch (NoSuchMethodException e) {
View Full Code Here

     */
    public void testExecuteActionAbsent() {
        boolean isTestPassed = false;
        Mail aMail = new MailImpl();
        MailetContext aMailetContext = new MockMailetContext();
        Action action = new ActionAbsent();
        try {
            ActionDispatcher.getInstance().execute(action, aMail,
                    aMailetContext);
        } catch (NoSuchMethodException e) {
            isTestPassed = true;
View Full Code Here

        // Only one fileinto per destination allowed, others should be
        // discarded
        ListIterator actionsIter = mail.getActionsIterator();
        boolean isDuplicate = false;
        while (actionsIter.hasNext()) {
            Action action = (Action) actionsIter.next();
            isDuplicate = (action instanceof ActionFileInto)
                    && (((ActionFileInto) action).getDestination()
                            .equals(destination));
        }
View Full Code Here

TOP

Related Classes of org.apache.jsieve.mail.Action

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.