Exemplo n.º 1
0
  /** Test that the setMinimumDate() method works. */
  @Test
  public void testSetMinimumDate() {
    DateAxis axis = new DateAxis("Test Axis");
    Date d1 = new Date();
    Date d2 = new Date(d1.getTime() + 1);
    axis.setMaximumDate(d2);
    axis.setMinimumDate(d1);
    assertEquals(d1, axis.getMinimumDate());

    // check that setting the min date to something on or after the
    // current min date works...
    Date d3 = new Date(d2.getTime() + 1);
    axis.setMinimumDate(d2);
    assertEquals(d3, axis.getMaximumDate());
  }
Exemplo n.º 2
0
  /** Test that the setMaximumDate() method works. */
  @Test
  public void testSetMaximumDate() {
    DateAxis axis = new DateAxis("Test Axis");
    Date date = new Date();
    axis.setMaximumDate(date);
    assertEquals(date, axis.getMaximumDate());

    // check that setting the max date to something on or before the
    // current min date works...
    Date d1 = new Date();
    Date d2 = new Date(d1.getTime() + 1);
    Date d0 = new Date(d1.getTime() - 1);
    axis.setMaximumDate(d2);
    axis.setMinimumDate(d1);
    axis.setMaximumDate(d1);
    assertEquals(d0, axis.getMinimumDate());
  }