@Test public void testConstructorError() throws Exception { MockApplication<?> app = application("plugin.controller.constructor.throwable.error").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(UnknownError.class); }
@Test public void testConstructorChecked() throws Exception { MockApplication<?> app = application("plugin.controller.constructor.throwable.checked").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(AuthenticationException.class); }
@Test public void testConstructorRuntime() throws Exception { MockApplication<?> app = application("plugin.controller.constructor.throwable.runtime").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(ConcurrentModificationException.class); }
@Test public void testRenderChecked() throws Exception { MockApplication<?> app = application("plugin.controller.view.throwable.checked").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(AuthenticationException.class); }
@Test public void testRenderError() throws Exception { MockApplication<?> app = application("plugin.controller.view.throwable.error").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(UnknownError.class); }
@Test public void testConstructorChecked() throws Exception { MockApplication<?> app = application("plugin.controller.constructor.throwable.checked").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(AuthenticationException.class); }
@Test public void testConstructorError() throws Exception { MockApplication<?> app = application("plugin.controller.constructor.throwable.error").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(UnknownError.class); }
@Test public void testRenderChecked() throws Exception { MockApplication<?> app = application("plugin.controller.view.throwable.checked").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(AuthenticationException.class); }
@Test public void testRenderRuntime() throws Exception { MockApplication<?> app = application("plugin.controller.view.throwable.runtime").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(ConcurrentModificationException.class); }
@Test public void testRenderError() throws Exception { MockApplication<?> app = application("plugin.controller.view.throwable.error").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(UnknownError.class); }
private <T extends Throwable> T runParseError(String pkg, Class<T> expected) throws Exception { MockApplication<File> application = application(InjectorProvider.GUICE, pkg); MockApplication<?> app = application.init(); // MockClient client = app.client(); MockViewBridge render = client.render(); MockViewBridge action = (MockViewBridge)client.invoke(render.assertStringResponse()); return action.assertFailure(expected); }
private <T extends Throwable> T runParseError(String pkg, Class<T> expected) throws Exception { MockApplication<File> application = application(InjectorProvider.GUICE, pkg); MockApplication<?> app = application.init(); // MockClient client = app.client(); MockViewBridge render = client.render(); MockViewBridge action = (MockViewBridge)client.invoke(render.assertStringResponse()); return action.assertFailure(expected); }
@Test public void testChecked() throws Exception { MockApplication<?> app = application("plugin.template.throwable.checked").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); TemplateExecutionException te = render.assertFailure(TemplateExecutionException.class); assertInstanceOf(AuthenticationException.class, te.getCause()); }
@Test public void testRuntime() throws Exception { MockApplication<?> app = application("plugin.template.throwable.runtime").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); TemplateExecutionException te = render.assertFailure(TemplateExecutionException.class); assertInstanceOf(ConcurrentModificationException.class, te.getCause()); }
@Test public void testFailureEnd() throws Exception { MockApplication<?> app = application("plugin.controller.lifecycle.failureend").init(); MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(ConcurrentModificationException.class); Integer count = Registry.get("count"); assertEquals((Integer)2, count); } }
@Test public void testFailureEnd() throws Exception { MockApplication<?> app = application("plugin.controller.lifecycle.failureend").init(); MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(ConcurrentModificationException.class); Integer count = Registry.get("count"); assertEquals((Integer)2, count); } }
@Test public void testFailureDispatch() throws Exception { MockApplication<?> app = application("plugin.controller.lifecycle.failuredispatch").init(); MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(ConcurrentModificationException.class); Integer count = Registry.get("count"); assertEquals((Integer)2, count); }
@Test public void testChecked() throws Exception { MockApplication<?> app = application("plugin.template.throwable.checked").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); TemplateExecutionException te = render.assertFailure(TemplateExecutionException.class); assertInstanceOf(AuthenticationException.class, te.getCause()); }
@Test public void testFailureBegin() throws Exception { MockApplication<?> app = application("plugin.controller.lifecycle.failurebegin").init(); MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(ConcurrentModificationException.class); Integer count = Registry.get("count"); assertEquals((Integer)0, count); }
@Test public void testFailureDispatch() throws Exception { MockApplication<?> app = application("plugin.controller.lifecycle.failuredispatch").init(); MockClient client = app.client(); MockViewBridge render = client.render(); render.assertFailure(ConcurrentModificationException.class); Integer count = Registry.get("count"); assertEquals((Integer)2, count); }