Run JUnit tests via JUnit runner instead of Maven plugin

This commit is contained in:
Alexey Andreev 2016-02-23 18:46:32 +03:00
parent 5e7311d8cc
commit 2b3cba69bc
106 changed files with 525 additions and 301 deletions

View File

@ -34,6 +34,7 @@
<module name="teavm-jso" />
<module name="teavm-jso-apis" />
<module name="teavm-jso-impl" />
<module name="teavm-junit" />
<module name="teavm-maven-plugin" />
<module name="teavm-maven-webapp" />
<module name="teavm-metaprogramming-api" />
@ -60,6 +61,7 @@
<module name="teavm-jso" target="1.8" />
<module name="teavm-jso-apis" target="1.8" />
<module name="teavm-jso-impl" target="1.8" />
<module name="teavm-junit" target="1.8" />
<module name="teavm-maven" target="1.5" />
<module name="teavm-maven-plugin" target="1.8" />
<module name="teavm-maven-webapp" target="1.5" />

View File

@ -23,6 +23,7 @@
<file url="file://$PROJECT_DIR$/tools/chrome-rdp" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/tools/cli" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/tools/core" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/tools/junit" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/tools/maven" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/tools/maven/plugin" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/tools/maven/webapp" charset="UTF-8" />

View File

@ -2,6 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/all-deps/all-deps.iml" filepath="$PROJECT_DIR$/all-deps/all-deps.iml" />
<module fileurl="file://$PROJECT_DIR$/teavm.iml" filepath="$PROJECT_DIR$/teavm.iml" />
<module fileurl="file://$PROJECT_DIR$/tools/chrome-rdp/teavm-chrome-rdp.iml" filepath="$PROJECT_DIR$/tools/chrome-rdp/teavm-chrome-rdp.iml" />
<module fileurl="file://$PROJECT_DIR$/classlib/teavm-classlib.iml" filepath="$PROJECT_DIR$/classlib/teavm-classlib.iml" />
@ -14,6 +15,7 @@
<module fileurl="file://$PROJECT_DIR$/jso/core/teavm-jso.iml" filepath="$PROJECT_DIR$/jso/core/teavm-jso.iml" />
<module fileurl="file://$PROJECT_DIR$/jso/apis/teavm-jso-apis.iml" filepath="$PROJECT_DIR$/jso/apis/teavm-jso-apis.iml" />
<module fileurl="file://$PROJECT_DIR$/jso/impl/teavm-jso-impl.iml" filepath="$PROJECT_DIR$/jso/impl/teavm-jso-impl.iml" />
<module fileurl="file://$PROJECT_DIR$/tools/junit/teavm-junit.iml" filepath="$PROJECT_DIR$/tools/junit/teavm-junit.iml" />
<module fileurl="file://$PROJECT_DIR$/tools/maven/teavm-maven.iml" filepath="$PROJECT_DIR$/tools/maven/teavm-maven.iml" />
<module fileurl="file://$PROJECT_DIR$/tools/maven/plugin/teavm-maven-plugin.iml" filepath="$PROJECT_DIR$/tools/maven/plugin/teavm-maven-plugin.iml" />
<module fileurl="file://$PROJECT_DIR$/tools/maven/webapp/teavm-maven-webapp.iml" filepath="$PROJECT_DIR$/tools/maven/webapp/teavm-maven-webapp.iml" />

View File

@ -0,0 +1,29 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="run-tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.teavm.classlib.java.lang.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="teavm-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.teavm" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -Dteavm.junit.target=target/js-tests" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<dir value="$PROJECT_DIR$/../../idea-debug/teavm/tests/src/test/java" />
<patterns />
<method />
</configuration>
</component>

25
all-deps/all-deps.iml Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="teavm-classlib" exported="" />
<orderEntry type="module" module-name="teavm-cli" exported="" />
<orderEntry type="module" module-name="teavm-core" exported="" />
<orderEntry type="module" module-name="teavm-jso-apis" exported="" />
<orderEntry type="module" module-name="teavm-jso-impl" exported="" />
<orderEntry type="module" module-name="teavm-metaprogramming-api" exported="" />
<orderEntry type="module" module-name="teavm-platform" exported="" />
<orderEntry type="module" module-name="teavm-tests" exported="" />
<orderEntry type="module" module-name="teavm-tooling" exported="" />
<orderEntry type="module" module-name="teavm-samples-async" exported="" />
<orderEntry type="module" module-name="teavm-samples-benchmark" exported="" />
<orderEntry type="module" module-name="teavm-samples-hello" exported="" />
<orderEntry type="module" module-name="teavm-samples-kotlin" exported="" />
<orderEntry type="module" module-name="teavm-samples-scala" exported="" />
<orderEntry type="module" module-name="teavm-samples-storage" exported="" />
<orderEntry type="module" module-name="teavm-samples-video" exported="" />
</component>
</module>

