Package juzu.test.protocol.mock

Examples of juzu.test.protocol.mock.MockClient


  }

  @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);
  }
View Full Code Here


  @Test
  public void testIncludeDouble() throws Exception {
    MockApplication<?> app = application("plugin.template.tag.includedouble").init();

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

  }

  @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);
  }
View Full Code Here

  @Test
  public void testIncludeTwice() throws Exception {
    MockApplication<?> app = application("plugin.template.tag.includetwice").init();

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

    MockApplication<?> app = new MockApplication<File>(
        helper,
        di,
        Name.parse("plugin.template.tag.includeexternal"));
    app.init();
    MockClient client = app.client();
    assertEquals("hello", client.render().assertStringResponse());
  }
View Full Code Here

  @Test
  public void testTitle() throws Exception {
    MockApplication<?> app = application("plugin.template.tag.title").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    String url = render.assertStringResponse();
    assertEquals("the_title", render.getTitle());
    render = (MockViewBridge)client.invoke(url);
    assertEquals("4", render.getTitle());
  }
View Full Code Here

  public void testParam() throws Exception {
    if (getDI() != InjectorProvider.GUICE) {
      MockApplication<?> app = application("plugin.template.tag.param").init();

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

  }

  @Test
  public void testSimpleRender() throws Exception {
    MockApplication<?> app = application("plugin.template.tag.simple.render").init();
    MockClient client = app.client();
    MockViewBridge render = client.render();
    String out = render.assertStringResponse();
    assertEquals("foothe_tagbar", out);
  }
View Full Code Here

TOP

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

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.