Search in sources :

Example 1 with WebServerConfig

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();
}
Also used : WebServerConfig(org.webpieces.webserver.api.WebServerConfig) Arguments(org.webpieces.util.cmdline2.Arguments) TemplateConfig(org.webpieces.templating.api.TemplateConfig) CommandLineParser(org.webpieces.util.cmdline2.CommandLineParser) File(java.io.File) VirtualFile(org.webpieces.util.file.VirtualFile) RouterConfig(org.webpieces.router.api.RouterConfig)

Aggregations

File (java.io.File)1 RouterConfig (org.webpieces.router.api.RouterConfig)1 TemplateConfig (org.webpieces.templating.api.TemplateConfig)1 Arguments (org.webpieces.util.cmdline2.Arguments)1 CommandLineParser (org.webpieces.util.cmdline2.CommandLineParser)1 VirtualFile (org.webpieces.util.file.VirtualFile)1 WebServerConfig (org.webpieces.webserver.api.WebServerConfig)1