public class TestHttpServer extends HttpServerFunctionalTest
Modifier and Type | Class and Description |
---|---|
static class |
TestHttpServer.DummyFilterInitializer
FilterInitializer that initialized the DummyFilter.
|
static class |
TestHttpServer.DummyServletFilter
Dummy filter that mimics as an authentication filter.
|
static class |
TestHttpServer.EchoMapServlet |
static class |
TestHttpServer.EchoServlet |
static class |
TestHttpServer.HtmlContentServlet |
static class |
TestHttpServer.LongHeaderServlet |
static class |
TestHttpServer.MyGroupsProvider
Custom user->group mapping service.
|
Modifier and Type | Field and Description |
---|---|
private static URL |
baseUrl |
static HBaseClassTestRule |
CLASS_RULE |
private static org.slf4j.Logger |
LOG |
(package private) static int |
MAX_THREADS |
private static org.apache.hadoop.hbase.http.HttpServer |
server |
TEST_BUILD_WEBAPPS
Constructor and Description |
---|
TestHttpServer() |
Modifier and Type | Method and Description |
---|---|
private org.apache.hadoop.hbase.http.HttpServer |
checkBindAddress(String host,
int port,
boolean findPort) |
static void |
cleanup() |
private static int |
getHttpStatusCode(String urlstring,
String userName)
Access a URL and get the corresponding return Http status code.
|
private static Map<String,Object> |
parse(String jsonString) |
static void |
setup() |
void |
testAuthorizationOfDefaultServlets()
Verify the administrator access for /logs, /stacks, /conf, /logLevel and
/metrics servlets.
|
void |
testBindAddress() |
void |
testContentTypes() |
void |
testDisabledAuthorizationOfDefaultServlets()
Verify the access for /logs, /stacks, /conf, /logLevel and /metrics
servlets, when authentication filters are set, but authorization is not
enabled.
|
void |
testEcho() |
void |
testEchoMap()
Test the echo map servlet that uses getParameterMap.
|
void |
testHasAdministratorAccess() |
void |
testHttpMethods() |
void |
testJersey() |
void |
testLongHeader()
Test that verifies headers can be up to 64K long.
|
void |
testMaxThreads()
Test the maximum number of threads cannot be exceeded.
|
void |
testNoCacheHeader() |
void |
testRequestQuoterWithNotNull() |
void |
testRequestQuoterWithNull() |
void |
testRequiresAuthorizationAccess() |
void |
testXFrameHeaderSameOrigin() |
access, createAndStartTestServer, createServer, createServer, createServer, createServer, createServer, createTestServer, createTestServer, createTestServer, createTestServer, createTestServerWithSecurity, createTestServerWithSecurityAndAcl, deleteRecursively, getFreePort, getServerURL, prepareTestWebapp, readOutput, stop
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static org.apache.hadoop.hbase.http.HttpServer server
static final int MAX_THREADS
public TestHttpServer()
public void testMaxThreads() throws Exception
Exception
public void testEchoMap() throws Exception
Exception
public void testLongHeader() throws Exception
Exception
public void testContentTypes() throws Exception
Exception
private static int getHttpStatusCode(String urlstring, String userName) throws IOException
urlstring
- The url to accessuserName
- The user to perform access asIOException
- if there is a problem communicating with the serverpublic void testDisabledAuthorizationOfDefaultServlets() throws Exception
Exception
public void testAuthorizationOfDefaultServlets() throws Exception
Exception
public void testRequestQuoterWithNull()
public void testRequestQuoterWithNotNull()
public void testJersey() throws Exception
Exception
public void testHasAdministratorAccess() throws Exception
Exception
public void testRequiresAuthorizationAccess() throws Exception
Exception
public void testBindAddress() throws Exception
Exception
private org.apache.hadoop.hbase.http.HttpServer checkBindAddress(String host, int port, boolean findPort) throws Exception
Exception
public void testXFrameHeaderSameOrigin() throws Exception
Exception
public void testNoCacheHeader() throws Exception
Exception
public void testHttpMethods() throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.