Package juzu.test.protocol.mock

Examples of juzu.test.protocol.mock.MockViewBridge


  public void testError() throws Exception {
    MockApplication<?> app = application("plugin.template.throwable.error").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    render.assertFailure(UnknownError.class);
  }
View Full Code Here


  public void testNoOp() throws Exception {
    MockApplication<?> app = application("plugin.controller.action.noop").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockActionBridge action = (MockActionBridge)client.invoke(render.assertStringResponse());
    action.assertNoResponse();
  }
View Full Code Here

  public void testRedirect() throws Exception {
    MockApplication<?> app = application("plugin.controller.action.redirect").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockActionBridge action = (MockActionBridge)client.invoke(render.assertStringResponse());
    action.assertRedirect("http://www.julienviet.com");
  }
View Full Code Here

  public void testRender() throws Exception {
    MockApplication<?> app = application("plugin.controller.action.render").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockActionBridge action = (MockActionBridge)client.invoke(render.assertStringResponse());
    action.assertRender("render", Collections.singletonMap("arg", "arg_value"));
  }
View Full Code Here

  public void testResolveBean() throws Exception {
    MockApplication<?> app = application("plugin.template.el").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    assertEquals("A", render.assertStringResponse());
  }
View Full Code Here

  public void testResolveBean() throws Exception {
    MockApplication<?> app = application(di, "plugin.template.ambiguous.app1").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    assertEquals("app1", render.assertStringResponse());
  }
View Full Code Here

  public void testIndex() throws Exception {
    MockApplication<?> app = application("plugin.controller.view.index").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    assertEquals("index", render.assertStringResponse());
  }
View Full Code Here

  public void testParameterizedIndex() throws Exception {
    MockApplication<?> app = application("plugin.controller.view.parameterizedindex").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    String result = render.assertStringResponse();
    Matcher m = P.matcher(result);
    assertTrue("Was expecting " + result + " to match", m.matches());
    assertEquals("0", m.group(1));
    render = (MockViewBridge)client.invoke(m.group(2));
    m.reset(result = render.assertStringResponse());
    assertTrue("Was expecting " + result + " to match", m.matches());
    assertEquals("1", m.group(1));
    render = (MockViewBridge)client.invoke(m.group(2));
    m.reset(result = render.assertStringResponse());
    assertTrue("Was expecting " + result + " to match", m.matches());
    assertEquals("0", m.group(1));
  }
View Full Code Here

  public void testOverridenIndex() throws Exception {
    MockApplication<?> app = application("plugin.controller.view.overridenindex").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    String result = render.assertStringResponse();
    Matcher m = P.matcher(result);
    assertTrue("Was expecting " + result + " to match", m.matches());
    assertEquals("0", m.group(1));
    render = (MockViewBridge)client.invoke(m.group(2));
    m.reset(result = render.assertStringResponse());
    assertTrue("Was expecting " + result + " to match", m.matches());
    assertEquals("1", m.group(1));
    render = (MockViewBridge)client.invoke(m.group(2));
    m.reset(result = render.assertStringResponse());
    assertTrue("Was expecting " + result + " to match", m.matches());
    assertEquals("2", m.group(1));
  }
View Full Code Here

  @Test
  public void testResponse() throws Exception {
    MockApplication<?> app = application("plugin.controller.view.response").init();

    MockClient client = app.client();
    MockViewBridge render = client.render();
    String result = render.assertStringResponse();
    assertEquals("foo", result);
  }
View Full Code Here

TOP

Related Classes of juzu.test.protocol.mock.MockViewBridge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.