Example usage for org.jfree.data.time Millisecond equals

List of usage examples for org.jfree.data.time Millisecond equals

Introduction

In this page you can find the example usage for org.jfree.data.time Millisecond equals.

Prototype

@Override
public boolean equals(Object obj) 

Source Link

Document

Tests the equality of this object against an arbitrary Object.

Usage

From source file:org.jfree.data.time.MillisecondTest.java

/**
 * Check that a {@link Millisecond} instance is equal to itself.
 *
 * SourceForge Bug ID: 558850.//  ww  w.ja  va  2  s.  c  o  m
 */
@Test
public void testEqualsSelf() {
    Millisecond millisecond = new Millisecond();
    assertTrue(millisecond.equals(millisecond));
}

From source file:org.jfree.data.time.junit.MillisecondTest.java

/**
 * Check that a {@link Millisecond} instance is equal to itself.
 *
 * SourceForge Bug ID: 558850.//  ww w.  j a  v a  2s.c o m
 */
public void testEqualsSelf() {
    Millisecond millisecond = new Millisecond();
    assertTrue(millisecond.equals(millisecond));
}

From source file:org.jfree.data.time.MillisecondTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *//*w ww.  j ava2 s  .com*/
@Test
public void testHashcode() {
    Millisecond m1 = new Millisecond(599, 23, 45, 7, 9, 10, 2007);
    Millisecond m2 = new Millisecond(599, 23, 45, 7, 9, 10, 2007);
    assertTrue(m1.equals(m2));
    int hash1 = m1.hashCode();
    int hash2 = m2.hashCode();
    assertEquals(hash1, hash2);
}

From source file:org.jfree.data.time.junit.MillisecondTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *//*from   ww  w  .j  a va 2 s.co  m*/
public void testHashcode() {
    Millisecond m1 = new Millisecond(599, 23, 45, 7, 9, 10, 2007);
    Millisecond m2 = new Millisecond(599, 23, 45, 7, 9, 10, 2007);
    assertTrue(m1.equals(m2));
    int hash1 = m1.hashCode();
    int hash2 = m2.hashCode();
    assertEquals(hash1, hash2);
}

From source file:org.jfree.data.time.MillisecondTest.java

/**
 * Tests the equals method./*  ww w  .  jav  a  2  s  . c o  m*/
 */
@Test
public void testEquals() {
    Day day1 = new Day(29, MonthConstants.MARCH, 2002);
    Hour hour1 = new Hour(15, day1);
    Minute minute1 = new Minute(15, hour1);
    Second second1 = new Second(34, minute1);
    Millisecond milli1 = new Millisecond(999, second1);
    Day day2 = new Day(29, MonthConstants.MARCH, 2002);
    Hour hour2 = new Hour(15, day2);
    Minute minute2 = new Minute(15, hour2);
    Second second2 = new Second(34, minute2);
    Millisecond milli2 = new Millisecond(999, second2);
    assertTrue(milli1.equals(milli2));
}

From source file:org.jfree.data.time.junit.MillisecondTest.java

/**
 * Tests the equals method.//  ww  w  .j a  va  2 s .co m
 */
public void testEquals() {
    Day day1 = new Day(29, MonthConstants.MARCH, 2002);
    Hour hour1 = new Hour(15, day1);
    Minute minute1 = new Minute(15, hour1);
    Second second1 = new Second(34, minute1);
    Millisecond milli1 = new Millisecond(999, second1);
    Day day2 = new Day(29, MonthConstants.MARCH, 2002);
    Hour hour2 = new Hour(15, day2);
    Minute minute2 = new Minute(15, hour2);
    Second second2 = new Second(34, minute2);
    Millisecond milli2 = new Millisecond(999, second2);
    assertTrue(milli1.equals(milli2));
}