Package com.google.web.bindery.requestfactory.shared

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


    delayTestFinish(DELAY_TEST_FINISH);
    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy newFoo = context.create(SimpleFooProxy.class);

    final Request<SimpleFooProxy> fooReq = context.persistAndReturnSelf().using(newFoo);
    newFoo = context.edit(newFoo);
    newFoo.setUserName("Ray");

    SimpleBarRequest context2 = simpleBarRequest();
    SimpleBarProxy newBar = context2.create(SimpleBarProxy.class);
    final Request<SimpleBarProxy> barReq = context2.persistAndReturnSelf().using(newBar);
View Full Code Here


            final SimpleBarProxy persistedBar = checkSerialization(response);

            assertEquals("Ray", persistedFoo.getUserName());
            SimpleFooRequest context = simpleFooRequest();
            final Request<Void> fooReq2 = context.persist().using(persistedFoo);
            SimpleFooProxy editablePersistedFoo = context.edit(persistedFoo);
            editablePersistedFoo.setBarField(persistedBar);
            fooReq2.fire(new Receiver<Void>() {
              @Override
              public void onSuccess(Void response) {
                req.simpleFooRequest().findSimpleFooById(persistedFoo.getId()).with(
View Full Code Here

                fooProxy = checkSerialization(fooProxy);

                SimpleFooRequest context = simpleFooRequest();
                Request<SimpleFooProxy> updReq =
                    context.persistAndReturnSelf().using(fooProxy).with("oneToManyField");
                fooProxy = context.edit(fooProxy);

                List<SimpleBarProxy> barProxyList = fooProxy.getOneToManyField();
                final int listCount = barProxyList.size();
                barProxyList.add(barProxy);
                updReq.fire(new Receiver<SimpleFooProxy>() {
View Full Code Here

    delayTestFinish(DELAY_TEST_FINISH);

    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy rayFoo = context.create(SimpleFooProxy.class);
    final Request<SimpleFooProxy> persistRay = context.persistAndReturnSelf().using(rayFoo);
    rayFoo = context.edit(rayFoo);
    rayFoo.setUserName("Ray");
    rayFoo.setFooField(rayFoo);
    persistRay.fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy response) {
View Full Code Here

    context.returnNullString().to(count);
    context.persist().using(newFoo).to(new ThrowingReceiver<Void>(exception1));
    context.returnNullString().to(count);

    final SimpleFooProxy mutableFoo = context.edit(newFoo);
    // 42 is the crash causing magic number for a runtime exception
    mutableFoo.setPleaseCrash(42);

    fireContextAndCatch(context, new ThrowingReceiver<Void>(exception2), new ExceptionVerifier() {
      @Override
View Full Code Here

    SimpleBarRequest barCtx = fooCtx1.append(req.simpleBarRequest());
    SimpleFooRequest fooCtx2 = barCtx.append(req.simpleFooRequest());

    assertNotSame(fooCtx1, fooCtx2);
    assertSame(foo1, barCtx.edit(foo1));
    assertSame(foo1, fooCtx2.edit(foo1));

    SimpleBarProxy foo2 = barCtx.create(SimpleBarProxy.class);
    assertSame(foo2, fooCtx1.edit(foo2));
    assertSame(foo2, fooCtx2.edit(foo2));
View Full Code Here

    assertSame(foo1, barCtx.edit(foo1));
    assertSame(foo1, fooCtx2.edit(foo1));

    SimpleBarProxy foo2 = barCtx.create(SimpleBarProxy.class);
    assertSame(foo2, fooCtx1.edit(foo2));
    assertSame(foo2, fooCtx2.edit(foo2));

    SimpleFooProxy foo3 = fooCtx2.create(SimpleFooProxy.class);
    assertSame(foo3, fooCtx1.edit(foo3));
    assertSame(foo3, barCtx.edit(foo3));
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.