Author: tfischer
Date: Wed Nov 30 12:27:21 2005
New Revision: 350037
URL: http://svn.apache.org/viewcvs?rev=350037&view=rev
Log:
Added testcase and changelog for the fix of TRQS133.
Thanks to Patrick Carl for the testcase.
Modified:
db/torque/runtime/trunk/xdocs/changes.xml
db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
Modified: db/torque/runtime/trunk/xdocs/changes.xml
URL:
http://svn.apache.org/viewcvs/db/torque/runtime/trunk/xdocs/changes.xml?rev=350037&r1=350036&r2=350037&view=diff
==============================================================================
--- db/torque/runtime/trunk/xdocs/changes.xml (original)
+++ db/torque/runtime/trunk/xdocs/changes.xml Wed Nov 30 12:27:21 2005
@@ -26,6 +26,11 @@
<body>
<release version="3.2-rc4-dev" date="in SVN">
+ <action type="fix" dev="tfischer" issue="TRQS133">
+ BaseObject.equals() does not return true anymore if the objects
+ do not have the same class.
+ Thanks to Patrick Carl for the patch.
+ </action>
<action type="add" dev="tfischer">
Extended support for derby.
<ul>
Modified:
db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
URL:
http://svn.apache.org/viewcvs/db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java?rev=350037&r1=350036&r2=350037&view=diff
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
(original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
Wed Nov 30 12:27:21 2005
@@ -69,6 +69,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Scott Eade</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Thomas Fischer</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Patrick Carl</a>
* @version $Id$
*/
public class DataTest extends BaseRuntimeTestCase
@@ -1166,6 +1167,37 @@
assertTrue("Size of largePk list should be 1 but is "
+ result.size(),
result.size() == 1);
+ }
+
+ /**
+ * Test whether equals() is working correctly
+ * @throws Exception
+ */
+ public void testEquals() throws Exception
+ {
+ Author author = new Author();
+ author.setAuthorId(1000);
+
+ Book book = new Book();
+ book.setBookId(1000);
+
+ Book bookNotEqual = new Book();
+ bookNotEqual.setBookId(2000);
+
+ Book bookEqual = new Book();
+ bookEqual.setBookId(1000);
+
+ assertFalse("Author and Book should not be equal",
+ author.equals(book));
+ assertTrue("Book compared with itself should be equal",
+ book.equals(book));
+ assertTrue("Book compared with book with same id should be equal",
+ book.equals(bookEqual));
+ assertFalse("Book compared with book with different id "
+ + "should not be equal",
+ book.equals(bookNotEqual));
+
+
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]