/**
* A series of tests for the equals() method.
*/
/**
* Tests the equals() method.
*/
public void testEquals() {
// some setup...
String f1 = "{1}";
String f2 = "{2}";
NumberFormat xnf1 = new DecimalFormat("0.00");
NumberFormat xnf2 = new DecimalFormat("0.000");
NumberFormat ynf1 = new DecimalFormat("0.00");
NumberFormat ynf2 = new DecimalFormat("0.000");
[[#variable15125460]] g1 = null;
[[#variable15125460]] g2 = null;
g1 = new [[#variable15125460]](f1, xnf1, ynf1);
g2 = new [[#variable15125460]](f1, xnf1, ynf1);
assertTrue(g1.equals(g2));
assertTrue(g2.equals(g1));
g1 = new [[#variable15125460]](f2, xnf1, ynf1);
assertFalse(g1.equals(g2));
g2 = new [[#variable15125460]](f2, xnf1, ynf1);
assertTrue(g1.equals(g2));
g1 = new [[#variable15125460]](f2, xnf2, ynf1);
assertFalse(g1.equals(g2));
g2 = new [[#variable15125460]](f2, xnf2, ynf1);
assertTrue(g1.equals(g2));
g1 = new [[#variable15125460]](f2, xnf2, ynf2);
assertFalse(g1.equals(g2));
g2 = new [[#variable15125460]](f2, xnf2, ynf2);
assertTrue(g1.equals(g2));
DateFormat xdf1 = new SimpleDateFormat("d-MMM");
DateFormat xdf2 = new SimpleDateFormat("d-MMM-yyyy");
DateFormat ydf1 = new SimpleDateFormat("d-MMM");
DateFormat ydf2 = new SimpleDateFormat("d-MMM-yyyy");
g1 = new [[#variable15125460]](f1, xdf1, ydf1);
g2 = new [[#variable15125460]](f1, xdf1, ydf1);
assertTrue(g1.equals(g2));
assertTrue(g2.equals(g1));
g1 = new [[#variable15125460]](f1, xdf2, ydf1);
assertFalse(g1.equals(g2));
g2 = new [[#variable15125460]](f1, xdf2, ydf1);
assertTrue(g1.equals(g2));
g1 = new [[#variable15125460]](f1, xdf2, ydf2);
assertFalse(g1.equals(g2));
g2 = new [[#variable15125460]](f1, xdf2, ydf2);
assertTrue(g1.equals(g2));
}
/**
* Simple check that hashCode is implemented.
*/
public void testHashCode() {
[[#variable15125460]] g1 = new [[#variable15125460]]();
[[#variable15125460]] g2 = new [[#variable15125460]]();
assertTrue(g1.equals(g2));
assertTrue(g1.hashCode() == g2.hashCode());
}
|