public MockApplication<P> init() throws Exception { if (lifeCycle == null) { assertCompile(); } if (lifeCycle != null) { Completion refresh = lifeCycle.refresh(); if (refresh.isFailed()) { throw refresh.getCause(); } else { return this; } } else { throw new IllegalStateException("Could not compile application"); } }
public MockApplication<P> init() throws Exception { if (lifeCycle == null) { assertCompile(); } if (lifeCycle != null) { Completion refresh = lifeCycle.refresh(); if (refresh.isFailed()) { throw refresh.getCause(); } else { return this; } } else { throw new IllegalStateException("Could not compile application"); } }
@Test public void testRuntime() throws Exception { MockApplication<?> app = application("plugin.asset.notfound.runtime"); File root = (File)app.getSourcePath().getPath("plugin", "asset", "notfound", "runtime"); File js = new File(root, "assets/notfound.js"); assertTrue(js.getParentFile().mkdirs()); assertTrue(js.createNewFile()); app.assertCompile(); root = (File)app.getClasses().getPath("plugin", "asset", "notfound", "runtime"); js = new File(root, "assets/notfound.js"); assertTrue(js.delete()); try { app.init(); fail(); } catch (Exception ignore) { } } }
@Test public void testRuntime() throws Exception { MockApplication<?> app = application("plugin.asset.notfound.runtime"); File root = (File)app.getSourcePath().getPath("plugin", "asset", "notfound", "runtime"); File js = new File(root, "assets/notfound.js"); assertTrue(js.getParentFile().mkdirs()); assertTrue(js.createNewFile()); app.assertCompile(); root = (File)app.getClasses().getPath("plugin", "asset", "notfound", "runtime"); js = new File(root, "assets/notfound.js"); assertTrue(js.delete()); try { app.init(); fail(); } catch (Exception ignore) { } } }