public class HttpServerFunctionalTest extends org.junit.Assert
HttpServer.
The methods are static for other classes to import statically.| Modifier and Type | Field and Description |
|---|---|
private static String |
BUILD_WEBAPPS_DIR
expected location of the test.build.webapps dir: "src/main/resources/hbase-webapps"
|
private static String |
TEST
name of the test webapp: "test"
|
static String |
TEST_BUILD_WEBAPPS
JVM property for the webapp test dir : "test.build.webapps"
|
| Constructor and Description |
|---|
HttpServerFunctionalTest() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.hadoop.hbase.http.HttpServer |
createAndStartTestServer()
Create and start a server with the test webapp
|
static org.apache.hadoop.hbase.http.HttpServer |
createServer(String webapp)
Create an HttpServer instance for the given webapp
|
static org.apache.hadoop.hbase.http.HttpServer |
createServer(String webapp,
org.apache.hadoop.conf.Configuration conf)
Create an HttpServer instance for the given webapp
|
static org.apache.hadoop.hbase.http.HttpServer |
createServer(String webapp,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.security.authorize.AccessControlList adminsAcl) |
static org.apache.hadoop.hbase.http.HttpServer |
createServer(String webapp,
org.apache.hadoop.conf.Configuration conf,
String[] pathSpecs)
Create an HttpServer instance for the given webapp
|
static org.apache.hadoop.hbase.http.HttpServer |
createServer(String host,
int port)
Create an HttpServer instance on the given address for the given webapp
|
static org.apache.hadoop.hbase.http.HttpServer |
createTestServer()
Create but do not start the test webapp server.
|
static org.apache.hadoop.hbase.http.HttpServer |
createTestServer(org.apache.hadoop.conf.Configuration conf)
Create but do not start the test webapp server.
|
static org.apache.hadoop.hbase.http.HttpServer |
createTestServer(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.security.authorize.AccessControlList adminsAcl) |
static org.apache.hadoop.hbase.http.HttpServer |
createTestServer(org.apache.hadoop.conf.Configuration conf,
String[] pathSpecs)
Create but do not start the test webapp server.
|
static org.apache.hadoop.hbase.http.HttpServer |
createTestServerWithSecurity(org.apache.hadoop.conf.Configuration conf) |
protected static void |
deleteRecursively(File d)
Recursively deletes a
File. |
protected static int |
getFreePort()
Picks a free port on the host by binding a Socket to '0'.
|
static URL |
getServerURL(org.apache.hadoop.hbase.http.HttpServer server)
Pass in a server, return a URL bound to localhost and its port
|
private static org.apache.hadoop.hbase.http.HttpServer.Builder |
localServerBuilder(String webapp) |
protected static void |
prepareTestWebapp()
Prepare the test webapp by creating the directory from the test properties
fail if the directory cannot be created.
|
protected static String |
readOutput(URL url)
Read in the content from a URL
|
static void |
stop(org.apache.hadoop.hbase.http.HttpServer server)
If the server is non null, stop it
|
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, assertTrue, assertTrue, fail, failpublic static final String TEST_BUILD_WEBAPPS
private static final String BUILD_WEBAPPS_DIR
private static final String TEST
public HttpServerFunctionalTest()
public static org.apache.hadoop.hbase.http.HttpServer createTestServer() throws IOException
IOException - if a problem occursAssertionError - if a condition was not metpublic static org.apache.hadoop.hbase.http.HttpServer createTestServer(org.apache.hadoop.conf.Configuration conf) throws IOException
conf - the server configuration to useIOException - if a problem occursAssertionError - if a condition was not metpublic static org.apache.hadoop.hbase.http.HttpServer createTestServer(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.authorize.AccessControlList adminsAcl) throws IOException
IOExceptionpublic static org.apache.hadoop.hbase.http.HttpServer createTestServer(org.apache.hadoop.conf.Configuration conf, String[] pathSpecs) throws IOException
conf - the server configuration to useIOException - if a problem occursAssertionError - if a condition was not metpublic static org.apache.hadoop.hbase.http.HttpServer createTestServerWithSecurity(org.apache.hadoop.conf.Configuration conf) throws IOException
IOExceptionprotected static void prepareTestWebapp()
AssertionError - if a condition was not metpublic static org.apache.hadoop.hbase.http.HttpServer createServer(String host, int port) throws IOException
host - to bindport - to bindIOException - if it could not be createdpublic static org.apache.hadoop.hbase.http.HttpServer createServer(String webapp) throws IOException
webapp - the webapp to work withIOException - if it could not be createdpublic static org.apache.hadoop.hbase.http.HttpServer createServer(String webapp, org.apache.hadoop.conf.Configuration conf) throws IOException
webapp - the webapp to work withconf - the configuration to use for the serverIOException - if it could not be createdpublic static org.apache.hadoop.hbase.http.HttpServer createServer(String webapp, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.authorize.AccessControlList adminsAcl) throws IOException
IOExceptionprivate static org.apache.hadoop.hbase.http.HttpServer.Builder localServerBuilder(String webapp)
public static org.apache.hadoop.hbase.http.HttpServer createServer(String webapp, org.apache.hadoop.conf.Configuration conf, String[] pathSpecs) throws IOException
webapp - the webapp to work withconf - the configuration to use for the serverpathSpecs - the paths specifications the server will serviceIOException - if it could not be createdpublic static org.apache.hadoop.hbase.http.HttpServer createAndStartTestServer() throws IOException
IOException - on any failureAssertionError - if a condition was not metpublic static void stop(org.apache.hadoop.hbase.http.HttpServer server) throws Exception
server - to stopException - on any failurepublic static URL getServerURL(org.apache.hadoop.hbase.http.HttpServer server) throws MalformedURLException
server - serverMalformedURLException - if the URL cannot be created.protected static String readOutput(URL url) throws IOException
url - URL To readIOException - if something went wrongprotected static void deleteRecursively(File d)
File.protected static int getFreePort() throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.