Package juzu.test.protocol.mock

Examples of juzu.test.protocol.mock.MockClient.render()


  public void testCreate() throws Exception {
    MockApplication<?> app = application("plugin.binding.create").init();

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

  @Test
  public void testScope() throws Exception {
View Full Code Here


  public void testScope() throws Exception {
    MockApplication<?> app = application("plugin.binding.scope").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    String url = render.assertStringResponse();
    assertNotSame("", url);

    //
    render = (MockViewBridge)client.invoke(url);
View Full Code Here

    Registry.unset("request.filter.lifecycle");
    MockApplication<?> app = application("plugin.controller.requestfilter.lifecycle").init();
    Tools.list(app.getLifeCycle().resolveBeans(RequestFilter.class));
    assertEquals("created", Registry.get("request.filter.lifecycle"));
    MockClient client = app.client();
    MockViewBridge render = client.render();
    assertEquals("after", Registry.get("request.filter.lifecycle"));
  }

  @Test
  public void testFailure() throws Exception {
View Full Code Here

  @Test
  public void testFailure() throws Exception {
    MockApplication<?> app = application("plugin.controller.requestfilter.failure").init();
    MockClient client = app.client();
    MockViewBridge render = client.render();
    assertEquals("pass", render.assertStringResponse());
  }

  @Test
  public void testFailing() throws Exception {
View Full Code Here

  public void testFailing() throws Exception {
    MockApplication<?> app = application("plugin.controller.requestfilter.failing").init();
    MockClient client = app.client();
    MockViewBridge render = null;
    try {
      render = client.render();
      fail("Was expecting " + ConcurrentModificationException.class + " to be thrown");
    }
    catch (ConcurrentModificationException expected) {
    }
  }
View Full Code Here

  private Object invokeErrorHandler(String pkg) throws Exception {
    MockApplication app = application(pkg).init();
    MockClient client = app.client();
    shared = null;
    MockViewBridge render = client.render();
    render.assertOk();
    render.assertStringResponse("hello");
    assertNotNull(shared);
    return shared;
  }
View Full Code Here

  @Test
  public void testMimeType() throws Exception {
    MockApplication app = application("plugin.controller.mimetype.html").init();
    MockClient client = app.client();
    MockViewBridge render = client.render();
    render.assertStringResponse("HELLO");
    Iterable<String> mimeType = render.getResponse().getProperties().getValues(PropertyType.MIME_TYPE);
    assertNotNull(mimeType);
    Iterator<String> iterator = mimeType.iterator();
    assertTrue(iterator.hasNext());
View Full Code Here

  public void testSimple() throws Exception {
    // We only use CDI for its capability to discover beans automatically
    MockApplication<?> application = application(InjectorProvider.WELD, "plugin.controller.contextual.simple");
    application.init();
    MockClient client = application.client();
    MockViewBridge request = client.render();
    Assert.assertEquals("__foo__", request.assertStringResponse());
  }

  @Test
  public void testRequest() throws Exception {
View Full Code Here

  @Test
  public void testRequest() throws Exception {
    MockApplication<?> application = application(InjectorProvider.GUICE, "plugin.controller.contextual.request");
    application.init();
    MockClient client = application.client();
    MockViewBridge request = client.render();
    Assert.assertEquals("pass", request.assertStringResponse());
  }
}
View Full Code Here

    //
    MockClient client = app.client();

    //
    MockViewBridge render = client.render("none");
    MockViewBridge mv = (MockViewBridge)client.invoke(render.assertStringResponse());
    assertEquals("", mv.assertStringResponse());

    //
    render = client.render("0");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.