diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TClassTests.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ClassTests.java similarity index 97% rename from teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TClassTests.java rename to teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ClassTests.java index 6a8a88e06..75b79c960 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TClassTests.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ClassTests.java @@ -7,7 +7,7 @@ import org.junit.Test; * * @author Alexey Andreev */ -class TClassTests { +public class ClassTests { @Test public void classNameEvaluated() { assertEquals("java.lang.Object", Object.class.getName()); diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TObjectTests.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ObjectTests.java similarity index 97% rename from teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TObjectTests.java rename to teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ObjectTests.java index 12d0bd07f..b099399f3 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TObjectTests.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ObjectTests.java @@ -7,7 +7,7 @@ import org.junit.Test; * * @author Alexey Andreev */ -class TObjectTests { +public class ObjectTests { @Test public void objectCreated() { Object a = new Object(); diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TStringBuilderTests.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/StringBuilderTests.java similarity index 73% rename from teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TStringBuilderTests.java rename to teavm-classlib/src/main/java/org/teavm/classlib/java/lang/StringBuilderTests.java index c4b0a54c1..ea6e07815 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TStringBuilderTests.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/StringBuilderTests.java @@ -7,30 +7,30 @@ import org.junit.Test; * * @author Alexey Andreev */ -class TStringBuilderTests { +public class StringBuilderTests { public void integerAppended() { - TStringBuilder sb = new TStringBuilder(); + StringBuilder sb = new StringBuilder(); sb.append(23); assertEquals("23", sb.toString()); } @Test public void largeIntegerAppended() { - TStringBuilder sb = new TStringBuilder(); + StringBuilder sb = new StringBuilder(); sb.append(123456); assertEquals("123456", sb.toString()); } @Test public void negativeIntegerAppended() { - TStringBuilder sb = new TStringBuilder(); + StringBuilder sb = new StringBuilder(); sb.append(-23); assertEquals("-23", sb.toString()); } @Test public void maxIntegerAppended() { - TStringBuilder sb = new TStringBuilder(); + StringBuilder sb = new StringBuilder(); sb.append(2147483647); assertEquals("2147483647", sb.toString()); } diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TStringTests.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/StringTests.java similarity index 94% rename from teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TStringTests.java rename to teavm-classlib/src/main/java/org/teavm/classlib/java/lang/StringTests.java index bc7a58873..ae2b0a0ea 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TStringTests.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/StringTests.java @@ -7,7 +7,7 @@ import org.junit.Test; * * @author Alexey Andreev */ -class TStringTests { +public class StringTests { @Test public void charsExtracted() { String str = "123"; diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TSystemTests.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/SystemTests.java similarity index 55% rename from teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TSystemTests.java rename to teavm-classlib/src/main/java/org/teavm/classlib/java/lang/SystemTests.java index a5e3e484b..136c8f934 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TSystemTests.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/SystemTests.java @@ -7,14 +7,14 @@ import org.junit.Test; * * @author Alexey Andreev */ -class TSystemTests { +public class SystemTests { @Test public void copiesArray() { - TObject a = new TObject(); - TObject b = new TObject(); - TObject[] src = { a, b, a }; - TObject[] dest = new TObject[3]; - TSystem.arraycopy(TObject.wrap(src), 0, TObject.wrap(dest), 0, 3); + Object a = new Object(); + Object b = new Object(); + Object[] src = { a, b, a }; + Object[] dest = new Object[3]; + System.arraycopy(src, 0, dest, 0, 3); assertSame(a, dest[0]); assertSame(b, dest[1]); assertSame(a, dest[2]); @@ -22,21 +22,21 @@ class TSystemTests { @Test(expected = IndexOutOfBoundsException.class) public void failsToCopyArraysWithInvalidIndexes() { - TSystem.arraycopy(TObject.wrap(new TObject[0]), 0, TObject.wrap(new TObject[0]), 0, 1); + System.arraycopy(new Object[0], 0, new TObject[0], 0, 1); } @Test(expected = ArrayStoreException.class) public void failsToCopyArraysWithIncompatibleElements() { - TSystem.arraycopy(TObject.wrap(new TObject[1]), 0, TObject.wrap(new int[1]), 0, 1); + System.arraycopy(new Object[1], 0, new int[1], 0, 1); } @Test(expected = NullPointerException.class) public void failsToCopyFromNullSource() { - TSystem.arraycopy(null, 0, TObject.wrap(new int[1]), 0, 1); + System.arraycopy(null, 0, new int[1], 0, 1); } @Test(expected = NullPointerException.class) public void failsToCopyToNullTarget() { - TSystem.arraycopy(TObject.wrap(new TObject[1]), 0, null, 0, 1); + System.arraycopy(new TObject[1], 0, null, 0, 1); } } diff --git a/teavm-classlib/src/main/java/org/teavm/classlibgen/ClasslibTestGenerator.java b/teavm-classlib/src/main/java/org/teavm/classlibgen/ClasslibTestGenerator.java index 39df36501..abb20ff19 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlibgen/ClasslibTestGenerator.java +++ b/teavm-classlib/src/main/java/org/teavm/classlibgen/ClasslibTestGenerator.java @@ -46,6 +46,9 @@ public class ClasslibTestGenerator { writer = new SourceWriter(naming); renderer = new Renderer(writer, classSource); DependencyChecker dependencyChecker = new DependencyChecker(classSource); + for (int i = 0; i < testClasses.length; ++i) { + testClasses[i] = "org.teavm.classlib." + testClasses[i]; + } for (String testClass : testClasses) { ClassHolder classHolder = classSource.getClassHolder(testClass); findTests(classHolder);