use of io.divolte.server.ServerTestUtils.TestServer in project divolte-collector by divolte.
the class JsonSourceTest method startRequest.
private HttpURLConnection startRequest() throws IOException {
final TestServer testServer = this.testServer.orElseThrow(() -> new IllegalStateException("No test server available"));
final String url = String.format(urlTemplate.orElseThrow(() -> new IllegalStateException("No URL template available")), testServer.host, testServer.port);
return (HttpURLConnection) new URL(url).openConnection();
}
use of io.divolte.server.ServerTestUtils.TestServer in project divolte-collector by divolte.
the class SeleniumTestBase method doSetUp.
private void doSetUp(final Optional<String> configFileName) throws Exception {
final String driverName = System.getenv().getOrDefault(DRIVER_ENV_VAR, PHANTOMJS_DRIVER);
switch(driverName) {
case CHROME_DRIVER:
setupLocalChrome();
break;
case SAFARI_DRIVER:
driver = new SafariDriver();
break;
case SAUCE_DRIVER:
setupSauceLabs();
break;
case BS_DRIVER:
setupBrowserStack();
break;
case PHANTOMJS_DRIVER:
default:
driver = new PhantomJSDriver();
break;
}
final WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(WINDOW_AVAILABLE);
server = configFileName.map(TestServer::new).orElseGet(TestServer::new);
}
use of io.divolte.server.ServerTestUtils.TestServer in project divolte-collector by divolte.
the class DslRecordMapperTest method setupServer.
private void setupServer(final String mapping) throws IOException {
mappingFile = File.createTempFile("test-mapping", ".groovy");
copyResourceToFile(mapping, mappingFile);
avroFile = File.createTempFile("TestSchema-", ".avsc");
copyResourceToFile("TestRecord.avsc", avroFile);
final ImmutableMap<String, Object> mappingConfig = ImmutableMap.of("divolte.mappings.test.mapping_script_file", mappingFile.getAbsolutePath(), "divolte.mappings.test.schema_file", avroFile.getAbsolutePath());
server = new TestServer("base-test-server.conf", mappingConfig);
}
use of io.divolte.server.ServerTestUtils.TestServer in project divolte-collector by divolte.
the class RequestChecksumTest method setServerConf.
private void setServerConf(final Map<String, Object> configurationProperties) {
if (null == server || !configurationProperties.equals(serverProperties)) {
serverProperties = ImmutableMap.copyOf(configurationProperties);
setServer(new TestServer("base-test-server.conf", serverProperties));
}
}
Aggregations