Package juzu.test.protocol.mock

Examples of juzu.test.protocol.mock.MockClient


  }

  @Test
  public void testContextutal() throws Exception {
    MockApplication<?> app = application(InjectorProvider.WELD, "plugin.template.url.contextual").init();
    MockClient client = app.client();
    String url = client.render().assertStringResponse();
    assertEquals("pass", ((MockViewBridge)client.invoke(url)).assertStringResponse());
  }
View Full Code Here


    writer.append("plugin.binding.provider.factory.create.ProviderFactoryImpl");
    writer.close();
    app.init();

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

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

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

  @Test
  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

  @Test
  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

  @Test
  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

  @Test
  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

  public void testLifeCycle() throws Exception {
    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

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.