Package juzu.test.protocol.mock

Examples of juzu.test.protocol.mock.MockClient


  public void testInvalidProperty() throws Exception {
    MockApplication<?> app = application("plugin.controller.url.invalidproperty");
    app.init();

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


  public void testRenderPhase() throws Exception {
    if (getDI() == InjectorProvider.WELD) {
      MockApplication<?> app = application("plugin.controller.postconstruct").init();

      //
      MockClient client = app.client();
      client.render();
      Integer count = Registry.get("count");
      assertEquals((Integer)1, count);
    }
  }
View Full Code Here

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

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

  }

  @Test
  public void testDispatch() throws Exception {
    MockApplication<?> app = application("plugin.controller.lifecycle.dispatch").init();
    MockClient client = app.client();
    MockViewBridge render = client.render();
    render.assertStringResponse("index");
    Integer count = Registry.get("count");
    assertEquals((Integer)2, count);
  }
View Full Code Here

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

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    String out = render.assertStringResponse();
    assertEquals("<juu><foo>bar</foo></juu>", out);
  }
View Full Code Here

  }

  @Test
  public void testOverrideBegin() throws Exception {
    MockApplication<?> app = application("plugin.controller.lifecycle.overridebegin").init();
    MockClient client = app.client();
    MockViewBridge render = client.render();
    render.assertStringResponse("begin");
    Integer count = Registry.get("count");
    assertEquals((Integer)0, count);
  }
View Full Code Here

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

  }

  @Test
  public void testOverrideEnd() throws Exception {
    MockApplication<?> app = application("plugin.controller.lifecycle.overrideend").init();
    MockClient client = app.client();
    MockViewBridge render = client.render();
    render.assertStringResponse("end");
    Integer count = Registry.get("count");
    assertEquals((Integer)2, count);
  }
View Full Code Here

  }

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

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

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    String out = render.assertStringResponse();
    assertEquals("foo", 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.