use of com.questdb.BootstrapEnv in project questdb by bluestreak01.
the class HttpServerTest method testImportIntoBusyJournal2.
@Test
public void testImportIntoBusyJournal2() throws Exception {
WriterFactory f = getFactory();
try (JournalWriter w = f.writer(new JournalStructure("small.csv").$int("X").$int("Y").$())) {
JournalEntryWriter ew = w.entryWriter();
ew.putInt(0, 3);
ew.putInt(1, 30);
ew.append();
w.commit();
BootstrapEnv env = new BootstrapEnv();
env.configuration = new ServerConfiguration();
env.factory = getFactory();
env.typeProbeCollection = TYPE_PROBE_COLLECTION;
env.matcher = new SimpleUrlMatcher() {
{
put("/imp", new ImportHandler(env));
}
};
HttpServer server = new HttpServer(env);
server.start();
StringBuilder response = new StringBuilder();
try {
Assert.assertEquals(200, HttpTestUtils.upload("/csv/small.csv", "http://localhost:9000/imp?fmt=json", null, response));
Assert.assertTrue(Chars.startsWith(response, "{\"status\":\"com.questdb.ex.WriterBusyException\"}"));
} catch (IOException e) {
Assert.assertTrue(e.getMessage().contains("Connection reset"));
} finally {
server.halt();
}
}
}
use of com.questdb.BootstrapEnv in project questdb by bluestreak01.
the class HttpServerTest method testNativeConcurrentDownload.
@Test
public void testNativeConcurrentDownload() throws Exception {
final ServerConfiguration configuration = new ServerConfiguration(new File(resourceFile("/site"), "conf/questdb.conf"));
BootstrapEnv env = new BootstrapEnv();
env.configuration = configuration;
env.configuration.getSslConfig().setSecure(false);
env.matcher = new SimpleUrlMatcher() {
{
setDefaultHandler(new StaticContentHandler(env));
}
};
final MimeTypes mimeTypes = new MimeTypes(env.configuration.getMimeTypes());
HttpServer server = new HttpServer(env);
server.start();
assertConcurrentDownload(mimeTypes, server, "http");
}
use of com.questdb.BootstrapEnv in project questdb by bluestreak01.
the class QueryHandlerConsistencyTest method testQueryHandlerConsistency.
@Test
public void testQueryHandlerConsistency() throws Exception {
BootstrapEnv env = new BootstrapEnv();
env.configuration = new ServerConfiguration();
env.factory = FACTORY_CONTAINER.getFactory();
testHandler(new QueryHandler(env));
}
use of com.questdb.BootstrapEnv in project questdb by bluestreak01.
the class QueryHandlerSmallBufferTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
BootstrapEnv env = new BootstrapEnv();
env.configuration = new ServerConfiguration();
env.configuration.setHttpBufRespContent(128);
env.factory = FACTORY_CONTAINER.getFactory();
handler = new QueryHandler(env);
env.matcher = new SimpleUrlMatcher() {
{
put("/js", handler);
}
};
server = new HttpServer(env);
server.start();
QueryHandlerTest.generateJournal("large", RECORD_COUNT);
}
use of com.questdb.BootstrapEnv in project questdb by bluestreak01.
the class JsonSchemaParserTest method setUpClass.
@BeforeClass
public static void setUpClass() {
BootstrapEnv env = new BootstrapEnv();
env.dateFormatFactory = new DateFormatFactory();
env.dateLocaleFactory = new DateLocaleFactory(new TimeZoneRuleFactory());
defaultLocaleId = env.dateLocaleFactory.getDefaultDateLocale().getId();
jsonSchemaParser = new JsonSchemaParser(env);
}
Aggregations