Package juzu.test.protocol.mock

Examples of juzu.test.protocol.mock.MockRequestBridge


    //
    MockClient client = app.client();

    //
    MockRequestBridge request = client.render();
    List<Scoped> attributes = request.getAttributesHistory();
    assertEquals(1, attributes.size());
    Identifiable car = (Identifiable)attributes.iterator().next().get();
    assertEquals(Identifiable.DESTROYED, car.getStatus());

    //
    long id1 = Registry.<Long>unset("car");
    assertEquals(car.getIdentityHashCode(), id1);
    assertEquals(Identifiable.MANAGED, (int)Registry.<Integer>unset("status"));

    //
    request = client.invoke(Registry.<String>unset("action"));
    attributes = request.getAttributesHistory();
    assertEquals(1, attributes.size());
    car = (Identifiable)attributes.iterator().next().get();
    assertEquals(Identifiable.DESTROYED, car.getStatus());

    //
    long id2 = Registry.<Long>unset("car");
    assertNotSame(id1, id2);
    assertEquals(id2, id2);
    assertEquals(Identifiable.MANAGED, (int)Registry.<Integer>unset("status"));

    //
    request = client.invoke(Registry.<String>unset("resource"));
    attributes = request.getAttributesHistory();
    assertEquals(1, attributes.size());
    car = (Identifiable)attributes.iterator().next().get();
    assertEquals(Identifiable.DESTROYED, car.getStatus());

    //
View Full Code Here


    MockApplication<?> app = application("plugin.controller.action.throwable.checked").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockRequestBridge request = client.invoke(render.assertStringResponse());
    request.assertFailure(AuthenticationException.class);
  }
View Full Code Here

    MockApplication<?> app = application("plugin.controller.action.throwable.runtime").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockRequestBridge request = client.invoke(render.assertStringResponse());
    request.assertFailure(ConcurrentModificationException.class);
  }
View Full Code Here

    MockApplication<?> app = application("plugin.controller.action.throwable.error").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockRequestBridge request = client.invoke(render.assertStringResponse());
    request.assertFailure(UnknownError.class);
  }
View Full Code Here

    MockApplication<?> app = application("plugin.controller.resource.throwable.checked").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockRequestBridge request = client.invoke(render.assertStringResponse());
    request.assertFailure(AuthenticationException.class);
  }
View Full Code Here

    MockApplication<?> app = application("plugin.controller.resource.throwable.runtime").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockRequestBridge request = client.invoke(render.assertStringResponse());
    request.assertFailure(ConcurrentModificationException.class);
  }
View Full Code Here

    MockApplication<?> app = application("plugin.controller.resource.throwable.error").init();

    //
    MockClient client = app.client();
    MockViewBridge render = client.render();
    MockRequestBridge request = client.invoke(render.assertStringResponse());
    request.assertFailure(UnknownError.class);
  }
View Full Code Here

TOP

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

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.