Package org.elasticsearch.test.fixture
Class AbstractHttpFixture
- java.lang.Object
-
- org.elasticsearch.test.fixture.AbstractHttpFixture
-
public abstract class AbstractHttpFixture extends java.lang.ObjectBase class for test fixtures that requires aHttpServerto work.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractHttpFixture.RequestRepresents an HTTP Request.static interfaceAbstractHttpFixture.RequestHandlerprotected static classAbstractHttpFixture.ResponseRepresents an HTTP Response.
-
Field Summary
Fields Modifier and Type Field Description protected static byte[]EMPTY_BYTEprotected static java.util.Map<java.lang.String,java.lang.String>JSON_CONTENT_TYPEprotected static java.util.Map<java.lang.String,java.lang.String>TEXT_PLAIN_CONTENT_TYPE
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractHttpFixture(java.lang.String workingDir)
-
Method Summary
Modifier and Type Method Description protected static java.util.Map<java.lang.String,java.lang.String>contentType(java.lang.String contentType)protected abstract AbstractHttpFixture.Responsehandle(AbstractHttpFixture.Request request)voidlisten()Opens aHttpServerand start listening on a random port.
-
-
-
Method Detail
-
listen
public final void listen() throws java.io.IOException, java.lang.InterruptedExceptionOpens aHttpServerand start listening on a random port.- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
handle
protected abstract AbstractHttpFixture.Response handle(AbstractHttpFixture.Request request) throws java.io.IOException
- Throws:
java.io.IOException
-
contentType
protected static java.util.Map<java.lang.String,java.lang.String> contentType(java.lang.String contentType)
-
-