Package org.elasticsearch.test.fixture
Class AbstractHttpFixture
java.lang.Object
org.elasticsearch.test.fixture.AbstractHttpFixture
Base class for test fixtures that requires a
HttpServer to work.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classRepresents an HTTP Request.static interfaceprotected static classRepresents an HTTP Response. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static byte[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractHttpFixture(String workingDir)protectedAbstractHttpFixture(String workingDir, int port) -
Method Summary
Modifier and TypeMethodDescriptioncontentType(String contentType)protected abstract AbstractHttpFixture.Responsehandle(AbstractHttpFixture.Request request)voidlisten()Opens aHttpServerand start listening on a provided or random port.voidlisten(InetAddress inetAddress, boolean exposePidAndPort)Opens aHttpServerand start listening on a provided or random port.
-
Field Details
-
TEXT_PLAIN_CONTENT_TYPE
-
JSON_CONTENT_TYPE
-
EMPTY_BYTE
protected static final byte[] EMPTY_BYTE
-
-
Constructor Details
-
AbstractHttpFixture
-
AbstractHttpFixture
-
-
Method Details
-
listen
Opens aHttpServerand start listening on a provided or random port.- Throws:
IOExceptionInterruptedException
-
listen
public final void listen(InetAddress inetAddress, boolean exposePidAndPort) throws IOException, InterruptedExceptionOpens aHttpServerand start listening on a provided or random port.- Throws:
IOExceptionInterruptedException
-
handle
protected abstract AbstractHttpFixture.Response handle(AbstractHttpFixture.Request request) throws IOException- Throws:
IOException
-
contentType
-