View File

@ -26,6 +26,9 @@
<packaging>bundle</packaging>
<name>TeaVM core</name>
<description>TeaVM compiler and SPI</description>
<dependencies>
<dependency>
<groupId>junit</groupId>
@ -57,9 +60,6 @@
</dependency>
</dependencies>
<name>TeaVM core</name>
<description>TeaVM compiler and SPI</description>
<build>
<plugins>
<plugin>

View File

@ -92,6 +92,7 @@
<module>tools/cli</module>
<module>tools/maven</module>
<module>tools/chrome-rdp</module>
<module>tools/junit</module>
<module>tests</module>
<module>extras-slf4j</module>
</modules>

View File

@ -73,6 +73,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-junit</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>

View File

@ -19,8 +19,11 @@ package org.teavm.classlib.java.io;
import static org.junit.Assert.*;
import java.io.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@SuppressWarnings("resource")
@RunWith(TeaVMTestRunner.class)
public class BufferedInputStreamTest {
byte[] ibuf = new byte[4096];
@ -35,20 +38,6 @@ public class BufferedInputStreamTest {
}
}
static class MockBufferedInputStream extends BufferedInputStream {
static byte[] buf;
MockBufferedInputStream(InputStream is) {
super(is);
buf = super.buf;
}
MockBufferedInputStream(InputStream is, int size) {
super(is, size);
buf = super.buf;
}
}
@Test
public void test_available() throws IOException {
ByteArrayInputStream isFile = new ByteArrayInputStream(new byte[] { 2, 3, 5, 7, 11 });

View File

@ -20,11 +20,14 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class BufferedReaderTest {
@Test
public void readsCharacters() throws IOException {

View File

@ -20,11 +20,10 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class InputStreamReaderTest {
@Test
public void readsChars() throws IOException {

View File

@ -24,8 +24,11 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
import static org.junit.Assert.*;
@RunWith(TeaVMTestRunner.class)
public class OutputStreamWriterTest {
private static final int UPPER = 0xd800;

View File

@ -21,8 +21,11 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.PushbackInputStream;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@SuppressWarnings("resource")
@RunWith(TeaVMTestRunner.class)
public class PushbackInputStreamTest {
PushbackInputStream pis;

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class BooleanTest {
@Test
public void parsesBoolean() {

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class CharacterTest {
@Test
public void digitsRecognized() {

View File

@ -20,11 +20,10 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ClassLoaderTest {
@Test
public void loadsResources() {

View File

@ -24,11 +24,10 @@ import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ClassTest {
@Test
public void classNameEvaluated() {

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class DoubleTest {
@Test
public void parsed() {

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class EnumTest {
private enum Foo {
A, B, C

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class FloatTest {
@Test
public void parsed() {

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class IntegerTest {
@Test
public void parsesInteger() {

View File

@ -4,11 +4,10 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import java.lang.reflect.Array;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class LambdaTest {
@Test
public void lambdaWorks() {

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class MathTest {
@Test
public void sinComputed() {

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ObjectTest {
@Test
public void objectCreated() {

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class StringBuilderTest {
@Test
public void integerAppended() {

View File

@ -18,11 +18,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import java.io.UnsupportedEncodingException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class StringTest {
@Test
public void charsExtracted() {

View File

@ -17,11 +17,10 @@ package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class SystemTest {
@Test
public void copiesArray() {

View File

@ -15,10 +15,6 @@
*/
package org.teavm.classlib.java.lang;
/**
*
* @author Alexey Andreev
*/
public class TestObject extends Object implements Runnable {
private int counter;

View File

@ -18,10 +18,6 @@ package org.teavm.classlib.java.lang;
import org.teavm.classlib.ResourceSupplier;
import org.teavm.model.ListableClassReaderSource;
/**
*
* @author Alexey Andreev
*/
public class TestResourcesSupplier implements ResourceSupplier {
@Override
public String[] supplyResources(ClassLoader classLoader, ListableClassReaderSource classSource) {

View File

@ -16,12 +16,16 @@
package org.teavm.classlib.java.lang;
import static org.junit.Assert.*;
import java.lang.annotation.Retention;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class VMTest {
@Test
public void multiArrayCreated() {

View File

@ -18,11 +18,10 @@ package org.teavm.classlib.java.lang.reflect;
import static org.junit.Assert.*;
import java.lang.reflect.Array;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ArrayTest {
@Test
public void createsNewInstance() {

View File

@ -23,11 +23,10 @@ import java.math.BigInteger;
import java.math.MathContext;
import java.math.RoundingMode;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigDecimal
* Methods: add, subtract, multiply, divide
*/
@RunWith(TeaVMTestRunner.class)
public class BigDecimalArithmeticTest {
/**
* Add two numbers of equal positive scales

View File

@ -26,12 +26,10 @@ import java.math.BigInteger;
import java.math.MathContext;
import java.math.RoundingMode;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigDecimal
* Methods: abs, compareTo, equals, hashCode,
* max, min, negate, signum
*/
@RunWith(TeaVMTestRunner.class)
public class BigDecimalCompareTest {
/**
* Abs() of a negative BigDecimal

View File

@ -26,11 +26,10 @@ import java.math.BigInteger;
import java.math.MathContext;
import java.math.RoundingMode;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigDecimal
* Methods: constructors and fields
*/
@RunWith(TeaVMTestRunner.class)
public class BigDecimalConstructorsTest {
/**
* check ONE

View File

@ -24,12 +24,10 @@ import static org.junit.Assert.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigDecimal
* Methods: doubleValue, floatValue, intValue, longValue,
* valueOf, toString, toBigInteger
*/
@RunWith(TeaVMTestRunner.class)
public class BigDecimalConvertTest {
/**
* Double value of a negative BigDecimal

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigDecimal
* Methods: movePointLeft, movePointRight, scale, setScale, unscaledValue *
*/
@RunWith(TeaVMTestRunner.class)
public class BigDecimalScaleOperationsTest {
/**
* Check the default scale

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Method: add
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerAddTest {
/**
* Add two positive numbers of the same length

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Method: and
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerAndTest {
/**
* And for zero and a positive number

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Methods: abs, compareTo, equals, max, min, negate, signum
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerCompareTest {
/**
* abs() for a positive number

View File

@ -24,12 +24,10 @@ import static org.junit.Assert.*;
import java.math.BigInteger;
import java.util.Random;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Constructors: BigInteger(byte[] a), BigInteger(int sign, byte[] a),
* BigInteger(String val, int radix)
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerConstructorsTest {
/**
* Create a number from an array of bytes.

View File

@ -23,12 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Methods: intValue, longValue, toByteArray(), valueOf(long val),
* floatValue(), doubleValue()
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerConvertTest {
/**
* Return the double value of ZERO.

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Methods: divide, remainder, mod, and divideAndRemainder
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerDivideTest {
/**
* Divide by zero

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Method: hashCode()
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerHashCodeTest {
/**
* Test hash codes for the same object

View File

@ -23,10 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger Methods: modPow, modInverse, and gcd
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerModPowTest {
/**
* modPow: non-positive modulus

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Method: multiply
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerMultiplyTest {
/**
* Multiply two negative numbers of the same length

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Methods: and, andNot
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerNotTest {
/**
* andNot for two positive numbers; the first is longer

View File

@ -23,12 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Methods: bitLength, shiftLeft, shiftRight,
* clearBit, flipBit, setBit, testBit
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerOperateBitsTest {
/**
* bitCount() of zero.

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Method: or
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerOrTest {
/**
* Or for zero and a positive number

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Method: subtract
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerSubtractTest {
/**
* Subtract two positive numbers of the same length.

View File

@ -22,12 +22,11 @@ package org.teavm.classlib.java.math;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
import static org.junit.Assert.*;
/**
* Class: java.math.BigInteger
* Method: toString(int radix)
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerToStringTest {
/**
* If 36 < radix < 2 it should be set to 10

View File

@ -23,11 +23,10 @@ package org.teavm.classlib.java.math;
import static org.junit.Assert.*;
import java.math.BigInteger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Class: java.math.BigInteger
* Method: xor
*/
@RunWith(TeaVMTestRunner.class)
public class BigIntegerXorTest {
/**
* Xor for zero and a positive number

View File

@ -5,11 +5,10 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.nio.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ByteBufferTest {
@Test
public void allocatesDirect() {

View File

@ -19,11 +19,10 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
import java.nio.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ByteBufferWrapperTest {
@Test
public void wrapsIntoShortBuffer() {

View File

@ -7,11 +7,10 @@ import static org.junit.Assert.fail;
import java.io.IOException;
import java.nio.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class CharBufferTest {
@Test
public void allocates() {

View File

@ -21,11 +21,10 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.nio.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class DoubleBufferTest {
@Test
public void allocatesSimple() {

View File

@ -21,11 +21,10 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.nio.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class FloatBufferTest {
@Test
public void allocatesSimple() {

View File

@ -21,11 +21,10 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.nio.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class IntBufferTest {
@Test
public void allocatesSimple() {

View File

@ -21,11 +21,10 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.nio.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class LongBufferTest {
@Test
public void allocatesSimple() {

View File

@ -5,11 +5,10 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.nio.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ShortBufferTest {
@Test
public void allocatesSimple() {

View File

@ -9,11 +9,10 @@ import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.util.Arrays;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class UTF8Test {
@Test
public void encode1() {

View File

@ -24,11 +24,10 @@ import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class DateFormatTest {
public DateFormatTest() {
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));

View File

@ -22,11 +22,10 @@ import java.text.DecimalFormatSymbols;
import java.text.ParseException;
import java.util.Locale;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class DecimalFormatParseTest {
private static DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ENGLISH);

View File

@ -24,11 +24,10 @@ import java.text.DecimalFormatSymbols;
import java.util.Currency;
import java.util.Locale;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class DecimalFormatTest {
private static DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ENGLISH);

View File

@ -6,11 +6,10 @@ import java.util.Currency;
import java.util.Locale;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class NumberFormatTest {
@Test
public void formatsNumber() {

View File

@ -20,11 +20,10 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class SimpleDateFormatTest {
public SimpleDateFormatTest() {
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));

View File

@ -20,11 +20,10 @@ import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Iterator;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ArrayDequeTest {
@Test
public void addsToFront() {

View File

@ -20,11 +20,10 @@ import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ArrayListTest {
@Test
public void elementsAdded() {

View File

@ -19,11 +19,10 @@ import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ArraysTest {
@Test
public void arraySorted() {

View File

@ -35,7 +35,10 @@ import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.BitSet;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class)
public class BitSetTest {
BitSet eightbs;

View File

@ -21,12 +21,11 @@ import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
import static org.junit.Assert.*;
/**
*
* @author shannah
*/
@RunWith(TeaVMTestRunner.class)
public class CalendarTest {
Locale defaultLocale;

View File

@ -21,11 +21,10 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class CollectionsTest {
@Test
public void listSorted() {

View File

@ -20,11 +20,10 @@ import java.util.Currency;
import java.util.Locale;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class CurrencyTest {
@Test
public void findsByCode() {

View File

@ -3,11 +3,10 @@ package org.teavm.classlib.java.util;
import static org.junit.Assert.*;
import java.util.Date;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class DateTest {
@SuppressWarnings("deprecation")
@Test

View File

@ -47,9 +47,12 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.Vector;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.classlib.support.Support_MapTest2;
import org.teavm.classlib.support.Support_UnmodifiableCollectionTest;
import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class)
public class HashtableTest {
private Hashtable<String, String> ht10;

View File

@ -20,11 +20,11 @@ import static org.junit.Assert.*;
import java.util.*;
import java.util.Map.Entry;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.classlib.support.Support_MapTest2;
import org.teavm.junit.TeaVMTestRunner;
/**
* @tests java.util.LinkedHashMap
*/
@RunWith(TeaVMTestRunner.class)
public class LinkedHashMapTest {
LinkedHashMap<Object, Object> hm;

View File

@ -18,11 +18,10 @@ package org.teavm.classlib.java.util;
import static org.junit.Assert.*;
import java.util.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class LinkedListTest {
@Test
public void emptyListCreated() {

View File

@ -18,11 +18,10 @@ package org.teavm.classlib.java.util;
import static org.junit.Assert.*;
import java.util.Locale;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class LocaleTest {
@Test
public void availableLocalesFound() {

View File

@ -23,11 +23,10 @@ import java.util.Iterator;
import java.util.List;
import java.util.PriorityQueue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class PriorityQueueTest {
@Test
public void receivesElements() {

View File

@ -18,11 +18,10 @@ package org.teavm.classlib.java.util;
import static org.junit.Assert.*;
import java.util.ServiceLoader;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ServiceLoaderTest {
@Test
public void loadsService() {

View File

@ -21,7 +21,10 @@ import static org.junit.Assert.*;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class)
public class StringTokenizerTest {
@Test
public void test_ConstructorLjava_lang_StringLjava_lang_String() {

View File

@ -15,10 +15,14 @@
*/
package org.teavm.classlib.java.util;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public interface TestService {
void foo();
}

View File

@ -15,10 +15,14 @@
*/
package org.teavm.classlib.java.util;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class TestServiceImpl implements TestService {
private int counter;

View File

@ -24,11 +24,14 @@ import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class TimeZoneTest {
private static final int ONE_HOUR = 3600000;

View File

@ -35,7 +35,10 @@ import static org.junit.Assert.*;
import java.io.Serializable;
import java.util.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class)
public class TreeMapTest {
public static class ReversedComparator implements Comparator<Object> {

View File

@ -40,8 +40,11 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.classlib.support.Support_ListTest;
import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class)
public class VectorTest {
private Vector<Object> tVector = new Vector<>();

View File

@ -20,11 +20,11 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
import static org.junit.Assert.*;
/**
* Tests Matcher methods
*/
@RunWith(TeaVMTestRunner.class)
@SuppressWarnings("nls")
public class Matcher2Test {
@Test

View File

@ -21,9 +21,11 @@ import static org.junit.Assert.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@SuppressWarnings("nls")
@RunWith(TeaVMTestRunner.class)
public class MatcherTest {
String[] testPatterns = {
"(a|b)*abb",

View File

@ -21,11 +21,14 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Tests Pattern compilation modes and modes triggered in pattern strings
*/
@SuppressWarnings("nls")
@RunWith(TeaVMTestRunner.class)
public class ModeTest {
@Test
public void testCase() throws PatternSyntaxException {

View File

@ -21,11 +21,14 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.junit.Test;
import junit.framework.TestCase;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Tests simple Pattern compilation and Matcher methods
*/
@SuppressWarnings("nls")
@RunWith(TeaVMTestRunner.class)
public class Pattern2Test extends TestCase {
@Test
public void testSimpleMatch() throws PatternSyntaxException {

View File

@ -19,11 +19,14 @@ package org.teavm.classlib.java.util.regex;
import static org.junit.Assert.*;
import java.util.regex.Pattern;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* Test boundary and error conditions in java.util.regex.Pattern
*/
@SuppressWarnings("nls")
@RunWith(TeaVMTestRunner.class)
public class PatternErrorTest {
@Test
public void testCompileErrors() throws Exception {

View File

@ -20,12 +20,14 @@ import static org.junit.Assert.*;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
* TODO Type description
*/
@SuppressWarnings("nls")
@RunWith(TeaVMTestRunner.class)
public class PatternSyntaxExceptionTest {
@Test
public void testCase() {

View File

@ -22,7 +22,10 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class)
public class PatternTest {
String[] testPatterns = {
"(a|b)*abb",

View File

@ -21,7 +21,10 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class)
public class ReplaceTest {
@Test

View File

@ -22,7 +22,10 @@ import static org.junit.Assert.assertTrue;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class)
public class SplitTest {
@Test

View File

@ -20,11 +20,14 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.zip.GZIPInputStream;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class GZIPInputStreamTest {
@Test
public void gzipInputWorks() throws IOException {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2015 Alexey Andreev.
* Copyright 2016 Alexey Andreev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,15 +17,14 @@ package org.teavm.jso.test;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSMethod;
import org.teavm.jso.JSObject;
import org.teavm.jso.JSProperty;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class AnnotationsTest {
@Test
public void staticBodyWorks() {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2015 Alexey Andreev.
* Copyright 2016 Alexey Andreev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,15 +17,14 @@ package org.teavm.jso.test;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSObject;
import org.teavm.jso.JSProperty;
import org.teavm.jso.core.JSString;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ConversionTest {
@Test
public void convertsPrimitivesToJavaScript() {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2015 Alexey Andreev.
* Copyright 2016 Alexey Andreev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,14 +17,13 @@ package org.teavm.jso.test;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSFunctor;
import org.teavm.jso.JSObject;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class FunctorTest {
@Test
public void functorPassed() {

View File

@ -17,13 +17,16 @@ package org.teavm.jso.test;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSObject;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class ImplementationTest {
@Test
public void respectsPrecedence() {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2015 Alexey Andreev.
* Copyright 2016 Alexey Andreev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,13 +17,12 @@ package org.teavm.jso.test;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSObject;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Alexey Andreev
*/
@RunWith(TeaVMTestRunner.class)
public class JavaInvocationTest {
@Test
public void callStaticMethod() {

Some files were not shown because too many files have changed in this diff Show More