Java 类org.jfree.chart.title.DateTitle 实例源码

项目:parabuild-ci    文件:DateTitleTests.java   
/**
 * Problem that the equals(...) method distinguishes all fields.
 */
public void testEquals() {
    DateTitle t1 = new DateTitle();
    DateTitle t2 = new DateTitle();
    assertEquals(t1, t2);

    t1.setText("Test 1");
    assertFalse(t1.equals(t2));
    t2.setText("Test 1");
    assertTrue(t1.equals(t2));

    Font f = new Font("SansSerif", Font.PLAIN, 15);
    t1.setFont(f);
    assertFalse(t1.equals(t2));
    t2.setFont(f);
    assertTrue(t1.equals(t2));

    t1.setPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setPaint(Color.blue);
    assertTrue(t1.equals(t2));

    t1.setBackgroundPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(Color.blue);
    assertTrue(t1.equals(t2));

}
项目:parabuild-ci    文件:DateTitleTests.java   
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    DateTitle t1 = new DateTitle();
    DateTitle t2 = new DateTitle();
    assertTrue(t1.equals(t2));
    int h1 = t1.hashCode();
    int h2 = t2.hashCode();
    assertEquals(h1, h2);
}
项目:parabuild-ci    文件:DateTitleTests.java   
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    DateTitle t1 = new DateTitle();
    DateTitle t2 = new DateTitle();
    assertEquals(t1, t2);

    t1.setText("Test 1");
    assertFalse(t1.equals(t2));
    t2.setText("Test 1");
    assertTrue(t1.equals(t2));

    Font f = new Font("SansSerif", Font.PLAIN, 15);
    t1.setFont(f);
    assertFalse(t1.equals(t2));
    t2.setFont(f);
    assertTrue(t1.equals(t2));

    t1.setPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setPaint(Color.blue);
    assertTrue(t1.equals(t2));

    t1.setBackgroundPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(Color.blue);
    assertTrue(t1.equals(t2));

}
项目:parabuild-ci    文件:DateTitleTests.java   
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    DateTitle t1 = new DateTitle();
    DateTitle t2 = new DateTitle();
    assertTrue(t1.equals(t2));
    int h1 = t1.hashCode();
    int h2 = t2.hashCode();
    assertEquals(h1, h2);
}
项目:nabs    文件:DateTitleTests.java   
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    DateTitle t1 = new DateTitle();
    DateTitle t2 = new DateTitle();
    assertEquals(t1, t2);

    t1.setText("Test 1");
    assertFalse(t1.equals(t2));
    t2.setText("Test 1");
    assertTrue(t1.equals(t2));

    Font f = new Font("SansSerif", Font.PLAIN, 15);
    t1.setFont(f);
    assertFalse(t1.equals(t2));
    t2.setFont(f);
    assertTrue(t1.equals(t2));

    t1.setPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setPaint(Color.blue);
    assertTrue(t1.equals(t2));

    t1.setBackgroundPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(Color.blue);
    assertTrue(t1.equals(t2));

}
项目:nabs    文件:DateTitleTests.java   
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    DateTitle t1 = new DateTitle();
    DateTitle t2 = new DateTitle();
    assertTrue(t1.equals(t2));
    int h1 = t1.hashCode();
    int h2 = t2.hashCode();
    assertEquals(h1, h2);
}
项目:astor    文件:DateTitleTests.java   
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    DateTitle t1 = new DateTitle();
    DateTitle t2 = new DateTitle();
    assertEquals(t1, t2);

    t1.setText("Test 1");
    assertFalse(t1.equals(t2));
    t2.setText("Test 1");
    assertTrue(t1.equals(t2));

    Font f = new Font("SansSerif", Font.PLAIN, 15);
    t1.setFont(f);
    assertFalse(t1.equals(t2));
    t2.setFont(f);
    assertTrue(t1.equals(t2));

    t1.setPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setPaint(Color.blue);
    assertTrue(t1.equals(t2));

    t1.setBackgroundPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(Color.blue);
    assertTrue(t1.equals(t2));

}
项目:astor    文件:DateTitleTests.java   
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashcode() {
    DateTitle t1 = new DateTitle();
    DateTitle t2 = new DateTitle();
    assertTrue(t1.equals(t2));
    int h1 = t1.hashCode();
    int h2 = t2.hashCode();
    assertEquals(h1, h2);
}