Reviewers: Ray Ryan,
Description:
Incorporated Ray's feedback on
http://code.google.com/p/google-web-toolkit/source/detail?r=8533
Fixed the comment in RequestFactoryJreSuite and added a test to
RecordKeyTest.
Patch by: amitmanjhi
Review by: rjrjr
Please review this at http://gwt-code-reviews.appspot.com/768801/show
Affected files:
M user/test/com/google/gwt/requestfactory/RequestFactoryJreSuite.java
M user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
Index: user/test/com/google/gwt/requestfactory/RequestFactoryJreSuite.java
===================================================================
--- user/test/com/google/gwt/requestfactory/RequestFactoryJreSuite.java
(revision 8536)
+++ user/test/com/google/gwt/requestfactory/RequestFactoryJreSuite.java
(working copy)
@@ -23,7 +23,7 @@
import junit.framework.TestSuite;
/**
- * Suite of UiBinder tests that require the JRE.
+ * Suite of RequestFactory tests that require the JRE.
*/
public class RequestFactoryJreSuite {
public static Test suite() {
Index:
user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
===================================================================
--- user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
(revision 8536)
+++ user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
(working copy)
@@ -25,20 +25,25 @@
public void testEquals() {
RecordKey newKey1 = new RecordKey(1L, SimpleFooRecordImpl.SCHEMA,
RequestFactoryJsonImpl.IS_FUTURE);
+
+ RecordKey anotherNewKey1 = new RecordKey(newKey1.id, newKey1.schema,
+ newKey1.isFuture);
+ assertTrue(newKey1.equals(anotherNewKey1));
+ assertTrue(newKey1.hashCode() == anotherNewKey1.hashCode());
+
RecordKey newKey2 = new RecordKey(newKey1.id + 1, newKey1.schema,
newKey1.isFuture);
+ assertFalse(newKey1.equals(newKey2));
+ assertFalse(newKey1.hashCode() == newKey2.hashCode());
+
+ RecordKey newKey1NoSchema = new RecordKey(newKey1.id, null,
+ newKey1.isFuture);
+ assertFalse(newKey1.equals(newKey1NoSchema));
+ assertFalse(newKey1.hashCode() == newKey1NoSchema.hashCode());
+
RecordKey oldKey1 = new RecordKey(newKey1.id, newKey1.schema,
!newKey1.isFuture);
- RecordKey anotherNewKey1 = new RecordKey(newKey1.id, newKey1.schema,
- newKey1.isFuture);
-
- assertTrue(newKey1.equals(anotherNewKey1));
- assertTrue(newKey1.hashCode() == anotherNewKey1.hashCode());
-
- assertFalse(newKey1.equals(newKey2));
- assertFalse(newKey1.hashCode() == newKey2.hashCode());
-
assertFalse(newKey1.equals(oldKey1));
- assertFalse(newKey1.hashCode() == newKey2.hashCode());
+ assertFalse(newKey1.hashCode() == oldKey1.hashCode());
}
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors