Coverage Report - org.mule.transport.jms.JmsEndpointURIBuilder
 
Classes in this File Line Coverage Branch Coverage Complexity
JmsEndpointURIBuilder
0%
0/14
0%
0/6
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.transport.jms;
 8  
 
 9  
 import org.mule.endpoint.ResourceNameEndpointURIBuilder;
 10  
 import org.mule.api.endpoint.MalformedEndpointException;
 11  
 
 12  
 import java.util.Properties;
 13  
 import java.net.URI;
 14  
 import java.net.URISyntaxException;
 15  
 
 16  
 /**
 17  
  * TODO
 18  
  */
 19  0
 public class JmsEndpointURIBuilder extends ResourceNameEndpointURIBuilder
 20  
 {
 21  
     @Override
 22  
     protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException
 23  
     {
 24  0
         super.setEndpoint(uri, props);
 25  
 
 26  0
         String newUri = null;
 27  0
         if (uri.getScheme().equals("topic"))
 28  
         {
 29  0
             props.setProperty(RESOURCE_INFO_PROPERTY, "topic");
 30  0
             newUri = uri.toString().replace("topic://", "jms://");
 31  
         }
 32  0
         else if (uri.getScheme().equals("queue"))
 33  
         {
 34  0
             newUri = uri.toString().replace("queue://", "jms://");
 35  
         }
 36  
 
 37  
         try
 38  
         {
 39  0
             if (newUri != null)
 40  
             {
 41  0
                 rewriteURI(new URI(newUri));
 42  
             }
 43  
         }
 44  0
         catch (URISyntaxException e)
 45  
         {
 46  0
             throw new MalformedEndpointException(e);
 47  0
         }
 48  
 
 49  0
     }
 50  
 }