use of org.webpieces.webserver.api.WebServerConfig in project webpieces by deanhiller.
the class PrivateWebserverForTest method init.
private void init(PrivateTestConfig testConfig, String... args) {
// read here and checked for correctness on last line of server construction
Arguments arguments = new CommandLineParser().parse(args);
String filePath = System.getProperty("user.dir");
log.info("property user.dir=" + filePath);
File baseWorkingDir = FileFactory.getBaseWorkingDir();
// 3 pieces to the webserver so a configuration for each piece
WebServerConfig config = new WebServerConfig().setPlatformOverrides(testConfig.getPlatformOverrides());
RouterConfig routerConfig = new RouterConfig(baseWorkingDir, "webpiecesTestSuite").setMetaFile(testConfig.getMetaFile()).setWebappOverrides(testConfig.getAppOverrides()).setFileEncoding(CHAR_SET_TO_USE).setDefaultResponseBodyEncoding(CHAR_SET_TO_USE).setCachedCompressedDirectory(cacheDir).setSecretKey(SecretKeyInfo.generateForTest()).setTokenCheckOn(testConfig.isUseTokenCheck());
TemplateConfig templateConfig = new TemplateConfig();
webServer = WebServerFactory.create(config, routerConfig, templateConfig, arguments);
arguments.checkConsumedCorrectly();
}
Aggregations