public MockApplication<File> application(InjectorProvider injectorProvider, String packageName) { if (application != null) { throw failure("An application is already deployed"); } CompilerAssert<File, File> compiler = compiler(packageName); try { return application = new MockApplication<File>(compiler, injectorProvider, Name.parse(packageName)); } catch (Exception e) { throw AbstractTestCase.failure(e); } }
public MockApplication<File> application(InjectorProvider injectorProvider, String packageName) { if (application != null) { throw failure("An application is already deployed"); } CompilerAssert<File, File> compiler = compiler(packageName); try { return application = new MockApplication<File>(compiler, injectorProvider, Name.parse(packageName)); } catch (Exception e) { throw AbstractTestCase.failure(e); } }
helper.addClassPath(simpleHelper.getClassOutput()); helper.assertCompile(); MockApplication<?> app = new MockApplication<File>( helper, di,
helper.addClassPath(simpleHelper.getClassOutput()); helper.assertCompile(); MockApplication<?> app = new MockApplication<File>( helper, di,
@Test public void testExternal() throws Exception { CompilerAssert<File, File> simpleHelper = compiler("plugin.template.simple"); simpleHelper.assertCompile(); CompilerAssert<File, File> helper = compiler("plugin.template.external"); helper.addClassPath(simpleHelper.getClassOutput()); helper.assertCompile(); MockApplication<?> app = new MockApplication<File>( helper, di, Name.parse("plugin.template.external")); app.init(); MockClient client = app.client(); assertEquals("hello", client.render().assertStringResponse()); }
@Test public void testDecorateExternal() throws Exception { CompilerAssert<File, File> simpleHelper = compiler("plugin.template.tag.decorate"); simpleHelper.assertCompile(); CompilerAssert<File, File> helper = compiler("plugin.template.tag.decorateexternal"); helper.addClassPath(simpleHelper.getClassOutput()); helper.assertCompile(); MockApplication<?> app = new MockApplication<File>( helper, di, Name.parse("plugin.template.tag.decorateexternal")); app.init(); MockClient client = app.client(); assertEquals("<foo>bar</foo>", client.render().assertStringResponse()); }
@Test public void testIncludeExternal() throws Exception { CompilerAssert<File, File> simpleHelper = compiler("plugin.template.simple"); simpleHelper.assertCompile(); CompilerAssert<File, File> helper = compiler("plugin.template.tag.includeexternal"); helper.addClassPath(simpleHelper.getClassOutput()); helper.assertCompile(); MockApplication<?> app = new MockApplication<File>( helper, di, Name.parse("plugin.template.tag.includeexternal")); app.init(); MockClient client = app.client(); assertEquals("hello", client.render().assertStringResponse()); }
@Test public void testExternal() throws Exception { CompilerAssert<File, File> simpleHelper = compiler("plugin.template.simple"); simpleHelper.assertCompile(); CompilerAssert<File, File> helper = compiler("plugin.template.external"); helper.addClassPath(simpleHelper.getClassOutput()); helper.assertCompile(); MockApplication<?> app = new MockApplication<File>( helper, di, Name.parse("plugin.template.external")); app.init(); MockClient client = app.client(); assertEquals("hello", client.render().assertStringResponse()); }
@Test public void testDecorateExternal() throws Exception { CompilerAssert<File, File> simpleHelper = compiler("plugin.template.tag.decorate"); simpleHelper.assertCompile(); CompilerAssert<File, File> helper = compiler("plugin.template.tag.decorateexternal"); helper.addClassPath(simpleHelper.getClassOutput()); helper.assertCompile(); MockApplication<?> app = new MockApplication<File>( helper, di, Name.parse("plugin.template.tag.decorateexternal")); app.init(); MockClient client = app.client(); assertEquals("<foo>bar</foo>", client.render().assertStringResponse()); }
@Test public void testIncludeExternal() throws Exception { CompilerAssert<File, File> simpleHelper = compiler("plugin.template.simple"); simpleHelper.assertCompile(); CompilerAssert<File, File> helper = compiler("plugin.template.tag.includeexternal"); helper.addClassPath(simpleHelper.getClassOutput()); helper.assertCompile(); MockApplication<?> app = new MockApplication<File>( helper, di, Name.parse("plugin.template.tag.includeexternal")); app.init(); MockClient client = app.client(); assertEquals("hello", client.render().assertStringResponse()); }