From 2b3cba69bc2b9308eb468fed3a97532ac89a577b Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 23 Feb 2016 18:46:32 +0300 Subject: [PATCH] Run JUnit tests via JUnit runner instead of Maven plugin --- .idea/compiler.xml | 2 + .idea/encodings.xml | 1 + .idea/modules.xml | 2 + .idea/runConfigurations/run_tests.xml | 29 +++++++ all-deps/all-deps.iml | 25 ++++++ core/pom.xml | 6 +- pom.xml | 1 + tests/pom.xml | 6 ++ .../java/io/BufferedInputStreamTest.java | 17 +--- .../classlib/java/io/BufferedReaderTest.java | 3 + .../java/io/InputStreamReaderTest.java | 7 +- .../java/io/OutputStreamWriterTest.java | 3 + .../java/io/PushbackInputStreamTest.java | 3 + .../teavm/classlib/java/lang/BooleanTest.java | 7 +- .../classlib/java/lang/CharacterTest.java | 7 +- .../classlib/java/lang/ClassLoaderTest.java | 7 +- .../teavm/classlib/java/lang/ClassTest.java | 7 +- .../teavm/classlib/java/lang/DoubleTest.java | 7 +- .../teavm/classlib/java/lang/EnumTest.java | 7 +- .../teavm/classlib/java/lang/FloatTest.java | 7 +- .../teavm/classlib/java/lang/IntegerTest.java | 7 +- .../teavm/classlib/java/lang/LambdaTest.java | 7 +- .../teavm/classlib/java/lang/MathTest.java | 7 +- .../teavm/classlib/java/lang/ObjectTest.java | 7 +- .../classlib/java/lang/StringBuilderTest.java | 7 +- .../teavm/classlib/java/lang/StringTest.java | 7 +- .../teavm/classlib/java/lang/SystemTest.java | 7 +- .../teavm/classlib/java/lang/TestObject.java | 4 - .../java/lang/TestResourcesSupplier.java | 4 - .../org/teavm/classlib/java/lang/VMTest.java | 4 + .../classlib/java/lang/reflect/ArrayTest.java | 7 +- .../java/math/BigDecimalArithmeticTest.java | 7 +- .../java/math/BigDecimalCompareTest.java | 8 +- .../java/math/BigDecimalConstructorsTest.java | 7 +- .../java/math/BigDecimalConvertTest.java | 8 +- .../math/BigDecimalScaleOperationsTest.java | 7 +- .../classlib/java/math/BigIntegerAddTest.java | 7 +- .../classlib/java/math/BigIntegerAndTest.java | 7 +- .../java/math/BigIntegerCompareTest.java | 7 +- .../java/math/BigIntegerConstructorsTest.java | 8 +- .../java/math/BigIntegerConvertTest.java | 8 +- .../java/math/BigIntegerDivideTest.java | 7 +- .../java/math/BigIntegerHashCodeTest.java | 7 +- .../java/math/BigIntegerModPowTest.java | 6 +- .../java/math/BigIntegerMultiplyTest.java | 7 +- .../classlib/java/math/BigIntegerNotTest.java | 7 +- .../java/math/BigIntegerOperateBitsTest.java | 8 +- .../classlib/java/math/BigIntegerOrTest.java | 7 +- .../java/math/BigIntegerSubtractTest.java | 7 +- .../java/math/BigIntegerToStringTest.java | 7 +- .../classlib/java/math/BigIntegerXorTest.java | 7 +- .../classlib/java/nio/ByteBufferTest.java | 7 +- .../java/nio/ByteBufferWrapperTest.java | 7 +- .../classlib/java/nio/CharBufferTest.java | 7 +- .../classlib/java/nio/DoubleBufferTest.java | 7 +- .../classlib/java/nio/FloatBufferTest.java | 7 +- .../classlib/java/nio/IntBufferTest.java | 7 +- .../classlib/java/nio/LongBufferTest.java | 7 +- .../classlib/java/nio/ShortBufferTest.java | 7 +- .../classlib/java/nio/charset/UTF8Test.java | 7 +- .../classlib/java/text/DateFormatTest.java | 7 +- .../java/text/DecimalFormatParseTest.java | 7 +- .../classlib/java/text/DecimalFormatTest.java | 7 +- .../classlib/java/text/NumberFormatTest.java | 7 +- .../java/text/SimpleDateFormatTest.java | 7 +- .../classlib/java/util/ArrayDequeTest.java | 7 +- .../classlib/java/util/ArrayListTest.java | 7 +- .../teavm/classlib/java/util/ArraysTest.java | 7 +- .../teavm/classlib/java/util/BitSetTest.java | 3 + .../classlib/java/util/CalendarTest.java | 7 +- .../classlib/java/util/CollectionsTest.java | 7 +- .../classlib/java/util/CurrencyTest.java | 7 +- .../teavm/classlib/java/util/DateTest.java | 7 +- .../classlib/java/util/HashtableTest.java | 3 + .../classlib/java/util/LinkedHashMapTest.java | 6 +- .../classlib/java/util/LinkedListTest.java | 7 +- .../teavm/classlib/java/util/LocaleTest.java | 7 +- .../classlib/java/util/PriorityQueueTest.java | 7 +- .../classlib/java/util/ServiceLoaderTest.java | 7 +- .../java/util/StringTokenizerTest.java | 3 + .../teavm/classlib/java/util/TestService.java | 4 + .../classlib/java/util/TestServiceImpl.java | 4 + .../classlib/java/util/TimeZoneTest.java | 3 + .../teavm/classlib/java/util/TreeMapTest.java | 3 + .../teavm/classlib/java/util/VectorTest.java | 3 + .../java/util/regex/Matcher2Test.java | 6 +- .../classlib/java/util/regex/MatcherTest.java | 4 +- .../classlib/java/util/regex/ModeTest.java | 3 + .../java/util/regex/Pattern2Test.java | 3 + .../java/util/regex/PatternErrorTest.java | 3 + .../regex/PatternSyntaxExceptionTest.java | 4 +- .../classlib/java/util/regex/PatternTest.java | 3 + .../classlib/java/util/regex/ReplaceTest.java | 3 + .../classlib/java/util/regex/SplitTest.java | 3 + .../java/util/zip/GZIPInputStreamTest.java | 3 + .../org/teavm/jso/test/AnnotationsTest.java | 9 +- .../org/teavm/jso/test/ConversionTest.java | 9 +- .../java/org/teavm/jso/test/FunctorTest.java | 9 +- .../teavm/jso/test/ImplementationTest.java | 3 + .../teavm/jso/test/JavaInvocationTest.java | 9 +- .../metadata/MetadataGeneratorTest.java | 3 + .../test/java/org/teavm/tests/JSOTest.java | 3 + tests/teavm-tests.iml | 1 + tools/junit/pom.xml | 62 +++++++++++++ .../java/org/teavm/junit/TeaVMTestRunner.java | 87 +++++++++++++++++++ tools/junit/teavm-junit.iml | 23 +++++ 106 files changed, 525 insertions(+), 301 deletions(-) create mode 100644 .idea/runConfigurations/run_tests.xml create mode 100644 all-deps/all-deps.iml rename {jso/apis => tests}/src/test/java/org/teavm/jso/test/AnnotationsTest.java (96%) rename {jso/apis => tests}/src/test/java/org/teavm/jso/test/ConversionTest.java (98%) rename {jso/apis => tests}/src/test/java/org/teavm/jso/test/FunctorTest.java (91%) rename {jso/apis => tests}/src/test/java/org/teavm/jso/test/JavaInvocationTest.java (92%) create mode 100644 tools/junit/pom.xml create mode 100644 tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java create mode 100644 tools/junit/teavm-junit.iml 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 hm; diff --git a/tests/src/test/java/org/teavm/classlib/java/util/LinkedListTest.java b/tests/src/test/java/org/teavm/classlib/java/util/LinkedListTest.java index 9e69bb374..5f6e4dcb0 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/LinkedListTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/LinkedListTest.java @@ -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() { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/LocaleTest.java b/tests/src/test/java/org/teavm/classlib/java/util/LocaleTest.java index 192402fb2..b7c2b2b74 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/LocaleTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/LocaleTest.java @@ -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() { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/PriorityQueueTest.java b/tests/src/test/java/org/teavm/classlib/java/util/PriorityQueueTest.java index 2e8f54d92..e576fa474 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/PriorityQueueTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/PriorityQueueTest.java @@ -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() { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/ServiceLoaderTest.java b/tests/src/test/java/org/teavm/classlib/java/util/ServiceLoaderTest.java index 3c9d9ec71..dbfd49d09 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/ServiceLoaderTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/ServiceLoaderTest.java @@ -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() { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/StringTokenizerTest.java b/tests/src/test/java/org/teavm/classlib/java/util/StringTokenizerTest.java index 46ad0a6d4..2bf80bb65 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/StringTokenizerTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/StringTokenizerTest.java @@ -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() { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/TestService.java b/tests/src/test/java/org/teavm/classlib/java/util/TestService.java index 325e65f84..ac31722a0 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/TestService.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/TestService.java @@ -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(); } diff --git a/tests/src/test/java/org/teavm/classlib/java/util/TestServiceImpl.java b/tests/src/test/java/org/teavm/classlib/java/util/TestServiceImpl.java index 84cf4835f..33f117ae2 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/TestServiceImpl.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/TestServiceImpl.java @@ -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; diff --git a/tests/src/test/java/org/teavm/classlib/java/util/TimeZoneTest.java b/tests/src/test/java/org/teavm/classlib/java/util/TimeZoneTest.java index 298d5a994..664a85fe1 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/TimeZoneTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/TimeZoneTest.java @@ -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; diff --git a/tests/src/test/java/org/teavm/classlib/java/util/TreeMapTest.java b/tests/src/test/java/org/teavm/classlib/java/util/TreeMapTest.java index cbdfc741d..2dd551d61 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/TreeMapTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/TreeMapTest.java @@ -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 { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/VectorTest.java b/tests/src/test/java/org/teavm/classlib/java/util/VectorTest.java index 9be59abb9..4d736640b 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/VectorTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/VectorTest.java @@ -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 tVector = new Vector<>(); diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/Matcher2Test.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/Matcher2Test.java index 0f667948e..e39b4cbde 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/Matcher2Test.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/Matcher2Test.java @@ -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 diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/MatcherTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/MatcherTest.java index ce6fbbb48..207d041dc 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/MatcherTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/MatcherTest.java @@ -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", diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/ModeTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/ModeTest.java index 64e89f616..3b3735269 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/ModeTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/ModeTest.java @@ -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 { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/Pattern2Test.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/Pattern2Test.java index 9413c5d95..347634ba2 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/Pattern2Test.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/Pattern2Test.java @@ -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 { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternErrorTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternErrorTest.java index 79e905af7..87d5c602c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternErrorTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternErrorTest.java @@ -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 { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternSyntaxExceptionTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternSyntaxExceptionTest.java index 07ca674d5..fdf5e9867 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternSyntaxExceptionTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternSyntaxExceptionTest.java @@ -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() { diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternTest.java index 008f29a99..f463acb88 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternTest.java @@ -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", diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/ReplaceTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/ReplaceTest.java index 2f2e122e7..25c2e4a16 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/ReplaceTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/ReplaceTest.java @@ -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 diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/SplitTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/SplitTest.java index dbd335cb3..7459387d4 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/SplitTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/SplitTest.java @@ -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 diff --git a/tests/src/test/java/org/teavm/classlib/java/util/zip/GZIPInputStreamTest.java b/tests/src/test/java/org/teavm/classlib/java/util/zip/GZIPInputStreamTest.java index 98ee166c4..3fdd24efa 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/zip/GZIPInputStreamTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/zip/GZIPInputStreamTest.java @@ -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 { diff --git a/jso/apis/src/test/java/org/teavm/jso/test/AnnotationsTest.java b/tests/src/test/java/org/teavm/jso/test/AnnotationsTest.java similarity index 96% rename from jso/apis/src/test/java/org/teavm/jso/test/AnnotationsTest.java rename to tests/src/test/java/org/teavm/jso/test/AnnotationsTest.java index b87aa4979..9916d3089 100644 --- a/jso/apis/src/test/java/org/teavm/jso/test/AnnotationsTest.java +++ b/tests/src/test/java/org/teavm/jso/test/AnnotationsTest.java @@ -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() { diff --git a/jso/apis/src/test/java/org/teavm/jso/test/ConversionTest.java b/tests/src/test/java/org/teavm/jso/test/ConversionTest.java similarity index 98% rename from jso/apis/src/test/java/org/teavm/jso/test/ConversionTest.java rename to tests/src/test/java/org/teavm/jso/test/ConversionTest.java index 1e67e2cae..8a806a291 100644 --- a/jso/apis/src/test/java/org/teavm/jso/test/ConversionTest.java +++ b/tests/src/test/java/org/teavm/jso/test/ConversionTest.java @@ -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() { diff --git a/jso/apis/src/test/java/org/teavm/jso/test/FunctorTest.java b/tests/src/test/java/org/teavm/jso/test/FunctorTest.java similarity index 91% rename from jso/apis/src/test/java/org/teavm/jso/test/FunctorTest.java rename to tests/src/test/java/org/teavm/jso/test/FunctorTest.java index 1335ae741..423260bb5 100644 --- a/jso/apis/src/test/java/org/teavm/jso/test/FunctorTest.java +++ b/tests/src/test/java/org/teavm/jso/test/FunctorTest.java @@ -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() { diff --git a/tests/src/test/java/org/teavm/jso/test/ImplementationTest.java b/tests/src/test/java/org/teavm/jso/test/ImplementationTest.java index f8ea5b1e1..26c10e79c 100644 --- a/tests/src/test/java/org/teavm/jso/test/ImplementationTest.java +++ b/tests/src/test/java/org/teavm/jso/test/ImplementationTest.java @@ -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() { diff --git a/jso/apis/src/test/java/org/teavm/jso/test/JavaInvocationTest.java b/tests/src/test/java/org/teavm/jso/test/JavaInvocationTest.java similarity index 92% rename from jso/apis/src/test/java/org/teavm/jso/test/JavaInvocationTest.java rename to tests/src/test/java/org/teavm/jso/test/JavaInvocationTest.java index b4ea62c14..1aa080992 100644 --- a/jso/apis/src/test/java/org/teavm/jso/test/JavaInvocationTest.java +++ b/tests/src/test/java/org/teavm/jso/test/JavaInvocationTest.java @@ -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() { diff --git a/tests/src/test/java/org/teavm/platform/metadata/MetadataGeneratorTest.java b/tests/src/test/java/org/teavm/platform/metadata/MetadataGeneratorTest.java index ec59b1299..49e4fee5c 100644 --- a/tests/src/test/java/org/teavm/platform/metadata/MetadataGeneratorTest.java +++ b/tests/src/test/java/org/teavm/platform/metadata/MetadataGeneratorTest.java @@ -17,11 +17,14 @@ package org.teavm.platform.metadata; 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 MetadataGeneratorTest { @MetadataProvider(TestResourceGenerator.class) private native TestResource getNull(); diff --git a/tests/src/test/java/org/teavm/tests/JSOTest.java b/tests/src/test/java/org/teavm/tests/JSOTest.java index 3c79555b3..b68154eab 100644 --- a/tests/src/test/java/org/teavm/tests/JSOTest.java +++ b/tests/src/test/java/org/teavm/tests/JSOTest.java @@ -19,8 +19,10 @@ import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import java.util.List; import org.junit.Test; +import org.junit.runner.RunWith; import org.teavm.diagnostics.Problem; import org.teavm.jso.JSBody; +import org.teavm.junit.TeaVMTestRunner; import org.teavm.model.MethodReference; import org.teavm.model.ValueType; import org.teavm.vm.TeaVM; @@ -30,6 +32,7 @@ import org.teavm.vm.TeaVMBuilder; * * @author Alexey Andreev */ +@RunWith(TeaVMTestRunner.class) public class JSOTest { @Test public void reportsAboutWrongParameterOfJSBody() { diff --git a/tests/teavm-tests.iml b/tests/teavm-tests.iml index 41b767a04..ee1b398d9 100644 --- a/tests/teavm-tests.iml +++ b/tests/teavm-tests.iml @@ -29,5 +29,6 @@ + \ 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