On Sat, Jan 28, 2012 at 12:07 PM, Irfan Adilovic <irfanadilo...@gmail.com>wrote:
> I would like to submit unit tests that test the fixes, but I cannot > bring the tests to fail with the unfixed version of LinkedHashMap (and > LinkedHashSet, which is affected in the same way, btw). > > try { > dstMap = (LinkedHashMap<String, String>) srcMap.clone(); > // fail("LinkedHashMap clone is castable to LinkedHashMap"); > } catch (ClassCastException cce) { > fail("LinkedHashMap clone is not castable to LinkedHashMap"); > return; /* dstMap wasn't cloned successfully */ > } > > By uncommenting the commented fail() above, I can verify that I am > running the correct test, as it fails there, but it should actually > fail on the second fail() in this snippet. The tested code acts as if > the .clone() implementation is already correct in LinkedHashMap/Set. > Because of this I cannot prove with a unit test, that my fix has an > effect. > Are you running your test in DevMode? In DevMode, you are using your JVM's real JRE classes, not GWT's emulation. So, you need to run in prod mode (ie, compiled to JS) to test GWT's JRE emulation. -- John A. Tamplin Software Engineer (GWT), Google -- http://groups.google.com/group/Google-Web-Toolkit-Contributors