@Test
public void testAlternateXmlRequestFactoryMethods() throws Exception {

    XmlRequest xmlRequest = new GeonetHttpRequestFactory().createXmlRequest("host", 1234, "http");
    HttpRequestBase httpRequestBase = xmlRequest.setupHttpMethod();
    assertTrue(httpRequestBase instanceof HttpGet);
    assertEquals("host", httpRequestBase.getURI().getHost());
    assertEquals(1234, httpRequestBase.getURI().getPort());
    assertEquals("http", httpRequestBase.getURI().getScheme());
    assertEquals("", httpRequestBase.getURI().getPath());
    assertEquals(null, httpRequestBase.getURI().getQuery());
    assertEquals(null, httpRequestBase.getURI().getFragment());
    xmlRequest = new GeonetHttpRequestFactory().createXmlRequest("host", 1234);
    httpRequestBase = xmlRequest.setupHttpMethod();
    assertTrue(httpRequestBase instanceof HttpGet);
    assertEquals("host", httpRequestBase.getURI().getHost());
    assertEquals(1234, httpRequestBase.getURI().getPort());
    assertEquals("http", httpRequestBase.getURI().getScheme());
    assertEquals("", httpRequestBase.getURI().getPath());
    assertEquals(null, httpRequestBase.getURI().getQuery());
    assertEquals(null, httpRequestBase.getURI().getFragment());
    xmlRequest = new GeonetHttpRequestFactory().createXmlRequest("host", 443);
    httpRequestBase = xmlRequest.setupHttpMethod();
    assertTrue(httpRequestBase instanceof HttpGet);
    assertEquals("host", httpRequestBase.getURI().getHost());
    assertEquals(443, httpRequestBase.getURI().getPort());
    assertEquals("https", httpRequestBase.getURI().getScheme());
    assertEquals("", httpRequestBase.getURI().getPath());
    assertEquals(null, httpRequestBase.getURI().getQuery());
    assertEquals(null, httpRequestBase.getURI().getFragment());
    xmlRequest = new GeonetHttpRequestFactory().createXmlRequest("host", 80);
    httpRequestBase = xmlRequest.setupHttpMethod();
    assertTrue(httpRequestBase instanceof HttpGet);
    assertEquals("host", httpRequestBase.getURI().getHost());
    assertEquals(80, httpRequestBase.getURI().getPort());
    assertEquals("http", httpRequestBase.getURI().getScheme());
    assertEquals("", httpRequestBase.getURI().getPath());
    assertEquals(null, httpRequestBase.getURI().getQuery());
    assertEquals(null, httpRequestBase.getURI().getFragment());
    xmlRequest = new GeonetHttpRequestFactory().createXmlRequest("host");
    httpRequestBase = xmlRequest.setupHttpMethod();
    assertTrue(httpRequestBase instanceof HttpGet);
    assertEquals("host", httpRequestBase.getURI().getHost());
    assertEquals(80, httpRequestBase.getURI().getPort());
    assertEquals("http", httpRequestBase.getURI().getScheme());
    assertEquals("", httpRequestBase.getURI().getPath());
    assertEquals(null, httpRequestBase.getURI().getQuery());
    assertEquals(null, httpRequestBase.getURI().getFragment());
    xmlRequest = new GeonetHttpRequestFactory().createXmlRequest();
    assertEquals(null, xmlRequest.getHost());
    assertEquals(80, xmlRequest.getPort());
    assertEquals("http", xmlRequest.getProtocol());
    assertEquals(null, xmlRequest.getAddress());
    assertEquals(null, xmlRequest.getQuery());
    assertEquals(null, xmlRequest.getFragment());
}