use of org.webpieces.router.api.simplesvr.NullTemplateApi in project webpieces by deanhiller.
the class ErrorCommonTest method createServer.
public static RouterService createServer(boolean isProdTest, String moduleFileContents) {
VirtualFile f = new VirtualFileInputStream(moduleFileContents.getBytes(), "testAppModules");
SimpleMeterRegistry metrics = new SimpleMeterRegistry();
TemplateApi nullApi = new NullTemplateApi();
if (isProdTest)
return RouterServiceFactory.create("ErrorCommonTest", metrics, f, nullApi);
// otherwise create the development server
String filePath = System.getProperty("user.dir");
File myCodePath = new File(filePath + "/src/test/java");
VirtualFile cacheLocation = new VirtualFileImpl(FileFactory.newCacheLocation("webpieces/" + ErrorCommonTest.class.getSimpleName() + "/bytecode"));
CompileConfig compileConfig = new CompileConfig(new VirtualFileImpl(myCodePath), cacheLocation);
log.info("bytecode dir=" + compileConfig.getByteCodeCacheDir());
RouterService server = DevRouterFactory.create("ErrorCommonTest", metrics, f, compileConfig, nullApi);
return server;
}
Aggregations