emul/compact/src/test/java/org/apidesign/bck2brwsr/compact/tck/JFXIssuesTest.java
author Lubomir Nerad <lubomir.nerad@oracle.com>
Mon, 25 Feb 2013 19:00:08 +0100
brancharithmetic
changeset 755 5652acd48509
parent 752 cc3871bdd83c
child 771 4252bfc396fc
permissions -rw-r--r--
Added conversion to long for JavaScript implementation of System.currentTimeMillis
jaroslav@733
     1
/**
jaroslav@733
     2
 * Back 2 Browser Bytecode Translator
jaroslav@733
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@733
     4
 *
jaroslav@733
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@733
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@733
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@733
     8
 *
jaroslav@733
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@733
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@733
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@733
    12
 * GNU General Public License for more details.
jaroslav@733
    13
 *
jaroslav@733
    14
 * You should have received a copy of the GNU General Public License
jaroslav@733
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@733
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@733
    17
 */
jaroslav@733
    18
package org.apidesign.bck2brwsr.compact.tck;
jaroslav@733
    19
jaroslav@733
    20
import org.apidesign.bck2brwsr.vmtest.Compare;
jaroslav@733
    21
import org.apidesign.bck2brwsr.vmtest.VMTest;
jaroslav@733
    22
import org.testng.annotations.Factory;
jaroslav@733
    23
jaroslav@733
    24
jaroslav@733
    25
public class JFXIssuesTest {
jaroslav@733
    26
    private abstract class Application {
jaroslav@733
    27
        public abstract int getID();
jaroslav@733
    28
    }
jaroslav@733
    29
    
jaroslav@733
    30
    private class MyApplication extends Application {
jaroslav@733
    31
jaroslav@733
    32
        @Override
jaroslav@733
    33
        public int getID() {
jaroslav@733
    34
            return 1;
jaroslav@733
    35
        }
jaroslav@733
    36
        
jaroslav@733
    37
    } 
jaroslav@733
    38
    
jaroslav@733
    39
    @Compare public boolean isClassAssignable() {
jaroslav@733
    40
        return Application.class.isAssignableFrom(MyApplication.class);
jaroslav@733
    41
    }
lubomir@752
    42
lubomir@752
    43
    @Compare public boolean isNaN() {
lubomir@752
    44
        return Double.isNaN(Double.NaN);
lubomir@752
    45
    }
lubomir@752
    46
lubomir@752
    47
    @Compare public boolean isInfinite() {
lubomir@752
    48
        return Float.isInfinite(Float.NEGATIVE_INFINITY);
lubomir@752
    49
    }
lubomir@752
    50
lubomir@755
    51
    @Compare public boolean areTimesEqual() {
lubomir@755
    52
        long l1 = System.currentTimeMillis();
lubomir@755
    53
        long l2 = l1 + 0;
lubomir@755
    54
lubomir@755
    55
        return l1 == l2;
lubomir@755
    56
    }
lubomir@755
    57
jaroslav@733
    58
    @Factory public static Object[] create() {
jaroslav@733
    59
        return VMTest.create(JFXIssuesTest.class);
jaroslav@733
    60
    }
jaroslav@733
    61
}