Package juzu.test.protocol.mock

Examples of juzu.test.protocol.mock.MockViewBridge


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

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


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

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

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

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    assertEquals("pass", render.assertStringResponse());
  }
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);
    String result = render.assertStringResponse();
    assertEquals("pass", result);
  }
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"));
  }
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());
  }
View Full Code Here

  @Test
  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());
    assertEquals("text/html", iterator.next());
  }
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());
  }
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.