[ 
https://issues.apache.org/activemq/browse/CAMEL-3?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hiram Chirino updated CAMEL-3:
------------------------------

    Description: 
{code:java}
    public void testNPE() throws Exception {
        final CamelContext camelContext = new DefaultCamelContext();
        final String fromQueue = "queue:A";
        camelContext.addRoutes(new RouteBuilder() {
            public void configure() throws Exception {
                from(fromQueue).process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        final Message in = exchange.getIn();
                        assertNotNull("Message is Null", in);
                        String isDebugString = in.getHeader("someproperty", 
String.class);
                        assertNull(isDebugString);
                        assertNotNull("Message is Null", in);
                        boolean isDebug = in.getHeader("someproperty", 
Boolean.class);
                        assertFalse(isDebug);
                    }
                });
            }
        });
        camelContext.start();
        new CamelTemplate(camelContext).sendBody(fromQueue, "ha!");
        Thread.sleep(5000L);
    }
{code}
throws NPE on the isDebug = ... line.

  was:
    public void testNPE() throws Exception {
        final CamelContext camelContext = new DefaultCamelContext();
        final String fromQueue = "queue:A";
        camelContext.addRoutes(new RouteBuilder() {
            public void configure() throws Exception {
                from(fromQueue).process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        final Message in = exchange.getIn();
                        assertNotNull("Message is Null", in);
                        String isDebugString = in.getHeader("someproperty", 
String.class);
                        assertNull(isDebugString);
                        assertNotNull("Message is Null", in);
                        boolean isDebug = in.getHeader("someproperty", 
Boolean.class);
                        assertFalse(isDebug);
                    }
                });
            }
        });
        camelContext.start();
        new CamelTemplate(camelContext).sendBody(fromQueue, "ha!");
        Thread.sleep(5000L);
    }

throws NPE on the isDebug = ... line.


> Issue with getHeader("", Boolean.class)
> ---------------------------------------
>
>                 Key: CAMEL-3
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Noah Nordrum
>            Assignee: James Strachan
>            Priority: Critical
>             Fix For: 1.0
>
>
> {code:java}
>     public void testNPE() throws Exception {
>         final CamelContext camelContext = new DefaultCamelContext();
>         final String fromQueue = "queue:A";
>         camelContext.addRoutes(new RouteBuilder() {
>             public void configure() throws Exception {
>                 from(fromQueue).process(new Processor() {
>                     public void process(Exchange exchange) throws Exception {
>                         final Message in = exchange.getIn();
>                         assertNotNull("Message is Null", in);
>                         String isDebugString = in.getHeader("someproperty", 
> String.class);
>                         assertNull(isDebugString);
>                         assertNotNull("Message is Null", in);
>                         boolean isDebug = in.getHeader("someproperty", 
> Boolean.class);
>                         assertFalse(isDebug);
>                     }
>                 });
>             }
>         });
>         camelContext.start();
>         new CamelTemplate(camelContext).sendBody(fromQueue, "ha!");
>         Thread.sleep(5000L);
>     }
> {code}
> throws NPE on the isDebug = ... line.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to