google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

Problem with SimpleBeanEditorDriverInvocationHandler #161

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
While testing a widget with an editor containing a ValueListBox I have 
encounter a class cast exception.
This was caused by  
Object value = BeanUtils.getProperty(bean, propertyPath); (line 168)
because BeanUtils.getProperty(bean, propertyPath) always returns a String.
I have created a CustomSimpleBeanEditorDriverInvocationHandler and replace the 
above line by
Object value = PropertyUtils.getProperty(bean, propertyPath); and it worked 
fine in my case.
Can you confirm this and fix it in the next release.

Original issue reported on code.google.com by armand...@gmail.com on 31 Aug 2012 at 11:11

GoogleCodeExporter commented 9 years ago
Starting 0.40, gwt-test-utils relies on the custom GWT's Generator for Editors. 
So there won't be any BeanUtils based implementation.

Could you please try to update to 0.40 to confirm it's working ? Before 
updating, you should read this wiki page : 
https://github.com/gwt-test-utils/gwt-test-utils/wiki/Migration-to-0.40

Original comment by gael.laz...@gmail.com on 31 Aug 2012 at 11:54

GoogleCodeExporter commented 9 years ago
I have managed to migrate to 0.40.
But I am now getting the following error:
java.lang.IllegalAccessError: class com.google.common.collect.$Proxy25 cannot 
access its superinterface com.google.common.collect.GwtTransient
I am using guava-gwt version 13.0.1. That is where the problem is coming from. 
Have you encounter this before?

Original comment by armand...@gmail.com on 31 Aug 2012 at 4:18

GoogleCodeExporter commented 9 years ago
Someone else does have the same problem (see comments here : 
http://code.google.com/p/gwt-test-utils/wiki/MigrationTo040)

I've never used guava-gwt so I may have missed something. I'll look at this 
asap (this weekend). Stay tuned.

Original comment by gael.laz...@gmail.com on 31 Aug 2012 at 4:25

GoogleCodeExporter commented 9 years ago
I wasn't able to reproduce the GwtTransient issue, but could understand why 
you've got this issue.

Could you please register the following custom patcher :

import javassist.CtClass;
import javassist.Modifier;

import com.googlecode.gwt.test.patchers.InitMethod;
import com.googlecode.gwt.test.patchers.PatchClass;

@PatchClass(target = "com.google.common.collect.GwtTransient")
public class GwtTransientPatcher {

   @InitMethod
   static void init(CtClass ctClass) {
      // set GwtTransient class public
      ctClass.setModifiers(ctClass.getModifiers() + Modifier.PUBLIC);
   }

}

If you don't know you to register it, you should read this wiki page : 
https://github.com/gwt-test-utils/gwt-test-utils/wiki/Writing-custom-Patchers

Is that solving your issue ?

I would appreciate if you could provide a sample app where you would reproduce 
the problem. Thank you very much !

Original comment by gael.laz...@gmail.com on 1 Sep 2012 at 7:13

GoogleCodeExporter commented 9 years ago
The patcher solution has not worked for me.
The only place in my application where I am using guava is the attached class. 
I am using it to filter a list of organisation DTOs. I hope this will help.

Original comment by armand...@gmail.com on 3 Sep 2012 at 9:27

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you very much, I'm finally able to reproduce this problem and to 
understand why it happens. I will provide a fix (in 0.41-SNAPSHOT) asap. Stay 
tuned !

Original comment by gael.laz...@gmail.com on 4 Sep 2012 at 5:37

GoogleCodeExporter commented 9 years ago
I just deployed a new 0.41-SNAPSHOT which should fix the @GwtTransient issue. 
Could you please give it a try and post some feedback so I could close this 
ticket ? Thank you very much !

Original comment by gael.laz...@gmail.com on 6 Sep 2012 at 6:21