camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Azarov (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-4857) Endpoint URI normalization: information in path is lost
Date Fri, 08 Jun 2012 12:02:23 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-4857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13289213#comment-13289213
] 

Alexander Azarov edited comment on CAMEL-4857 at 6/8/12 12:01 PM:
------------------------------------------------------------------

[~bvahdat], please do not build your proofs based on my old emotions. In the end of a day,
I'm rational in my decisions.

I perfectly understand every release may bring some bugs. [~hadrian] explains there were incomplete
test coverage of URIs.

I still wonder why no Camel users have been affected by the same issue, since URI is the main
transport of transmitting settings into Camel components. Anyway (a) the number of camel-beanstalk
component users is very small and no one complained; (b) the number of voters/watchers of
this issue shows no significant interest. Hence, if nobody needs it, it seems logical to postpone
the fix.
                
      was (Author: azarov):
    [~bvahdat], please do not build your proofs based on my old emotions. In the end of a
day, I'm rational in my decisions.

I perfectly understand every release may bring some bugs. [~hadrian] explains there were incomplete
test coverage of URIs.

I still wonder why no Camel users has been affected by the same issue, since URI is the main
transport of transmitting settings into Camel components. Anyway (a) the number of camel-beanstalk
component users is very small and no one complained; (b) the number of voters/watchers of
this issue shows no significant interest. Hence, if nobody needs it, it seems logical to postpone
the fix.
                  
> Endpoint URI normalization: information in path is lost
> -------------------------------------------------------
>
>                 Key: CAMEL-4857
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4857
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Alexander Azarov
>            Assignee: Christian Müller
>             Fix For: Future
>
>
> A project with a test case is here: https://github.com/alaz/camel290_uri
> The test case with the problem description (the problem occured during migration of camel-beanstalk
https://github.com/osinka/camel-beanstalk component onto 2.9.0):
> {code:title=UriTest.java}
> package camel290.uri;
> import java.util.Map;
> import org.apache.camel.Consumer;
> import org.apache.camel.Endpoint;
> import org.apache.camel.Processor;
> import org.apache.camel.Producer;
> import org.apache.camel.impl.DefaultComponent;
> import org.apache.camel.impl.DefaultEndpoint;
> import org.apache.camel.test.CamelTestSupport;
> import org.junit.Before;
> import org.junit.Test;
> import static org.junit.Assert.*;
> public class UriTest extends CamelTestSupport {
>   /**
>    * An URI of Camel Beanstalk component consists of a hostname, port and a list
>    * of tube names. Tube names are separated by "+" character (which is more or less
>    * usualy used on the Web to make lists), but every tube name may contain URI special
>    * characters like ? or +
>    */
>   class MyEndpoint extends DefaultEndpoint {
>     String uri = null;
>     String remaining = null;
>     public MyEndpoint(final String uri, final String remaining) {
>       this.uri = uri;
>       this.remaining = remaining;
>     }
>     public Producer createProducer() throws Exception {
>       throw new UnsupportedOperationException("Not supported yet.");
>     }
>     public Consumer createConsumer(Processor prcsr) throws Exception {
>       throw new UnsupportedOperationException("Not supported yet.");
>     }
>     public boolean isSingleton() {
>       return true;
>     }
>   }
>   class MyComponent extends DefaultComponent {
>     @Override
>     protected Endpoint createEndpoint(final String uri, final String remaining, final
Map<String, Object> parameters) throws Exception {
>       return new MyEndpoint(uri, remaining);
>     }
>   }
>   @Before
>   @Override
>   public void setUp() throws Exception {
>     super.setUp();
>     context.addComponent("my", new MyComponent());
>   }
>   @Test
>   public void testExclamationInUri() {
>     /**
>      * %3F is not an ?, it's part of tube name.
>      */
>     MyEndpoint endpoint = context.getEndpoint("my:host:11303/tube1+tube%2B+tube%3F",
MyEndpoint.class);
>     assertNotNull("endpoint", endpoint);
>   }
>   @Test
>   public void testPath() {
>     /**
>      * Here a tube name is "tube+" and written in URI as "tube%2B", but it gets
>      * normalized, so that an endpoint sees "tube1+tube+"
>      */
>     MyEndpoint endpoint = context.getEndpoint("my:host:11303/tube1+tube%2B", MyEndpoint.class);
>     assertEquals("Path contains several tube names, every tube name may have + or ? characters",
"host:11303/tube1+tube%2B", endpoint.remaining);
>   }
> }
> {code} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message