public class TestHttpPlugin extends ClusterTest
The HTTP reader uses Drill's existing JSON reader class, so the unit tests focus on testing the plugin configurations rather than how well it parses the JSON as this is tested elsewhere.
DrillTest.MemWatcherclient, cluster, dirTestWatcherlogOutcome, objectMapper, REPEAT_RULE, thrownException, TIMEOUT| Constructor and Description |
|---|
TestHttpPlugin() |
| Modifier and Type | Method and Description |
|---|---|
static void |
setup() |
void |
simpleSpecificQuery() |
void |
simpleSpecificQueryWithParams() |
void |
simpleStarQuery()
Evaluates the HTTP plugin with the results from an API that returns the
sunrise/sunset times for a given lat/long and date.
|
void |
simpleTestWithMockServer() |
void |
simpleTestWithMockServerWithParams() |
void |
specificTestWithMockServer() |
void |
testCsvResponse() |
void |
testEmptyContent() |
void |
testEmptyJSONObjectResponse() |
void |
testErrorResponse() |
void |
testHeaders() |
void |
testLimitPushdown() |
void |
testNullContent() |
void |
testPostWithMockServer() |
void |
testSerDe() |
void |
testSlowResponse() |
void |
testXmlResponse() |
void |
testZeroByteResponse() |
void |
verifyPluginConfig() |
void |
wildcardQueryWithParams()
As above, but we return only the contents of
results, and use
filter push-down for the arguments. |
getFile, queryBuilder, run, runAndLog, runAndPrint, runAndPrint, shutdown, startCluster, testBuilderescapeJsonString, finishDrillTest, initDrillTestpublic void simpleStarQuery()
throws Exception
{
"results":
{
"sunrise":"7:27:02 AM",
"sunset":"5:05:55 PM",
"solar_noon":"12:16:28 PM",
"day_length":"9:38:53",
"civil_twilight_begin":"6:58:14 AM",
"civil_twilight_end":"5:34:43 PM",
"nautical_twilight_begin":"6:25:47 AM",
"nautical_twilight_end":"6:07:10 PM",
"astronomical_twilight_begin":"5:54:14 AM",
"astronomical_twilight_end":"6:38:43 PM"
},
"status":"OK"
}
}Exception - Throws exception if something goes awrypublic void wildcardQueryWithParams()
throws Exception
results, and use
filter push-down for the arguments.Exceptionpublic void simpleSpecificQueryWithParams()
throws Exception
Exceptionpublic void simpleTestWithMockServerWithParams()
throws Exception
Exceptionpublic void specificTestWithMockServer()
throws Exception
Exceptionpublic void testEmptyJSONObjectResponse()
throws Exception
ExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.