use of com.facebook.airlift.http.client.jetty.JettyHttpClient in project presto by prestodb.
the class TestGenerateTokenFilter method setup.
@BeforeClass
public void setup() throws Exception {
server = new TestingPrestoServer(ImmutableList.of(new TestGenerateTokenFilterModule()));
httpClient = (JettyHttpClient) server.getInstance(Key.get(HttpClient.class, GenerateTokenFilterTest.class));
// extract the filter
List<HttpRequestFilter> filters = httpClient.getRequestFilters();
assertEquals(filters.size(), 2);
assertInstanceOf(filters.get(1), GenerateTraceTokenRequestFilter.class);
filter = (GenerateTraceTokenRequestFilter) filters.get(1);
}
use of com.facebook.airlift.http.client.jetty.JettyHttpClient in project presto by prestodb.
the class TestNodeResource method setup.
@BeforeMethod
public void setup() throws Exception {
server = new TestingPrestoServer();
client = new JettyHttpClient();
}
use of com.facebook.airlift.http.client.jetty.JettyHttpClient in project presto by prestodb.
the class TestServer method setup.
@BeforeMethod
public void setup() throws Exception {
server = new TestingPrestoServer();
client = new JettyHttpClient();
}
use of com.facebook.airlift.http.client.jetty.JettyHttpClient in project presto by prestodb.
the class TestQueues method setup.
@BeforeMethod
public void setup() throws Exception {
queryRunner = createQueryRunner();
client = new JettyHttpClient();
objectMapper = new JsonObjectMapperProvider().get();
objectMapper.registerModule(new SimpleModule() {
{
addKeyDeserializer(VariableReferenceExpression.class, new Serialization.VariableReferenceExpressionDeserializer(createTestFunctionAndTypeManager()));
}
});
}
use of com.facebook.airlift.http.client.jetty.JettyHttpClient in project presto by prestodb.
the class TestDistributedQueryResource method setup.
@BeforeMethod
public void setup() throws Exception {
client = new JettyHttpClient();
DistributedQueryRunner runner = createQueryRunner(ImmutableMap.of("query.client.timeout", "20s"), 2);
coordinator1 = runner.getCoordinator(0);
coordinator2 = runner.getCoordinator(1);
Optional<TestingPrestoServer> resourceManager = runner.getResourceManager();
checkState(resourceManager.isPresent(), "resource manager not present");
this.resourceManager = resourceManager.get();
coordinator1.getResourceGroupManager().get().addConfigurationManagerFactory(new FileResourceGroupConfigurationManagerFactory());
coordinator1.getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
coordinator2.getResourceGroupManager().get().addConfigurationManagerFactory(new FileResourceGroupConfigurationManagerFactory());
coordinator2.getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
}
Aggregations