use of org.webpieces.router.api.RouterConfig in project webpieces by deanhiller.
the class TestProdRouter method bothServers.
@SuppressWarnings("rawtypes")
@Parameterized.Parameters
public static Collection bothServers() {
String moduleFileContents = AppModules.class.getName();
VirtualFile f = new VirtualFileInputStream(moduleFileContents.getBytes(), "testAppModules");
TestModule module = new TestModule();
RouterConfig config = new RouterConfig().setMetaFile(f).setWebappOverrides(module).setSecretKey(SecretKeyInfo.generateForTest());
RouterService prodSvc = RouterSvcFactory.create(config);
return Arrays.asList(new Object[][] { { prodSvc, module } });
}
use of org.webpieces.router.api.RouterConfig in project webpieces by deanhiller.
the class TestSimpleRoutes method bothServers.
@SuppressWarnings("rawtypes")
@Parameterized.Parameters
public static Collection bothServers() {
String moduleFileContents = AppModules.class.getName();
VirtualFile f = new VirtualFileInputStream(moduleFileContents.getBytes(), "testAppModules");
TestModule module = new TestModule();
RouterConfig config = new RouterConfig().setMetaFile(f).setWebappOverrides(module).setSecretKey(SecretKeyInfo.generateForTest());
RouterService prodSvc = RouterSvcFactory.create(config);
//for dev must be null
config.setWebappOverrides(null);
String filePath = System.getProperty("user.dir");
File myCodePath = new File(filePath + "/src/test/java");
CompileConfig compileConfig = new CompileConfig(new VirtualFileImpl(myCodePath));
RouterService devSvc = DevRouterFactory.create(config, compileConfig);
return Arrays.asList(new Object[][] { { prodSvc, module }, { devSvc, module } });
}
use of org.webpieces.router.api.RouterConfig in project webpieces by deanhiller.
the class TestCompressionCache method setUp.
@Before
public void setUp() throws IOException {
FileUtils.deleteDirectory(cacheDir);
log.info("deleting dir=" + cacheDir);
File stagingDir = new File("output/staging");
FileUtils.deleteDirectory(stagingDir);
RouterConfig config = new RouterConfig();
config.setSecretKey(SecretKeyInfo.generateForTest());
config.setCachedCompressedDirectory(cacheDir);
Module allMods = Modules.override(new ProdRouterModule(config)).with(new TestModule());
Injector injector = Guice.createInjector(allMods);
cache = injector.getInstance(CompressionCacheSetup.class);
}
Aggregations