Package juzu.test.protocol.mock

Examples of juzu.test.protocol.mock.MockApplication


    super(di);
  }

  @Test
  public void testValidation() throws Exception {
    MockApplication app = application("juzu.simple").init();
    MockClient client = app.client();
    MockViewBridge render = client.render();
    ValidationError va = assertInstanceOf(ValidationError.class, render.getResponse());
    Set<ConstraintViolation<Object>> violations = va.getViolations();
    assertEquals(1, violations.size());
    ConstraintViolation<Object> violation = violations.iterator().next();
View Full Code Here


    assertFalse(path.hasNext());
  }

  @Test
  public void testLifeCycle() throws Exception {
    MockApplication app = application("juzu.lifecycle").init();
    MockClient client = app.client();
    o = null;
    client.render();
    ValidationError error = assertInstanceOf(ValidationError.class, o);
    Set<ConstraintViolation<Object>> violations = error.getViolations();
    assertEquals(1, violations.size());
View Full Code Here

    Object ret = invokeErrorHandler("plugin.controller.error.inject");
    assertEquals("plugin.controller.error.inject.A", ret.getClass().getName());
  }

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

    return shared;
  }

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

TOP

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

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.