diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index f5f5d00da..48910a483 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -34,6 +34,7 @@
+
@@ -60,6 +61,7 @@
+
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index a57555a96..0272c80a3 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -23,6 +23,7 @@
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 4fd4e8a02..f1e38179a 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,6 +2,7 @@
+
@@ -14,6 +15,7 @@
+
diff --git a/.idea/runConfigurations/run_tests.xml b/.idea/runConfigurations/run_tests.xml
new file mode 100644
index 000000000..1ee65a010
--- /dev/null
+++ b/.idea/runConfigurations/run_tests.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/all-deps/all-deps.iml b/all-deps/all-deps.iml
new file mode 100644
index 000000000..c27f9de5e
--- /dev/null
+++ b/all-deps/all-deps.iml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/pom.xml b/core/pom.xml
index 663895ed5..27ccebc97 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -26,6 +26,9 @@
bundle
+ TeaVM core
+ TeaVM compiler and SPI
+
junit
@@ -57,9 +60,6 @@
- TeaVM core
- TeaVM compiler and SPI
-
diff --git a/pom.xml b/pom.xml
index d7ffdeebc..48b53ddfe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,6 +92,7 @@
tools/cli
tools/maven
tools/chrome-rdp
+ tools/junit
tests
extras-slf4j
diff --git a/tests/pom.xml b/tests/pom.xml
index 911cd604c..0ace7653a 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -73,6 +73,12 @@
${project.version}
test
+
+ org.teavm
+ teavm-junit
+ ${project.version}
+ test
+
diff --git a/tests/src/test/java/org/teavm/classlib/java/io/BufferedInputStreamTest.java b/tests/src/test/java/org/teavm/classlib/java/io/BufferedInputStreamTest.java
index d6cd76043..e2fee7902 100644
--- a/tests/src/test/java/org/teavm/classlib/java/io/BufferedInputStreamTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/io/BufferedInputStreamTest.java
@@ -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 });
diff --git a/tests/src/test/java/org/teavm/classlib/java/io/BufferedReaderTest.java b/tests/src/test/java/org/teavm/classlib/java/io/BufferedReaderTest.java
index 8787b706b..7035d008d 100644
--- a/tests/src/test/java/org/teavm/classlib/java/io/BufferedReaderTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/io/BufferedReaderTest.java
@@ -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 {
diff --git a/tests/src/test/java/org/teavm/classlib/java/io/InputStreamReaderTest.java b/tests/src/test/java/org/teavm/classlib/java/io/InputStreamReaderTest.java
index 8ab16e39c..cdb7be083 100644
--- a/tests/src/test/java/org/teavm/classlib/java/io/InputStreamReaderTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/io/InputStreamReaderTest.java
@@ -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 {
diff --git a/tests/src/test/java/org/teavm/classlib/java/io/OutputStreamWriterTest.java b/tests/src/test/java/org/teavm/classlib/java/io/OutputStreamWriterTest.java
index 54ac67f58..a4f0e6ec4 100644
--- a/tests/src/test/java/org/teavm/classlib/java/io/OutputStreamWriterTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/io/OutputStreamWriterTest.java
@@ -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;
diff --git a/tests/src/test/java/org/teavm/classlib/java/io/PushbackInputStreamTest.java b/tests/src/test/java/org/teavm/classlib/java/io/PushbackInputStreamTest.java
index 7af9a2361..19eb7a58b 100644
--- a/tests/src/test/java/org/teavm/classlib/java/io/PushbackInputStreamTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/io/PushbackInputStreamTest.java
@@ -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;
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/BooleanTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/BooleanTest.java
index 6d1014364..4b6847076 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/BooleanTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/BooleanTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/CharacterTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/CharacterTest.java
index 9148ec65c..98fb7a8cb 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/CharacterTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/CharacterTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/ClassLoaderTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/ClassLoaderTest.java
index b20323ce1..a891474fd 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/ClassLoaderTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/ClassLoaderTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/ClassTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/ClassTest.java
index 0aadf5f27..3cc1d2223 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/ClassTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/ClassTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/DoubleTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/DoubleTest.java
index 7a5c8690b..89f4e1d6a 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/DoubleTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/DoubleTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/EnumTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/EnumTest.java
index 953db5208..e63cd1a62 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/EnumTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/EnumTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/FloatTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/FloatTest.java
index 0bbbda665..1f5c8da49 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/FloatTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/FloatTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/IntegerTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/IntegerTest.java
index d0f84f2ba..5b6db1051 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/IntegerTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/IntegerTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/LambdaTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/LambdaTest.java
index 5e02ac667..77639d6fd 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/LambdaTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/LambdaTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/MathTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/MathTest.java
index 58249bcb9..6dd6ad0fd 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/MathTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/MathTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/ObjectTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/ObjectTest.java
index 5aae01964..084d241ee 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/ObjectTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/ObjectTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/StringBuilderTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/StringBuilderTest.java
index 3f88af2aa..1842cd5f6 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/StringBuilderTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/StringBuilderTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/StringTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/StringTest.java
index 5725e8d43..a05572a01 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/StringTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/StringTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/SystemTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/SystemTest.java
index 1e295aa1e..58d884804 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/SystemTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/SystemTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/TestObject.java b/tests/src/test/java/org/teavm/classlib/java/lang/TestObject.java
index 2b848cfbc..9409b8358 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/TestObject.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/TestObject.java
@@ -15,10 +15,6 @@
*/
package org.teavm.classlib.java.lang;
-/**
- *
- * @author Alexey Andreev
- */
public class TestObject extends Object implements Runnable {
private int counter;
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/TestResourcesSupplier.java b/tests/src/test/java/org/teavm/classlib/java/lang/TestResourcesSupplier.java
index 3540e9ff1..ed4196747 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/TestResourcesSupplier.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/TestResourcesSupplier.java
@@ -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) {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/VMTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/VMTest.java
index e569c021a..c85382ad3 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/VMTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/VMTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ArrayTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ArrayTest.java
index 4c32b020d..f1cd83274 100644
--- a/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ArrayTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/lang/reflect/ArrayTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalArithmeticTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalArithmeticTest.java
index e83ee39a3..91f8ae25d 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalArithmeticTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalArithmeticTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalCompareTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalCompareTest.java
index 5fb96c0e3..020d3af15 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalCompareTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalCompareTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConstructorsTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConstructorsTest.java
index efeee45f2..7fb3986db 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConstructorsTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConstructorsTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConvertTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConvertTest.java
index e8c48b236..24e4ab2f6 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConvertTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalConvertTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalScaleOperationsTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalScaleOperationsTest.java
index fac6fa45a..9285dc0b9 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalScaleOperationsTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigDecimalScaleOperationsTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerAddTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerAddTest.java
index fe864d27d..f4efdd332 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerAddTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerAddTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerAndTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerAndTest.java
index e09ef1973..d03fdc8e9 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerAndTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerAndTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerCompareTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerCompareTest.java
index ccd228a5d..5bc8cb845 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerCompareTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerCompareTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerConstructorsTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerConstructorsTest.java
index f6e7145a9..4a14110f7 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerConstructorsTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerConstructorsTest.java
@@ -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.
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerConvertTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerConvertTest.java
index f22e78e32..02c565b7b 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerConvertTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerConvertTest.java
@@ -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.
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerDivideTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerDivideTest.java
index 8ec471be7..2c6f7e252 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerDivideTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerDivideTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerHashCodeTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerHashCodeTest.java
index e7d63542e..2586157e1 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerHashCodeTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerHashCodeTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerModPowTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerModPowTest.java
index caf43ceef..45dc2cd53 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerModPowTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerModPowTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerMultiplyTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerMultiplyTest.java
index bf2065a8a..2d13c96c2 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerMultiplyTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerMultiplyTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerNotTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerNotTest.java
index f92e2ca8e..49e91a455 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerNotTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerNotTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerOperateBitsTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerOperateBitsTest.java
index d09af25bf..d2fedb113 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerOperateBitsTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerOperateBitsTest.java
@@ -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.
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerOrTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerOrTest.java
index 41ddc5d44..7a39a4f68 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerOrTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerOrTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerSubtractTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerSubtractTest.java
index 69c46374a..b05758539 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerSubtractTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerSubtractTest.java
@@ -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.
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerToStringTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerToStringTest.java
index 1f8fd7181..0f1175f57 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerToStringTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerToStringTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerXorTest.java b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerXorTest.java
index ac7c61dcf..695f7a946 100644
--- a/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerXorTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/math/BigIntegerXorTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/ByteBufferTest.java b/tests/src/test/java/org/teavm/classlib/java/nio/ByteBufferTest.java
index 41572cc87..00740bb87 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/ByteBufferTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/ByteBufferTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/ByteBufferWrapperTest.java b/tests/src/test/java/org/teavm/classlib/java/nio/ByteBufferWrapperTest.java
index 74391ce4f..507219439 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/ByteBufferWrapperTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/ByteBufferWrapperTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/CharBufferTest.java b/tests/src/test/java/org/teavm/classlib/java/nio/CharBufferTest.java
index 3e461b04f..cf3b507c7 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/CharBufferTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/CharBufferTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/DoubleBufferTest.java b/tests/src/test/java/org/teavm/classlib/java/nio/DoubleBufferTest.java
index 270f63cdb..a8ad5b16f 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/DoubleBufferTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/DoubleBufferTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/FloatBufferTest.java b/tests/src/test/java/org/teavm/classlib/java/nio/FloatBufferTest.java
index c46333a61..a041597d4 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/FloatBufferTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/FloatBufferTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/IntBufferTest.java b/tests/src/test/java/org/teavm/classlib/java/nio/IntBufferTest.java
index 1b506da52..56d6b8af3 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/IntBufferTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/IntBufferTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/LongBufferTest.java b/tests/src/test/java/org/teavm/classlib/java/nio/LongBufferTest.java
index 19d58a154..0b3a974fb 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/LongBufferTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/LongBufferTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/ShortBufferTest.java b/tests/src/test/java/org/teavm/classlib/java/nio/ShortBufferTest.java
index 66bf0521c..61606f19c 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/ShortBufferTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/ShortBufferTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/nio/charset/UTF8Test.java b/tests/src/test/java/org/teavm/classlib/java/nio/charset/UTF8Test.java
index 261acda2f..e93acbb64 100644
--- a/tests/src/test/java/org/teavm/classlib/java/nio/charset/UTF8Test.java
+++ b/tests/src/test/java/org/teavm/classlib/java/nio/charset/UTF8Test.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/text/DateFormatTest.java b/tests/src/test/java/org/teavm/classlib/java/text/DateFormatTest.java
index 047956c0d..56dc359dd 100644
--- a/tests/src/test/java/org/teavm/classlib/java/text/DateFormatTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/text/DateFormatTest.java
@@ -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"));
diff --git a/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatParseTest.java b/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatParseTest.java
index a203570d1..1e81674ed 100644
--- a/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatParseTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatParseTest.java
@@ -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);
diff --git a/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatTest.java b/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatTest.java
index 496e54b3f..008c5e06f 100644
--- a/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/text/DecimalFormatTest.java
@@ -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);
diff --git a/tests/src/test/java/org/teavm/classlib/java/text/NumberFormatTest.java b/tests/src/test/java/org/teavm/classlib/java/text/NumberFormatTest.java
index 5c0a5d4fa..20af526d8 100644
--- a/tests/src/test/java/org/teavm/classlib/java/text/NumberFormatTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/text/NumberFormatTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/text/SimpleDateFormatTest.java b/tests/src/test/java/org/teavm/classlib/java/text/SimpleDateFormatTest.java
index d58618a4c..3ae6d8191 100644
--- a/tests/src/test/java/org/teavm/classlib/java/text/SimpleDateFormatTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/text/SimpleDateFormatTest.java
@@ -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"));
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/ArrayDequeTest.java b/tests/src/test/java/org/teavm/classlib/java/util/ArrayDequeTest.java
index 92ba9e4e1..c0f4d112f 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/ArrayDequeTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/ArrayDequeTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/ArrayListTest.java b/tests/src/test/java/org/teavm/classlib/java/util/ArrayListTest.java
index 5410fef9b..899b46ada 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/ArrayListTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/ArrayListTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/ArraysTest.java b/tests/src/test/java/org/teavm/classlib/java/util/ArraysTest.java
index 6c6caaa72..292050546 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/ArraysTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/ArraysTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/BitSetTest.java b/tests/src/test/java/org/teavm/classlib/java/util/BitSetTest.java
index 2624dadc6..2c7d4313d 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/BitSetTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/BitSetTest.java
@@ -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;
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/CalendarTest.java b/tests/src/test/java/org/teavm/classlib/java/util/CalendarTest.java
index 36292a7ee..9d2617e6e 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/CalendarTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/CalendarTest.java
@@ -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;
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/CollectionsTest.java b/tests/src/test/java/org/teavm/classlib/java/util/CollectionsTest.java
index c3f89a886..46778d906 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/CollectionsTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/CollectionsTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/CurrencyTest.java b/tests/src/test/java/org/teavm/classlib/java/util/CurrencyTest.java
index 2c34b36c4..f06445609 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/CurrencyTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/CurrencyTest.java
@@ -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() {
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/DateTest.java b/tests/src/test/java/org/teavm/classlib/java/util/DateTest.java
index 3d2a56adf..698fcbbed 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/DateTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/DateTest.java
@@ -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
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java b/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java
index 569df25cd..8478b05bd 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java
@@ -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 ht10;
diff --git a/tests/src/test/java/org/teavm/classlib/java/util/LinkedHashMapTest.java b/tests/src/test/java/org/teavm/classlib/java/util/LinkedHashMapTest.java
index 8c1b34469..edb3b48bc 100644
--- a/tests/src/test/java/org/teavm/classlib/java/util/LinkedHashMapTest.java
+++ b/tests/src/test/java/org/teavm/classlib/java/util/LinkedHashMapTest.java
@@ -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
\ No newline at end of file
diff --git a/tools/junit/pom.xml b/tools/junit/pom.xml
new file mode 100644
index 000000000..d4959089d
--- /dev/null
+++ b/tools/junit/pom.xml
@@ -0,0 +1,62 @@
+
+
+
+
+ teavm
+ org.teavm
+ 1.0.0-SNAPSHOT
+ ../../pom.xml
+
+ 4.0.0
+
+ teavm-junit
+
+
+
+ junit
+ junit
+ provided
+
+
+ org.teavm
+ teavm-tooling
+ ${project.version}
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+
+ ../../checkstyle.xml
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+
+
\ No newline at end of file
diff --git a/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java b/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java
new file mode 100644
index 000000000..708a67c14
--- /dev/null
+++ b/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.teavm.junit;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import org.junit.Test;
+import org.junit.runner.Description;
+import org.junit.runner.Runner;
+import org.junit.runner.notification.Failure;
+import org.junit.runner.notification.RunNotifier;
+import org.teavm.tooling.testing.TeaVMTestTool;
+
+public class TeaVMTestRunner extends Runner {
+ private static final String PATH_PARAM = "teavm.junit.target";
+ private Class> testClass;
+ private Description description;
+
+ public TeaVMTestRunner(Class> testClass) {
+ this.testClass = testClass;
+ }
+
+ @Override
+ public Description getDescription() {
+ if (description == null) {
+ description = Description.createSuiteDescription(testClass);
+ for (Method method : testClass.getMethods()) {
+ if (method.getParameterCount() == 0 && method.getReturnType() == void.class
+ && method.isAnnotationPresent(Test.class)) {
+ Description testDescription = Description.createTestDescription(testClass, method.getName());
+ description.addChild(testDescription);
+ }
+ }
+ }
+ return description;
+ }
+
+ @Override
+ public void run(RunNotifier notifier) {
+ Description description = getDescription();
+
+ notifier.fireTestStarted(description);
+ String targetPath = System.getProperty(PATH_PARAM);
+ if (targetPath == null) {
+ for (Description testDescription : description.getChildren()) {
+ notifier.fireTestIgnored(testDescription);
+ }
+ notifier.fireTestIgnored(description);
+ notifier.fireTestFinished(description);
+ return;
+ }
+
+ TeaVMTestTool tool = new TeaVMTestTool();
+ tool.setTargetDirectory(new File(targetPath, testClass.getName()));
+ tool.setMinifying(false);
+ tool.getTestClasses().add(testClass.getName());
+ boolean success = true;
+ try {
+ tool.generate();
+ } catch (Exception e) {
+ notifier.fireTestFailure(new Failure(description, e));
+ success = false;
+ }
+
+ if (success) {
+ for (Description testDescription : description.getChildren()) {
+ notifier.fireTestStarted(testDescription);
+ notifier.fireTestFinished(testDescription);
+ }
+ }
+
+ notifier.fireTestFinished(description);
+ }
+}
diff --git a/tools/junit/teavm-junit.iml b/tools/junit/teavm-junit.iml
new file mode 100644
index 000000000..70adf675b
--- /dev/null
+++ b/tools/junit/teavm-junit.iml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file