use of com.questdb.net.http.handlers.UploadHandler in project questdb by bluestreak01.
the class HttpServerTest method testUpload.
@Test
public void testUpload() throws Exception {
final File dir = temp.newFolder();
BootstrapEnv env = new BootstrapEnv();
env.configuration = new ServerConfiguration();
env.matcher = new SimpleUrlMatcher() {
{
put("/upload", new UploadHandler(dir));
}
};
HttpServer server = new HttpServer(env);
server.start();
File expected = resourceFile("/csv/test-import.csv");
File actual = new File(dir, "test-import.csv");
upload(expected);
TestUtils.assertEquals(expected, actual);
server.halt();
}
use of com.questdb.net.http.handlers.UploadHandler in project questdb by bluestreak01.
the class HttpServerTest method testRangesNative.
@Test
// fix is in server, which would allow limited number of this iterations after which connection is closed.
@Ignore
public void testRangesNative() throws Exception {
BootstrapEnv env = new BootstrapEnv();
env.configuration = new ServerConfiguration(new File(HttpServerTest.class.getResource("/site").getPath(), "conf/questdb.conf")) {
@Override
public File getHttpPublic() {
return temp.getRoot();
}
};
env.configuration.setHttpThreads(1);
env.configuration.setHttpSoRetries(10);
env.configuration.getSslConfig().setSecure(false);
env.matcher = new SimpleUrlMatcher() {
{
put("/upload", new UploadHandler(env.configuration.getHttpPublic()));
setDefaultHandler(new StaticContentHandler(env));
}
};
assertRanges(new HttpServer(env));
}
Aggregations