emul/compact/src/test/java/org/apidesign/bck2brwsr/compact/tck/RandomTest.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 07 Feb 2013 12:58:12 +0100
branchemul
changeset 694 0d277415ed02
permissions -rw-r--r--
Rebasing the Inflater support on jzlib which, unlike GNU ClassPath, has correct implementation of Huffman code. Making the implementation more easily testable by turning Inflater and ZipInputStream into pure delegates. Current implementation is going to need proper long support.
jaroslav@599
     1
/**
jaroslav@599
     2
 * Back 2 Browser Bytecode Translator
jaroslav@599
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@599
     4
 *
jaroslav@599
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@599
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@599
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@599
     8
 *
jaroslav@599
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@599
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@599
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@599
    12
 * GNU General Public License for more details.
jaroslav@599
    13
 *
jaroslav@599
    14
 * You should have received a copy of the GNU General Public License
jaroslav@599
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@599
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@599
    17
 */
jaroslav@599
    18
package org.apidesign.bck2brwsr.compact.tck;
jaroslav@599
    19
jaroslav@599
    20
import java.util.Random;
jaroslav@599
    21
import org.apidesign.bck2brwsr.vmtest.Compare;
jaroslav@599
    22
import org.apidesign.bck2brwsr.vmtest.VMTest;
jaroslav@599
    23
import org.testng.annotations.Factory;
jaroslav@599
    24
jaroslav@599
    25
/**
jaroslav@599
    26
 *
jaroslav@599
    27
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@599
    28
 */
jaroslav@599
    29
public class RandomTest {
jaroslav@599
    30
    @Compare public boolean canInstantiateRandom() {
jaroslav@599
    31
        Random r = new Random();
jaroslav@599
    32
        r.nextInt();
jaroslav@599
    33
        return r != null;
jaroslav@599
    34
    }
jaroslav@599
    35
jaroslav@599
    36
    
jaroslav@599
    37
    @Factory public static Object[] create() {
jaroslav@599
    38
        return VMTest.create(RandomTest.class);
jaroslav@599
    39
    }
jaroslav@599
    40
}