Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1485

RequestContext#isChanged doesn't work on existing proxies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 1.1.0.RC1
    • Component/s: GWT
    • Labels:
      None

      Description

      This test case fails with a class cast exception:

      Caused by: java.lang.ClassCastException: com.springsource.extrack.gwt.request.EmployeeProxyAutoBean cannot be cast to com.google.gwt.requestfactory.shared.EntityProxy
      
          at com.google.gwt.requestfactory.client.impl.AbstractRequestContext.isChanged(AbstractRequestContext.java:151)
      
      public void testChangedEdit() {
          delayTestFinish(DELAY_TEST_FINISH);
          simpleFooRequest().findSimpleFooById(1l).fire(new Receiver<SimpleFooProxy>() {
      
            @Override
            public void onSuccess(SimpleFooProxy foo) {
              SimpleFooRequest context = simpleFooRequest();
              
              // edit() doesn't cause a change
              foo = context.edit(foo);
              assertFalse(context.isChanged());
      
              final String newName = "something else;";
              String oldName = foo.getUserName();
              assertFalse("Don't accidentally set the same name", newName.equals(oldName));
              
              // gets don't cause a change
              assertFalse(context.isChanged());
              
              // Change
              foo.setUserName(newName);
              assertTrue(context.isChanged());
      
              // Undo the change
              foo.setUserName(newName);
              assertFalse(context.isChanged());
              
              finishTestAndReset();
            }
          });
        } 
      

        Attachments

          Activity

            People

            Assignee:
            bobv Robert Vawter
            Reporter:
            rjrjr@google.com Ray Ryan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: