Package org.apache.camel

Examples of org.apache.camel.Message.removeHeaders()


        assertEquals("bla", msg.getHeader("tick"));
        assertEquals("blaa", msg.getHeader("tack"));
        assertEquals("blaaa", msg.getHeader("tock"));

        msg.removeHeaders("t*");

        assertTrue(msg.getHeaders().isEmpty());
    }

    public void testRemoveHeadersAllWithWildcard() {
View Full Code Here


        assertEquals("bla", msg.getHeader("tick"));
        assertEquals("blaa", msg.getHeader("tack"));
        assertEquals("blaaa", msg.getHeader("tock"));

        msg.removeHeaders("*");

        assertTrue(msg.getHeaders().isEmpty());
    }

    public void testRemoveHeadersWithExclude() {
View Full Code Here

        msg.setHeader("tick", "bla");
        msg.setHeader("tiack", "blaa");
        msg.setHeader("tiock", "blaaa");
        msg.setHeader("tiuck", "blaaaa");

        msg.removeHeaders("ti*", "tiuck", "tiack");

        assertEquals(2, msg.getHeaders().size());
        assertEquals("blaa", msg.getHeader("tiack"));
        assertEquals("blaaaa", msg.getHeader("tiuck"));
    }
View Full Code Here

        assertEquals("bla", msg.getHeader("tick"));
        assertEquals("blaa", msg.getHeader("tack"));
        assertEquals("blaaa", msg.getHeader("tock"));

        msg.removeHeaders("*", "tick", "tock", "toe");

        // new message headers
        assertEquals("bla", msg.getHeader("tick"));
        assertEquals(null, msg.getHeader("tack"));
        assertEquals("blaaa", msg.getHeader("tock"));
View Full Code Here

        msg.setHeader("tick", "bla");
        msg.setHeader("tack", "blaa");
        msg.setHeader("taick", "blaa");
        msg.setHeader("tock", "blaaa");

        msg.removeHeaders("*", "ta*");

        assertEquals(2, msg.getHeaders().size());
        assertEquals("blaa", msg.getHeader("tack"));
        assertEquals("blaa", msg.getHeader("taick"));
    }
View Full Code Here

        assertEquals("bla", msg.getHeader("tick"));
        assertEquals("blaa", msg.getHeader("tack"));
        assertEquals("blaaa", msg.getHeader("tock"));
        assertEquals("blaaaa", msg.getHeader("taack"));

        msg.removeHeaders(null, null, null, null);

        assertFalse(msg.getHeaders().isEmpty());
    }

    public void testRemoveHeadersWithNonExcludeHeaders() {
View Full Code Here

        msg.setHeader("tick", "bla");
        msg.setHeader("tack", "blaa");
        msg.setHeader("tock", "blaaa");

        msg.removeHeaders("*", "camels", "are", "fun");

        assertTrue(msg.getHeaders().isEmpty());
    }

    public void testWithDefaults() {
View Full Code Here

        assertEquals("bla", msg.getHeader("tick"));
        assertEquals("blaa", msg.getHeader("tack"));
        assertEquals("blaaa", msg.getHeader("tock"));

        msg.removeHeaders("t*");

        assertTrue(msg.getHeaders().isEmpty());
    }

    public void testRemoveHeadersAllWithWildcard() {
View Full Code Here

        assertEquals("bla", msg.getHeader("tick"));
        assertEquals("blaa", msg.getHeader("tack"));
        assertEquals("blaaa", msg.getHeader("tock"));

        msg.removeHeaders("*");

        assertTrue(msg.getHeaders().isEmpty());
    }

    public void testRemoveHeadersWithExclude() {
View Full Code Here

        msg.setHeader("tick", "bla");
        msg.setHeader("tiack", "blaa");
        msg.setHeader("tiock", "blaaa");
        msg.setHeader("tiuck", "blaaaa");

        msg.removeHeaders("ti*", "tiuck", "tiack");

        assertEquals(2, msg.getHeaders().size());
        assertEquals("blaa", msg.getHeader("tiack"));
        assertEquals("blaaaa", msg.getHeader("tiuck"));
    }
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.