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

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


   * reference on the client.
   */
  public void testUseOfDeletedEntity() {
    delayTestFinish(DELAY_TEST_FINISH);
    SimpleBarRequest context = simpleBarRequest();
    SimpleBarProxy willDelete = context.create(SimpleBarProxy.class);
    willDelete.setUserName("A");

    // Persist the newly-created object
    context.persistAndReturnSelf().using(willDelete).fire(new Receiver<SimpleBarProxy>() {
      @Override
      public void onSuccess(SimpleBarProxy response) {
View Full Code Here


   */
  public void testCascadingCommit() {
    delayTestFinish(DELAY_TEST_FINISH);
    SimpleFooRequest context = req.simpleFooRequest();
    final SimpleFooProxy foo = context.create(SimpleFooProxy.class);
    final SimpleBarProxy bar0 = context.create(SimpleBarProxy.class);
    final SimpleBarProxy bar1 = context.create(SimpleBarProxy.class);
    final SimpleBarProxy bar2 = context.create(SimpleBarProxy.class);
    final SimpleBarProxy bar3 = context.create(SimpleBarProxy.class);
    final SimpleBarProxy bar4 = context.create(SimpleBarProxy.class);
    List<SimpleBarProxy> bars = new ArrayList<SimpleBarProxy>();
    bars.add(bar0);
    bars.add(bar1);

    Map<SimpleBarProxy, Integer> barAsKeyMap = new HashMap<SimpleBarProxy, Integer>();
View Full Code Here

  public void testCreatePersistCascadingAndReturnSelfEditWithReferences() {
    delayTestFinish(DELAY_TEST_FINISH);

    SimpleFooRequest context = simpleFooRequest();
    SimpleFooProxy foo = context.create(SimpleFooProxy.class);
    SimpleBarProxy bar = context.create(SimpleBarProxy.class);
    foo.setBarField(bar);
    Request<SimpleFooProxy> fooReq = context.persistCascadingAndReturnSelf()
        .using(foo).with("barField");
    fooReq.fire(new Receiver<SimpleFooProxy>() {
View Full Code Here

    simpleFooRequest().findSimpleFooById(1L).fire(new Receiver<SimpleFooProxy>() {
      @Override
      public void onSuccess(SimpleFooProxy response) {
        SimpleFooRequest context = simpleFooRequest();
        SimpleFooProxy foo = context.edit(response);
        SimpleBarProxy bar = context.create(SimpleBarProxy.class);
        foo.setBarField(bar);
        Request<SimpleFooProxy> fooReq = context.persistCascadingAndReturnSelf()
            .using(foo).with("barField");
        fooReq.fire(new Receiver<SimpleFooProxy>() {
View Full Code Here

            // edit() doesn't cause a change
            foo = context.edit(foo);
            assertFalse(context.isChanged());

            // Change entity proxy to its edited version doesn't cause a change
            SimpleBarProxy oldBarField = foo.getBarField();
            foo.setBarField(context.edit(oldBarField));
            assertFalse(context.isChanged());

            // Change entity proxy to null causes a change
            foo.setBarField(null);
View Full Code Here

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

    SimpleFooProxy foo3 = fooCtx2.create(SimpleFooProxy.class);
    assertSame(foo3, fooCtx1.edit(foo3));
View Full Code Here

TOP

Related Classes of com.google.web.bindery.requestfactory.shared.SimpleBarProxy

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.