Examples of persistAndReturnSelf()


Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest.persistAndReturnSelf()

  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();
  }

  public void testViolationsOnCreateVoidReturn() {
    delayTestFinish(DELAY_TEST_FINISH);
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest.persistAndReturnSelf()

            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.persistAndReturnSelf()

              }
            });
    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.persistAndReturnSelf()

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

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest.persistAndReturnSelf()

  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.persistAndReturnSelf()

      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.persistAndReturnSelf()

          @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

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest.persistAndReturnSelf()

            SimpleFooBarNameOnlyEditor subeditor = editor.selfOneToManyField.getEditors().get(0);
            // test context is correctly set in CompositeEditor subeditors
            assertSame(context, subeditor.ctx);

            context.persistAndReturnSelf().using(response).with(paths).to(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onSuccess(SimpleFooProxy response) {
                    assertEquals("EditorBarTest", response.getSelfOneToManyField().get(0)
                        .getBarField().getUserName());
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest.persistAndReturnSelf()

          public void onSuccess(SimpleFooProxy response) {

            SimpleFooRequest context = req.simpleFooRequest();
            driver.edit(response, context);
            editor.userName.setValue("One");
            context.persistAndReturnSelf().using(response).with(driver.getPaths()).to(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onSuccess(SimpleFooProxy response) {
                    assertEquals("One", response.getUserName());
                    // just testing that it doesn't throw (see issue 5752)
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.SimpleFooRequest.persistAndReturnSelf()

        driver.edit(response, null);
        assertNotNull(editor.delegate.subscribe());

        // Simulate edits occurring elsewhere in the module
        SimpleFooRequest context = req.simpleFooRequest();
        Request<SimpleFooProxy> request = context.persistAndReturnSelf().using(response);
        SimpleBarProxy newBar = context.create(SimpleBarProxy.class);
        newBar = context.edit(newBar);
        newBar.setUserName("newBar");
        response = context.edit(response);
        response.setBarField(newBar);
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.