From: Q <qd...@gm...> - 2009-08-24 02:52:44
|
WTF?? STOP!!! Step away from the keyboard. How about you read the WO 54 javadoc [1], and run the tests against WO 54's implementation before you commit anything else and make an even bigger mess. To save you time, I already did this when I wrote all these tests, and they passed against WO54 and Wonder except for one failing test in NSDictionary in wonder, and one failing test in NSSet in WO 54. Let me reiterate my previous statement, stop changing the tests to suit your implementation changes. If you change something and tests start failing, then first consider the possibility that YOU did something wrong [2], not that the tests need to be changed. [1] http://developer.apple.com/documentation/InternetWeb/Reference/WO542Reference/com/webobjects/foundation/NSDictionary.html [2] The tests don't catch NPE's because only the two Map constructors are supposed to throw them. On 24/08/2009, at 12:00 PM, ki...@us... wrote: > Revision: 9749 > http://wonder.svn.sourceforge.net/wonder/?rev=9749&view=rev > Author: kiddyr > Date: 2009-08-24 02:00:42 +0000 (Mon, 24 Aug 2009) > > Log Message: > ----------- > If the NSDictionary constructors are going to throw NPEs, then that > is what the tests should catch. > > Modified Paths: > -------------- > trunk/Wonder/Frameworks/Core/ERExtensions/Tests/com/webobjects/ > foundation/NSDictionaryTest.java > > Modified: trunk/Wonder/Frameworks/Core/ERExtensions/Tests/com/ > webobjects/foundation/NSDictionaryTest.java > =================================================================== > --- trunk/Wonder/Frameworks/Core/ERExtensions/Tests/com/webobjects/ > foundation/NSDictionaryTest.java 2009-08-24 01:05:55 UTC (rev 9748) > +++ trunk/Wonder/Frameworks/Core/ERExtensions/Tests/com/webobjects/ > foundation/NSDictionaryTest.java 2009-08-24 02:00:42 UTC (rev 9749) > @@ -61,21 +61,20 @@ > } > > public void testNSDictionaryNSArrayOfVNSArrayOfKNull() { > - NSArray<String> array = new NSArray<String>(new String[] > { "value1", "value2" }); > - try { > - new NSDictionary<String, String>((NSArray<String>)null, > array); > - } catch (IllegalArgumentException e) { > - } > - try { > - new NSDictionary<String, String>(array, > (NSArray<String>)null); > - } catch (IllegalArgumentException e) { > - } > - try { > - new NSDictionary<String, String>((NSArray<String>)null, > (NSArray<String>)null); > - } catch (IllegalArgumentException e) { > - } > - } > + NSArray<String> array = new NSArray<String>(new String[] > { "value1", "value2" }); > + try { > + new NSDictionary<String, String>((NSArray<String>)null, array); > + } catch (NullPointerException e) { } > > + try { > + new NSDictionary<String, String>(array, (NSArray<String>)null); > + } catch (NullPointerException e) { } > + > + try { > + new NSDictionary<String, String>((NSArray<String>)null, > (NSArray<String>)null); > + } catch (IllegalArgumentException e) { } > + } > + > public void testNSDictionaryNSDictionaryOfKV() { > NSMutableDictionary<String, String> mutableDict = new > NSMutableDictionary<String, String>("value", "key"); > NSDictionary<String, String> dict = new NSDictionary<String, > String>(mutableDict); > @@ -105,21 +104,19 @@ > } > > public void testNSDictionaryVArrayKArrayNull() { > - String[] values = new String[] {"value1", "value2"}; > - try { > - new NSDictionary<String, String>((String[])null, values); > - fail("IllegalArgumentException expected"); > - } catch (IllegalArgumentException e) { > - } > - > - try { > - new NSDictionary<String, String>(values, (String[])null); > - fail("IllegalArgumentException expected"); > - } catch (IllegalArgumentException e) { > - } > + String[] values = new String[] {"value1", "value2"}; > + try { > + new NSDictionary<String, String>((String[])null, values); > + fail("IllegalArgumentException expected"); > + } catch (NullPointerException e) { } > > - NSDictionary<String, String> dict = new NSDictionary<String, > String>((String[])null, (String[])null); > - assertTrue(dict.isEmpty()); > + try { > + new NSDictionary<String, String>(values, (String[])null); > + fail("IllegalArgumentException expected"); > + } catch (NullPointerException e) { } > + > + NSDictionary<String, String> dict = new NSDictionary<String, > String>((String[])null, (String[])null); > + assertTrue(dict.isEmpty()); > } > > > > > This was sent by the SourceForge.net collaborative development > platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Wonder-cvs mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-cvs -- Seeya...Q Quinton Dolan - qd...@gm... Gold Coast, QLD, Australia (GMT+10) Ph: +61 419 729 806 |