google-code-export / gwt-test-utils

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

GXT's BeanModelFactory not testable #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following test case doesn't work with gwt-test-utils (see attached project 
for complete source):

@Test
public void test()
{
  final String DATA = "data";
  Data data = new Data( DATA );
  BeanModelFactory factory = BeanModelLookup.get().getFactory( Data.class );
  BeanModel dataModel = factory.createModel( data );
  assertEquals( "Content", DATA, dataModel.get( "data" ));
}

Instead, I get

java.lang.UnsupportedOperationException: Abstract method 
'BeanModelLookupSubClass.getFactory()' is not patched by any declared Patcher 
instance

GXTs BeanModel stuff is code created by some GWT compile step (where my 
understanding, as of now, is somewhat foggy yet). Any ideas how to proceedd to 
make my models testable ?

~Chris

Original issue reported on code.google.com by chrisb0...@gmail.com on 10 Sep 2011 at 3:27

Attachments:

GoogleCodeExporter commented 9 years ago
... and sorry for classifying this as defect, I realize this should have been 
enhancement. Can I change this ?

Original comment by chrisb0...@gmail.com on 10 Sep 2011 at 3:32

GoogleCodeExporter commented 9 years ago
defect would be fine since BeanModelFactory is a standard GXT feature ;-)

Original comment by gael.laz...@gmail.com on 10 Sep 2011 at 5:16

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 14 Sep 2011 at 4:42

GoogleCodeExporter commented 9 years ago
This has been fixed in the lastest 0.33-SNAPSHOT, 0.28.7-SNAPSHOT, 
0.25.4-SNAPSHOT and 0.22.4-SNAPSHOT.

Could you please try one of those and give me some feedback so I could close 
the issue ?

Original comment by gael.laz...@gmail.com on 14 Sep 2011 at 5:26

GoogleCodeExporter commented 9 years ago
Ok, just tried it with 0.33-SNAPSHOT, works !

That was fast, thanks !

Original comment by chrisb0...@gmail.com on 14 Sep 2011 at 5:44

GoogleCodeExporter commented 9 years ago
GWT is easy want you are allowed to do reflection ;-)

Thank you for your feedback !

Original comment by gael.laz...@gmail.com on 14 Sep 2011 at 6:02

GoogleCodeExporter commented 9 years ago
I just took a look at what you did... easy, indeed, IF you know what you're 
looking for ;)

Anyway, I'm now off for checking if your gwt-test-utils allow me to do 
automatic test coverage from Sonar. If THAT works, expect more feedback soon :D

Original comment by chrisb0...@gmail.com on 14 Sep 2011 at 6:16

GoogleCodeExporter commented 9 years ago
I use sonar reports myself for gwt-test-utils internal code coverage and coding 
rules without problem, so feel free to ask if you're facing any problem ;-)

It would be nice to get your feedbac, espacially for gwt-test-utils-gxt since I 
I've never used GXT myself...

Original comment by gael.laz...@gmail.com on 14 Sep 2011 at 6:23