Coverage Report - org.mule.transport.soap.axis.WsdlUrlEndpointURIBuilder
 
Classes in this File Line Coverage Branch Coverage Complexity
WsdlUrlEndpointURIBuilder
0%
0/15
0%
0/10
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.soap.axis;
 8  
 
 9  
 import org.mule.api.endpoint.MalformedEndpointException;
 10  
 import org.mule.endpoint.AbstractEndpointURIBuilder;
 11  
 
 12  
 import java.net.URI;
 13  
 import java.util.Properties;
 14  
 
 15  
 /**
 16  
  * The same as the UrlEndpointbuilder except that all parameters except the first are
 17  
  * set as properties on the endpoint and stripped from the endpoint Uri
 18  
  */
 19  0
 public class WsdlUrlEndpointURIBuilder extends AbstractEndpointURIBuilder
 20  
 {
 21  
     @Override
 22  
     protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException
 23  
     {
 24  0
         address = "";
 25  0
         if (uri.getHost() != null)
 26  
         {
 27  
             // set the endpointUri to be a proper url if host and port are set
 28  0
             this.address = uri.getScheme() + "://" + uri.getHost();
 29  0
             if (uri.getPort() != -1)
 30  
             {
 31  0
                 address += ":" + uri.getPort();
 32  
             }
 33  
         }
 34  0
         if (uri.getPath() != null)
 35  
         {
 36  0
             address += uri.getPath();
 37  
         }
 38  0
         String query = uri.getQuery();
 39  0
         if (query != null)
 40  
         {
 41  0
             int i = query.indexOf("&");
 42  0
             if (i > -1)
 43  
             {
 44  0
                 address += "?" + query.substring(0, i);
 45  
 
 46  
             }
 47  
             else
 48  
             {
 49  0
                 address += "?" + query;
 50  
             }
 51  
         }
 52  0
     }
 53  
 }