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

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

Introduction

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

Prototype

public long getMillisecond() 

Source Link

Document

Returns the millisecond.

Usage

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

/**
 * In GMT, the 4.55:59.123pm on 21 Mar 2002 is
 * java.util.Date(1016729759123L).  Use this to check the Millisecond
 * constructor./*from w  w w  . j a  v a2s.  c om*/
 */
@Test
public void testDateConstructor1() {
    TimeZone zone = TimeZone.getTimeZone("GMT");
    Locale locale = Locale.getDefault(); // locale should not matter here
    Millisecond m1 = new Millisecond(new Date(1016729759122L), zone, locale);
    Millisecond m2 = new Millisecond(new Date(1016729759123L), zone, locale);

    assertEquals(122, m1.getMillisecond());
    assertEquals(1016729759122L, m1.getLastMillisecond(zone));

    assertEquals(123, m2.getMillisecond());
    assertEquals(1016729759123L, m2.getFirstMillisecond(zone));
}

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

/**
 * In Tallinn, the 4.55:59.123pm on 21 Mar 2002 is
 * java.util.Date(1016722559123L).  Use this to check the Millisecond
 * constructor./*from  w ww  .  j a  va2s  .  c  om*/
 */
@Test
public void testDateConstructor2() {
    TimeZone zone = TimeZone.getTimeZone("Europe/Tallinn");
    Locale locale = Locale.getDefault(); // locale should not matter here
    Millisecond m1 = new Millisecond(new Date(1016722559122L), zone, locale);
    Millisecond m2 = new Millisecond(new Date(1016722559123L), zone, locale);

    assertEquals(122, m1.getMillisecond());
    assertEquals(1016722559122L, m1.getLastMillisecond(zone));

    assertEquals(123, m2.getMillisecond());
    assertEquals(1016722559123L, m2.getFirstMillisecond(zone));
}

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

/**
 * In GMT, the 4.55:59.123pm on 21 Mar 2002 is
 * java.util.Date(1016729759123L).  Use this to check the Millisecond
 * constructor.//  ww  w. ja  va  2  s. c  om
 */
public void testDateConstructor1() {
    TimeZone zone = TimeZone.getTimeZone("GMT");
    Locale locale = Locale.getDefault(); // locale should not matter here
    Calendar c = new GregorianCalendar(zone);
    Millisecond m1 = new Millisecond(new Date(1016729759122L), zone, locale);
    Millisecond m2 = new Millisecond(new Date(1016729759123L), zone, locale);

    assertEquals(122, m1.getMillisecond());
    assertEquals(1016729759122L, m1.getLastMillisecond(c));

    assertEquals(123, m2.getMillisecond());
    assertEquals(1016729759123L, m2.getFirstMillisecond(c));
}

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

/**
 * In Tallinn, the 4.55:59.123pm on 21 Mar 2002 is
 * java.util.Date(1016722559123L).  Use this to check the Millisecond
 * constructor.//from  w  w w  .  ja v  a2 s.co m
 */
public void testDateConstructor2() {
    TimeZone zone = TimeZone.getTimeZone("Europe/Tallinn");
    Locale locale = Locale.getDefault(); // locale should not matter here
    Calendar c = new GregorianCalendar(zone);
    Millisecond m1 = new Millisecond(new Date(1016722559122L), zone, locale);
    Millisecond m2 = new Millisecond(new Date(1016722559123L), zone, locale);

    assertEquals(122, m1.getMillisecond());
    assertEquals(1016722559122L, m1.getLastMillisecond(c));

    assertEquals(123, m2.getMillisecond());
    assertEquals(1016722559123L, m2.getFirstMillisecond(c));
}

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

/**
 * Some checks for the testNext() method.
 */// w w w.  j  a v  a 2 s .co m
@Test
public void testNext() {
    Millisecond m = new Millisecond(555, 55, 30, 1, 12, 12, 2000);
    m = (Millisecond) m.next();
    assertEquals(2000, m.getSecond().getMinute().getHour().getYear());
    assertEquals(12, m.getSecond().getMinute().getHour().getMonth());
    assertEquals(12, m.getSecond().getMinute().getHour().getDayOfMonth());
    assertEquals(1, m.getSecond().getMinute().getHour().getHour());
    assertEquals(30, m.getSecond().getMinute().getMinute());
    assertEquals(55, m.getSecond().getSecond());
    assertEquals(556, m.getMillisecond());
    m = new Millisecond(999, 59, 59, 23, 31, 12, 9999);
    assertNull(m.next());
}

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

/**
 * Some checks for the testNext() method.
 *///w w w.j ava2 s.  c o  m
public void testNext() {
    Millisecond m = new Millisecond(555, 55, 30, 1, 12, 12, 2000);
    m = (Millisecond) m.next();
    assertEquals(2000, m.getSecond().getMinute().getHour().getYear());
    assertEquals(12, m.getSecond().getMinute().getHour().getMonth());
    assertEquals(12, m.getSecond().getMinute().getHour().getDayOfMonth());
    assertEquals(1, m.getSecond().getMinute().getHour().getHour());
    assertEquals(30, m.getSecond().getMinute().getMinute());
    assertEquals(55, m.getSecond().getSecond());
    assertEquals(556, m.getMillisecond());
    m = new Millisecond(999, 59, 59, 23, 31, 12, 9999);
    assertNull(m.next());
}