Package org.apache.mailet

Examples of org.apache.mailet.Mail.removeAttribute()


        assertFalse("attributes initially empty", mail.getAttributeNames().hasNext());
        assertNull("not found on emtpy list", mail.getAttribute("test"));
        assertNull("no previous item with key", mail.setAttribute("testKey", "testValue"));
        assertEquals("item found", "testValue", mail.getAttribute("testKey"));
        assertTrue("has attribute", mail.hasAttributes());
        assertEquals("item removed", "testValue", mail.removeAttribute("testKey"));
        assertNull("item no longer found", mail.getAttribute("testKey"));
    }

}
View Full Code Here


     * (non-Javadoc)
     * @see org.apache.camel.Predicate#matches(org.apache.camel.Exchange)
     */
    public boolean matches(Exchange arg0) {
        Mail m = arg0.getIn().getBody(Mail.class);
        if (m.removeAttribute(MatcherSplitter.MATCHER_MATCHED_ATTRIBUTE) != null) {
           return true;
        }
        return false;
    }
}
View Full Code Here

        assertFalse("attributes initially empty", mail.getAttributeNames().hasNext());
        assertNull("not found on emtpy list", mail.getAttribute("test"));
        assertNull("no previous item with key", mail.setAttribute("testKey", "testValue"));
        assertEquals("item found", "testValue", mail.getAttribute("testKey"));
        assertTrue("has attribute", mail.hasAttributes());
        assertEquals("item removed", "testValue", mail.removeAttribute("testKey"));
        assertNull("item no longer found", mail.getAttribute("testKey"));
    }

}
View Full Code Here

        assertFalse("attributes initially empty", mail.getAttributeNames().hasNext());
        assertNull("not found on emtpy list", mail.getAttribute("test"));
        assertNull("no previous item with key", mail.setAttribute("testKey", "testValue"));
        assertEquals("item found", "testValue", mail.getAttribute("testKey"));
        assertTrue("has attribute", mail.hasAttributes());
        assertEquals("item removed", "testValue", mail.removeAttribute("testKey"));
        assertNull("item no longer found", mail.getAttribute("testKey"));
    }

}
View Full Code Here

    /**
     * @see org.apache.camel.Predicate#matches(org.apache.camel.Exchange)
     */
    public boolean matches(Exchange arg0) {
        Mail m = arg0.getIn().getBody(Mail.class);
        return m.removeAttribute(MatcherSplitter.MATCHER_MATCHED_ATTRIBUTE) != null;
    }
}
View Full Code Here

        assertFalse("attributes initially empty", mail.getAttributeNames().hasNext());
        assertNull("not found on emtpy list", mail.getAttribute("test"));
        assertNull("no previous item with key", mail.setAttribute("testKey", "testValue"));
        assertEquals("item found", "testValue", mail.getAttribute("testKey"));
        assertTrue("has attribute", mail.hasAttributes());
        assertEquals("item removed", "testValue", mail.removeAttribute("testKey"));
        assertNull("item no longer found", mail.getAttribute("testKey"));
    }
}
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.