Examples of FixedMillisecond


Examples of org.jfree.data.time.FixedMillisecond

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        FixedMillisecond m1 = new FixedMillisecond();
        FixedMillisecond m2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(m1);
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashcode() {
        FixedMillisecond m1 = new FixedMillisecond(500000L);
        FixedMillisecond m2 = new FixedMillisecond(500000L);
        assertTrue(m1.equals(m2));
        int h1 = m1.hashCode();
        int h2 = m2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * The {@link FixedMillisecond} class is immutable, so should not be
     * {@link Cloneable}.
     */
    public void testNotCloneable() {
        FixedMillisecond m = new FixedMillisecond(500000L);
        assertFalse(m instanceof Cloneable);
    }
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * A check for immutability.
     */
    public void testImmutability() {
        Date d = new Date(20L);
        FixedMillisecond fm = new FixedMillisecond(d);
        d.setTime(22L);
        assertEquals(20L, fm.getFirstMillisecond());
    }
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * A test for the bug report 1075255.
     */
    public void testBug1075255() {
        TimeSeries ts = new TimeSeries("dummy", FixedMillisecond.class);
        ts.add(new FixedMillisecond(0L), 0.0);
        TimeSeries ts2 = new TimeSeries("dummy2", FixedMillisecond.class);
        ts2.add(new FixedMillisecond(0L), 1.0);
        try {
            ts.addAndOrUpdate(ts2);
        }
        catch (Exception e) {
            e.printStackTrace();
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * A test for the bug report 1075255.
     */
    public void testBug1075255() {
        TimeSeries ts = new TimeSeries("dummy", FixedMillisecond.class);
        ts.add(new FixedMillisecond(0L), 0.0);
        TimeSeries ts2 = new TimeSeries("dummy2", FixedMillisecond.class);
        ts2.add(new FixedMillisecond(0L), 1.0);
        try {
            ts.addAndOrUpdate(ts2);
        }
        catch (Exception e) {
            e.printStackTrace();
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        FixedMillisecond m1 = new FixedMillisecond();
        FixedMillisecond m2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(m1);
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashcode() {
        FixedMillisecond m1 = new FixedMillisecond(500000L);
        FixedMillisecond m2 = new FixedMillisecond(500000L);
        assertTrue(m1.equals(m2));
        int h1 = m1.hashCode();
        int h2 = m2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * The {@link FixedMillisecond} class is immutable, so should not be
     * {@link Cloneable}.
     */
    public void testNotCloneable() {
        FixedMillisecond m = new FixedMillisecond(500000L);
        assertFalse(m instanceof Cloneable);
    }
View Full Code Here

Examples of org.jfree.data.time.FixedMillisecond

    /**
     * A check for immutability.
     */
    public void testImmutability() {
        Date d = new Date(20L);
        FixedMillisecond fm = new FixedMillisecond(d);
        d.setTime(22L);
        assertEquals(20L, fm.getFirstMillisecond());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.