This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 428 - java missing overridden methods for various types
Summary: java missing overridden methods for various types
Status: RESOLVED FIXED
Alias: None
Product: DOM TS
Classification: Unclassified
Component: Java Binding (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: Curt Arnold
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-15 11:37 UTC by Bob Clary
Modified: 2003-12-16 20:08 UTC (History)
0 users

See Also:


Attachments
patch v1 (7.48 KB, patch)
2003-12-15 11:39 UTC, Bob Clary
Details
Changes implementation of JUnitTestCaseAdapter.assertEquals(double (806 bytes, patch)
2003-12-15 14:04 UTC, Curt Arnold
Details

Description Bob Clary 2003-12-15 11:37:56 UTC
See attached patch which adds to JunitTestCaseAdapter, DOMTestCase.java,
DOMTestFramework.java

void assertSame(DOMTestCase, String assertID, int, int)
void assertSame(DOMTestCase, String assertID, double, double)
boolean same(int, int)
boolean same(int, int)

and modifies assertEquals(DOMTestCase, String assertID, double, double) in
JUnitTestCaseAdapter
Comment 1 Bob Clary 2003-12-15 11:39:11 UTC
Created attachment 100 [details]
patch v1

oops, the second boolean same(int, int) in the above comment should have been
boolean same(double, double) :-) The patch is ok though.
Comment 2 Curt Arnold 2003-12-15 14:03:13 UTC
Same was intended to mean that two references were to the same object.  That 
is, an object identity comparison instead of an object value comparision.  

Since the types used to represent double, int and boolean do not have 
identity, the use of same was not expected for these types.  Unless there is a 
compelling reason, I would suggest the tests to be rewritten using equals or 
assertEquals.

JUnit also maintains this distinction, assertSame is only defined for Object, 
assertEquals is defined for Object and the value types.

I did modify JUnitTestCaseAdapter to use assertEquals(String, double, double, 
double delta) using a delta value of 0 instead of doing a string comparison.  
This will report the expected and actual values in any failure message which 
would make it preferable to assert(actual == expected)
Comment 3 Curt Arnold 2003-12-15 14:04:49 UTC
Created attachment 105 [details]
Changes implementation of JUnitTestCaseAdapter.assertEquals(double
Comment 4 Bob Clary 2003-12-16 13:52:34 UTC
This works for me as well. Please close unless there is another reason to keep
it open.