equals() changed to isEqualTo() in tests (See #48962) BLD200409201800
authormkuchtiak@netbeans.org
Fri, 17 Sep 2004 06:42:40 +0000
changeset 1579ec68fb19fe7b
parent 1578 082a4188fdb4
child 1580 f8afd1057435
equals() changed to isEqualTo() in tests (See #48962)
schema2beans/test/unit/src/data/TestBook.java
schema2beans/test/unit/src/data/TestBookXMLSchema.java
schema2beans/test/unit/src/data/TestMerge.java
     1.1 --- a/schema2beans/test/unit/src/data/TestBook.java	Thu Sep 16 12:42:42 2004 +0000
     1.2 +++ b/schema2beans/test/unit/src/data/TestBook.java	Fri Sep 17 06:42:40 2004 +0000
     1.3 @@ -666,7 +666,7 @@
     1.4  	b2.setSummary(s1);
     1.5  	b2.getChapter(0).setComment("New Comment");
     1.6  	book.merge(b2);
     1.7 -	check(book.equals(b2), "identical graphs");
     1.8 +	check(book.isEqualTo(b2), "identical graphs");
     1.9  
    1.10  	//  Merge two elements that are not part of the graph
    1.11  	Chapter c1 = new Chapter();
     2.1 --- a/schema2beans/test/unit/src/data/TestBookXMLSchema.java	Thu Sep 16 12:42:42 2004 +0000
     2.2 +++ b/schema2beans/test/unit/src/data/TestBookXMLSchema.java	Fri Sep 17 06:42:40 2004 +0000
     2.3 @@ -679,7 +679,7 @@
     2.4  	b2.setSummary(s1);
     2.5  	b2.getChapter(0).setComment("New Comment");
     2.6  	book.merge(b2);
     2.7 -	check(book.equals(b2), "identical graphs");
     2.8 +	check(book.isEqualTo(b2), "identical graphs");
     2.9  
    2.10  	//  Merge two elements that are not part of the graph
    2.11  	Chapter c1 = new Chapter();
     3.1 --- a/schema2beans/test/unit/src/data/TestMerge.java	Thu Sep 16 12:42:42 2004 +0000
     3.2 +++ b/schema2beans/test/unit/src/data/TestMerge.java	Fri Sep 17 06:42:40 2004 +0000
     3.3 @@ -179,7 +179,7 @@
     3.4          out("should not get any event");
     3.5          b1.merge(b2);
     3.6          check(b1.toString().equals(b2.toString()), " - no diff");
     3.7 -        check(b1.equals(b2), " - equals");
     3.8 +        check(b1.isEqualTo(b2), " - equals");
     3.9  	
    3.10          //	One mixed up document, but should be the same
    3.11          setTest("Merge(Update) - two identical xml files (one mixed up)");
    3.12 @@ -191,7 +191,7 @@
    3.13          b3.addPropertyChangeListener(l3);
    3.14  	
    3.15          b3.merge(b1);
    3.16 -        check(b3.equals(b1), " - equals");
    3.17 +        check(b3.isEqualTo(b1), " - equals");
    3.18  	
    3.19          //
    3.20          //	Change only one element of the second graph
    3.21 @@ -209,14 +209,14 @@
    3.22  	
    3.23          b1.write(System.out);
    3.24  	
    3.25 -        check(b2.equals(b1), " - equals");
    3.26 +        check(b2.isEqualTo(b1), " - equals");
    3.27          //	g1/g3
    3.28          this.mute(true);
    3.29          b1.setSummary(s2);
    3.30          this.mute(false);
    3.31          out("should not get any event");
    3.32          b1.merge(b3);
    3.33 -        check(b3.equals(b1), " - equals");
    3.34 +        check(b3.isEqualTo(b1), " - equals");
    3.35          this.mute(true);
    3.36          b2.setSummary(s2);
    3.37  	
    3.38 @@ -239,7 +239,7 @@
    3.39          check(b1.getAuthor(2).equals(b2.getAuthor(0)), "mixed");
    3.40          out("should not get any event");
    3.41          b1.merge(b2);
    3.42 -        check(b2.equals(b1), " - equals");
    3.43 +        check(b2.isEqualTo(b1), " - equals");
    3.44          this.mute(true);
    3.45          b2.setAuthor(ss1);
    3.46          check(b1.getAuthor(0).equals(b2.getAuthor(0)), "reset match");
    3.47 @@ -250,9 +250,9 @@
    3.48          //	Mixing array of beans
    3.49          //
    3.50          setTest("Merge(Update) - mixing  array of beans");
    3.51 -        check(b1.getChapter(0).equals(b2.getChapter(0)), "initial match");
    3.52 -        check(b1.getChapter(1).equals(b2.getChapter(1)), "initial match");
    3.53 -        check(b1.getChapter(2).equals(b2.getChapter(2)), "initial match");
    3.54 +        check(b1.getChapter(0).isEqualTo(b2.getChapter(0)), "initial match");
    3.55 +        check(b1.getChapter(1).isEqualTo(b2.getChapter(1)), "initial match");
    3.56 +        check(b1.getChapter(2).isEqualTo(b2.getChapter(2)), "initial match");
    3.57          this.mute(false);
    3.58          Chapter [] cc1 = b2.getChapter();
    3.59          Chapter [] cc2 = new Chapter[3];
    3.60 @@ -260,17 +260,17 @@
    3.61          cc2[1] = cc1[1];
    3.62          cc2[2] = cc1[0];
    3.63          b2.setChapter(cc2);
    3.64 -        check(b1.getChapter(0).equals(b2.getChapter(2)), "mixed");
    3.65 -        check(b1.getChapter(1).equals(b2.getChapter(1)), "mixed");
    3.66 -        check(b1.getChapter(2).equals(b2.getChapter(0)), "mixed");
    3.67 +        check(b1.getChapter(0).isEqualTo(b2.getChapter(2)), "mixed");
    3.68 +        check(b1.getChapter(1).isEqualTo(b2.getChapter(1)), "mixed");
    3.69 +        check(b1.getChapter(2).isEqualTo(b2.getChapter(0)), "mixed");
    3.70          out("should not get any event");
    3.71          b1.merge(b2);
    3.72 -        check(b2.equals(b1), " - equals");
    3.73 +        check(b2.isEqualTo(b1), " - equals");
    3.74          this.mute(true);
    3.75          b2.setChapter(cc1);
    3.76 -        check(b1.getChapter(0).equals(b2.getChapter(0)), "reset match");
    3.77 -        check(b1.getChapter(1).equals(b2.getChapter(1)), "reset match");
    3.78 -        check(b1.getChapter(2).equals(b2.getChapter(2)), "reset match");
    3.79 +        check(b1.getChapter(0).isEqualTo(b2.getChapter(0)), "reset match");
    3.80 +        check(b1.getChapter(1).isEqualTo(b2.getChapter(1)), "reset match");
    3.81 +        check(b1.getChapter(2).isEqualTo(b2.getChapter(2)), "reset match");
    3.82  	
    3.83          //
    3.84          //	Removing a String elt from an array
    3.85 @@ -290,7 +290,7 @@
    3.86          check(b1.getAuthor(0).equals(b2.getAuthor(0)), "match");
    3.87          check(b1.getAuthor(1).equals(b2.getAuthor(1)), "match");
    3.88          check(b1.sizeAuthor() == b2.sizeAuthor(), "correct size");
    3.89 -        check(b2.equals(b1), " - equals");
    3.90 +        check(b2.isEqualTo(b1), " - equals");
    3.91  	
    3.92          //
    3.93          //	Adding a String elt from an array
    3.94 @@ -312,28 +312,28 @@
    3.95          check(b1.getAuthor(1).equals(b2.getAuthor(1)), "match");
    3.96          check(b1.getAuthor(2).equals(b2.getAuthor(2)), "match");
    3.97          check(b1.sizeAuthor() == b2.sizeAuthor(), "correct size");
    3.98 -        check(b2.equals(b1), " - equals");
    3.99 +        check(b2.isEqualTo(b1), " - equals");
   3.100  	
   3.101          //
   3.102          //	Removing a Bean elt from an array
   3.103          //
   3.104          setTest("Merge(Update) - remove elt from array of beans");
   3.105 -        check(b1.getChapter(0).equals(b2.getChapter(0)), "initial match");
   3.106 -        check(b1.getChapter(1).equals(b2.getChapter(1)), "initial match");
   3.107 -        check(b1.getChapter(2).equals(b2.getChapter(2)), "initial match");
   3.108 +        check(b1.getChapter(0).isEqualTo(b2.getChapter(0)), "initial match");
   3.109 +        check(b1.getChapter(1).isEqualTo(b2.getChapter(1)), "initial match");
   3.110 +        check(b1.getChapter(2).isEqualTo(b2.getChapter(2)), "initial match");
   3.111          this.mute(false);
   3.112          Chapter c1 = b2.getChapter(1);
   3.113          Chapter c2 = (Chapter)c1.clone();
   3.114          out("should get one remove event from deletion");
   3.115          b2.removeChapter(c1);
   3.116 -        check(b1.getChapter(0).equals(b2.getChapter(0)), "match after rem");
   3.117 -        check(b1.getChapter(2).equals(b2.getChapter(1)), "match after rem");
   3.118 +        check(b1.getChapter(0).isEqualTo(b2.getChapter(0)), "match after rem");
   3.119 +        check(b1.getChapter(2).isEqualTo(b2.getChapter(1)), "match after rem");
   3.120          out("should get one remove event from merge");
   3.121          b1.merge(b2);
   3.122 -        check(b1.getChapter(0).equals(b2.getChapter(0)), "match");
   3.123 -        check(b1.getChapter(1).equals(b2.getChapter(1)), "match");
   3.124 +        check(b1.getChapter(0).isEqualTo(b2.getChapter(0)), "match");
   3.125 +        check(b1.getChapter(1).isEqualTo(b2.getChapter(1)), "match");
   3.126          check(b1.sizeChapter() == b2.sizeChapter(), "correct size");
   3.127 -        check(b2.equals(b1), " - equals");
   3.128 +        check(b2.isEqualTo(b1), " - equals");
   3.129  	
   3.130          //
   3.131          //	Adding a Bean elt from an array
   3.132 @@ -342,14 +342,14 @@
   3.133          this.mute(false);
   3.134          out("should get one event for elt added");
   3.135          b2.addChapter(c2);
   3.136 -        check(b2.getChapter(2).equals(c2), "added");
   3.137 +        check(b2.getChapter(2).isEqualTo(c2), "added");
   3.138          out("should get one event for elt added from merge");
   3.139          b1.merge(b2);
   3.140 -        check(b1.getChapter(0).equals(b2.getChapter(0)), "match");
   3.141 -        check(b1.getChapter(1).equals(b2.getChapter(1)), "match");
   3.142 -        check(b1.getChapter(2).equals(b2.getChapter(2)), "match");
   3.143 +        check(b1.getChapter(0).isEqualTo(b2.getChapter(0)), "match");
   3.144 +        check(b1.getChapter(1).isEqualTo(b2.getChapter(1)), "match");
   3.145 +        check(b1.getChapter(2).isEqualTo(b2.getChapter(2)), "match");
   3.146          check(b1.sizeChapter() == b2.sizeChapter(), "correct size");
   3.147 -        check(b2.equals(b1), " - equals");
   3.148 +        check(b2.isEqualTo(b1), " - equals");
   3.149  	
   3.150  	
   3.151          //
   3.152 @@ -369,18 +369,18 @@
   3.153          check(b5.sizeChapter() == 3);
   3.154  	
   3.155          //	bean[] full / bean null
   3.156 -        check(b4.equals(b5));
   3.157 +        check(b4.isEqualTo(b5));
   3.158  	
   3.159          setTest("comparing graphs with null indexed elts");
   3.160          //	g1.bean[] has 1 null / g2.bean[] has 1 null / bean null
   3.161          b4.setChapter(1, null);
   3.162          b5.setChapter(2, null);
   3.163 -        check(!b4.equals(b5));
   3.164 +        check(!b4.isEqualTo(b5));
   3.165          b4.merge(b5);
   3.166          check(b4.sizeChapter() == 3, "correct new array sise");
   3.167 -        check(b4.getChapter(0).equals(b5.getChapter(0)), "elt ok");
   3.168 +        check(b4.getChapter(0).isEqualTo(b5.getChapter(0)), "elt ok");
   3.169          check(b4.getChapter(1) == null, "elt ok");
   3.170 -        check(b4.getChapter(2).equals(b5.getChapter(1)), "elt ok");
   3.171 +        check(b4.getChapter(2).isEqualTo(b5.getChapter(1)), "elt ok");
   3.172  	
   3.173          setTest("comparing graphs with null single bean elt");
   3.174          //	g1.bean non null / g2.bean is null
   3.175 @@ -389,11 +389,11 @@
   3.176          Content ct = new Content();
   3.177          ct.setTitle("This is a title");
   3.178          ct.setComment("And this is a comment");
   3.179 -        check(b4.equals(b5));
   3.180 +        check(b4.isEqualTo(b5));
   3.181          b5.setContent(ct);
   3.182 -        check(!b4.equals(b5));
   3.183 +        check(!b4.isEqualTo(b5));
   3.184          b4.merge(b5);
   3.185 -        check(b4.getContent().equals(b5.getContent()));
   3.186 +        check(b4.getContent().isEqualTo(b5.getContent()));
   3.187  	
   3.188          //	Clone an element which is not part of a graph
   3.189          Chapter c3 = new Chapter();
   3.190 @@ -409,8 +409,8 @@
   3.191          Book b8 = (Book)b2.clone();
   3.192          b7.addChapter(c3);
   3.193          b8.addChapter(c4);
   3.194 -        check(c3.equals(c4), "objects equal");
   3.195 -        check(b7.equals(b8), "same graph once added");
   3.196 +        check(c3.isEqualTo(c4), "objects equal");
   3.197 +        check(b7.isEqualTo(b8), "same graph once added");
   3.198  	
   3.199          //
   3.200          //	Test the attributes. When we merge graphs, we need to make
   3.201 @@ -449,10 +449,10 @@
   3.202          //	The only events we should have when we merge are the 
   3.203          //	attributes events, because the graphs only differ by attr.
   3.204          setTest("Merging attributes");
   3.205 -        check(!b1.equals(b2), "shouldn't be equals (diff an attr)");
   3.206 +        check(!b1.isEqualTo(b2), "shouldn't be equals (diff an attr)");
   3.207          //GraphManager.debug(true);
   3.208          b1.merge(b2);
   3.209 -        check(b1.equals(b2), "should be equals");
   3.210 +        check(b1.isEqualTo(b2), "should be equals");
   3.211  	
   3.212          //	Make sure that b1 has the attributes
   3.213          s1 = b1.getAttributeValue("good");