Examples of SimpleFooRequest


Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

  }

  public void testViolationAbsent() {
    delayTestFinish(DELAY_TEST_FINISH);

    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy newFoo = context.create(SimpleFooProxy.class);
    final Request<Void> fooReq = context.persist().using(newFoo);

    newFoo = context.edit(newFoo);
    newFoo.setUserName("Amit"); // will not cause violation.

    fooReq.fire(new Receiver<Void>() {
      @Override
      public void onSuccess(Void ignore) {
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

  }

  public void testViolationsOnCreate() {
    delayTestFinish(DELAY_TEST_FINISH);

    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy newFoo = context.create(SimpleFooProxy.class);
    final Request<SimpleFooProxy> create = context.persistAndReturnSelf().using(newFoo);
    new FailFixAndRefire<SimpleFooProxy>(newFoo, context, create).doTest();
  }
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

  }

  public void testViolationsOnCreateVoidReturn() {
    delayTestFinish(DELAY_TEST_FINISH);

    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy newFoo = context.create(SimpleFooProxy.class);
    final Request<Void> create = context.persist().using(newFoo);
    new FailFixAndRefire<Void>(newFoo, context, create).doVoidTest();
  }
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

    fooCreationRequest().fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy returned) {
        returned = checkSerialization(returned);
        SimpleFooRequest context = simpleFooRequest();
        Request<SimpleFooProxy> editRequest = context.persistAndReturnSelf().using(returned);
        new FailFixAndRefire<SimpleFooProxy>(returned, context, editRequest).doTest();
      }
    });
  }
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

        new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {
            checkReturnedProxy(response, relationsPresent);

            SimpleFooRequest editRequest = req.simpleFooRequest();
            SimpleFooProxy editableSimpleFoo = editRequest.edit(response);
            editableSimpleFoo.setSimpleBarKeyMap( new HashMap<SimpleBarProxy, Integer>());
            editableSimpleFoo.setSimpleBarValueMap( new HashMap<Integer, SimpleBarProxy>());
            editRequest.persistAndReturnSelf().using(editableSimpleFoo).with(SIMPLE_FOO_RELATIONS).fire(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onSuccess(SimpleFooProxy returnedProxy) {
                    assertEquals(0, returnedProxy.getSimpleBarKeyMap().size());
                    assertEquals(0, returnedProxy.getSimpleBarValueMap().size());
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

              public void onProxyChange(EntityProxyChange<SimpleFooProxy> event) {
                count[0]++;
              }
            });
    delayTestFinish(TEST_DELAY);
    SimpleFooRequest context = req.simpleFooRequest();
    SimpleFooProxy proxy = context.create(SimpleFooProxy.class);
    context.persistAndReturnSelf().using(proxy).fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy response) {
        // Persist and Update events
        assertEquals(2, count[0]);
        req.find(response.stableId()).fire(new Receiver<SimpleFooProxy>() {
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

    return "com.google.web.bindery.requestfactory.gwt.RequestFactoryExceptionHandlerTest";
  }

  public void testServerFailureCheckedException() {
    delayTestFinish(DELAY_TEST_FINISH);
    SimpleFooRequest context = req.simpleFooRequest();
    SimpleFooProxy rayFoo = context.create(SimpleFooProxy.class);
    final Request<SimpleFooProxy> persistRay = context.persistAndReturnSelf().using(
        rayFoo);
    rayFoo = context.edit(rayFoo);
    // 42 is the crash causing magic number
    rayFoo.setPleaseCrash(42);
    persistRay.fire(new SimpleFooFailureReceiver(rayFoo, persistRay,
        "java.lang.UnsupportedOperationException"));
  }
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

        "java.lang.UnsupportedOperationException"));
  }

  public void testServerFailureRuntimeException() {
    delayTestFinish(DELAY_TEST_FINISH);
    SimpleFooRequest context = req.simpleFooRequest();
    SimpleFooProxy rayFoo = context.create(SimpleFooProxy.class);
    final Request<SimpleFooProxy> persistRay = context.persistAndReturnSelf().using(
        rayFoo);
    rayFoo = context.edit(rayFoo);
    // 43 is the crash causing magic number
    rayFoo.setPleaseCrash(43);
    persistRay.fire(new SimpleFooFailureReceiver(rayFoo, persistRay, "java.lang.Exception"));
  }
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

    req.simpleFooRequest().findSimpleFooById(1L).with(paths).fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy response) {

        SimpleFooRequest context = req.simpleFooRequest();
        driver.edit(response, context);
        assertSame(context, editor.barEditor().ctx);
        context.persistAndReturnSelf().using(response).with(paths).to(
            new Receiver<SimpleFooProxy>() {
              @Override
              public void onSuccess(SimpleFooProxy response) {
                assertEquals("EditorFooTest", response.getUserName());
                assertEquals("EditorBarTest", response.getBarField().getUserName());
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest

    req.simpleFooRequest().findSimpleFooById(1L).with(driver.getPaths()).fire(
        new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {

            SimpleFooRequest context = req.simpleFooRequest();
            driver.edit(response, context);
            context.persistAndReturnSelf().using(response).with(driver.getPaths()).to(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onConstraintViolation(Set<ConstraintViolation<?>> errors) {
                    assertEquals(1, errors.size());
                    ConstraintViolation<?> v = errors.iterator().next();
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.