This post has been moved to blogspot. No further posts will be made to this location.
public void testTrue() {
String str = "true";
boolean expected = true;
assertEquals("not what you expected?", expected, Boolean
.getBoolean(str));
}
public void testFalse() {
String str = "false";
boolean expected = false;
assertEquals("not what you expected?", expected, Boolean
.getBoolean(str));
}
For anyone interested, here's the documentation.
Posted by jim at March 22, 2006 05:36 PM
isn't reading the documentation cheating? After reading the documentation does anybody else think this function is in the wrong spot?
Posted by: Kibbee at March 22, 2006 08:03 PMI agree... and I think that the name sucks wrt what it actually does... It would be good if they just made another method that does that same thing and depreciate getBoolean().
Posted by: Jim at March 22, 2006 10:12 PMYou could probably just deprecate this function, and use Boolean.parseBoolean(System.getProperty(str)).
I don't really see that you'd need to use this function all that often, and even if you did, then the solution I mentioned would be much more clear to other programmers as to what you were actually trying to accomplish.