use of org.apache.tapestry5.http.internal.services.BaseURLSourceImpl in project tapestry-5 by apache.
the class BaseURLSourceImplTest method contributed_hostname.
@Test
public void contributed_hostname() {
expect(request.getServerPort()).andReturn(80).once();
expect(request.isSecure()).andReturn(false);
replay();
BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "my.server.com", 0, 0);
assertEquals(baseURLSource.getBaseURL(false), "http://my.server.com");
verify();
}
use of org.apache.tapestry5.http.internal.services.BaseURLSourceImpl in project tapestry-5 by apache.
the class BaseURLSourceImplTest method hostname_from_environment_variable.
@Test
public void hostname_from_environment_variable() {
expect(request.getServerPort()).andReturn(80).once();
expect(request.isSecure()).andReturn(false);
replay();
BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "$HOSTNAME", 0, 0);
assertEquals(baseURLSource.getBaseURL(false), "http://" + System.getenv("HOSTNAME"));
verify();
}
use of org.apache.tapestry5.http.internal.services.BaseURLSourceImpl in project tapestry-5 by apache.
the class BaseURLSourceImplTest method secure_url_using_default_port.
@Test
public void secure_url_using_default_port() {
replay();
BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 80, 443);
assertEquals(baseURLSource.getBaseURL(true), "https://localhost");
verify();
}
use of org.apache.tapestry5.http.internal.services.BaseURLSourceImpl in project tapestry-5 by apache.
the class BaseURLSourceImplTest method insecure_url_using_default_port.
@Test
public void insecure_url_using_default_port() {
replay();
BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 80, 443);
assertEquals(baseURLSource.getBaseURL(false), "http://localhost");
verify();
}
use of org.apache.tapestry5.http.internal.services.BaseURLSourceImpl in project tapestry-5 by apache.
the class BaseURLSourceImplTest method getBaseURLWithContributedNonStandardSecurePort.
@Test
public void getBaseURLWithContributedNonStandardSecurePort() {
replay();
BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 80, 8443);
assertEquals(baseURLSource.getBaseURL(true), "https://localhost:8443");
verify();
}
Aggregations