Search in sources :

Example 6 with CompileConfig

use of org.webpieces.compiler.api.CompileConfig 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 } });
}
Also used : VirtualFile(org.webpieces.util.file.VirtualFile) VirtualFileInputStream(org.webpieces.router.api.mocks.VirtualFileInputStream) RouterService(org.webpieces.router.api.RouterService) CompileConfig(org.webpieces.compiler.api.CompileConfig) VirtualFileImpl(org.webpieces.util.file.VirtualFileImpl) File(java.io.File) VirtualFile(org.webpieces.util.file.VirtualFile) RouterConfig(org.webpieces.router.api.RouterConfig)

Aggregations

CompileConfig (org.webpieces.compiler.api.CompileConfig)6 VirtualFile (org.webpieces.util.file.VirtualFile)4 VirtualFileImpl (org.webpieces.util.file.VirtualFileImpl)4 File (java.io.File)3 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)2 RouterService (org.webpieces.router.api.RouterService)2 VirtualFileInputStream (org.webpieces.router.api.mocks.VirtualFileInputStream)2 Module (com.google.inject.Module)1 Callable (java.util.concurrent.Callable)1 Test (org.junit.Test)1 CompileOnDemandImpl (org.webpieces.compiler.impl.CompileOnDemandImpl)1 ForTestRouteId (org.webpieces.compiler.impl.test.ForTestRouteId)1 DevRouterModule (org.webpieces.devrouter.api.DevRouterModule)1 RouterConfig (org.webpieces.router.api.RouterConfig)1 TemplateCompileConfig (org.webpieces.templatingdev.api.TemplateCompileConfig)1 WebserverForTest (org.webpieces.webserver.WebserverForTest)1 PlatformOverridesForTest (org.webpieces.webserver.test.PlatformOverridesForTest)1