Example usage for org.apache.commons.httpclient HostConfiguration getVirtualHost

List of usage examples for org.apache.commons.httpclient HostConfiguration getVirtualHost

Introduction

In this page you can find the example usage for org.apache.commons.httpclient HostConfiguration getVirtualHost.

Prototype

public String getVirtualHost()

Source Link

Usage

From source file:org.mule.transport.http.MuleHostConfigurationTestCase.java

@SuppressWarnings("deprecation")
@Test/*from   w w  w .j  a v  a2  s. c om*/
public void testSetHostViaHostAndVirtualHostAndPortAndProtocol() {
    HostConfiguration hostConfig = createHostConfiguration();

    Protocol protocol = Protocol.getProtocol("http");
    hostConfig.setHost("www.mulesoft.org", "www.mulesoft.com", 8080, protocol);

    assertMockSocketFactory(hostConfig);
    assertEquals("www.mulesoft.org", hostConfig.getHost());
    assertEquals(8080, hostConfig.getPort());
    assertEquals("www.mulesoft.com", hostConfig.getVirtualHost());
}

From source file:org.mule.transport.http.MuleHostConfigurationTestCase.java

@SuppressWarnings("deprecation")
@Test/*  ww w  . jav  a2  s.c  o m*/
public void testSetHostViaHostAndVirtualHostAndPortAndProtocolWithDifferentProtocol() throws Exception {
    new DifferentProtocolTemplate() {
        protected void doTest() throws Exception {
            HostConfiguration hostConfig = createHostConfiguration();

            Protocol protocol = Protocol.getProtocol("httpx");
            hostConfig.setHost("www.mulesoft.org", "www.mulesoft.com", 8080, protocol);

            assertDefaultSocketFactory(hostConfig);
            assertEquals("www.mulesoft.org", hostConfig.getHost());
            assertEquals(8080, hostConfig.getPort());
            assertEquals("www.mulesoft.com", hostConfig.getVirtualHost());
        }
    }.test();
}