html4j: fix and unignore tests

This commit is contained in:
Alexey Andreev 2021-03-18 10:30:33 +03:00
parent adba541a15
commit 14c05954b0
7 changed files with 18 additions and 23 deletions

View File

@ -17,7 +17,6 @@ package org.teavm.html4j.test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import net.java.html.js.JavaScriptBody; import net.java.html.js.JavaScriptBody;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.teavm.junit.SkipJVM; import org.teavm.junit.SkipJVM;
@ -25,7 +24,6 @@ import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class) @RunWith(TeaVMTestRunner.class)
@SkipJVM @SkipJVM
@Ignore
public class JavaScriptBodyConversionTest { public class JavaScriptBodyConversionTest {
@Test @Test
public void convertsInteger() { public void convertsInteger() {
@ -60,9 +58,9 @@ public class JavaScriptBodyConversionTest {
@Test @Test
public void copiesArray() { public void copiesArray() {
Integer[] array = { 23, 42 }; Integer[] array = { 23, 42 };
Integer[] arrayCopy = (Integer[]) modifyIntegerArray(array); Object[] arrayCopy = (Object[]) modifyIntegerArray(array);
assertEquals(Integer.valueOf(23), array[0]); assertEquals(Integer.valueOf(23), array[0]);
assertEquals(Integer.valueOf(1), arrayCopy[0]); assertEquals(1, arrayCopy[0]);
} }
@Test @Test

View File

@ -17,12 +17,12 @@ package org.teavm.html4j.test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import net.java.html.js.JavaScriptBody; import net.java.html.js.JavaScriptBody;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.teavm.junit.SkipJVM; import org.teavm.junit.SkipJVM;
@ -30,7 +30,6 @@ import org.teavm.junit.TeaVMTestRunner;
@RunWith(TeaVMTestRunner.class) @RunWith(TeaVMTestRunner.class)
@SkipJVM @SkipJVM
@Ignore
public class JavaScriptBodyTest { public class JavaScriptBodyTest {
@Test @Test
public void readResource() throws IOException { public void readResource() throws IOException {
@ -63,8 +62,9 @@ public class JavaScriptBodyTest {
@Test @Test
public void dependencyPropagatedThroughArray() { public void dependencyPropagatedThroughArray() {
storeObject(new Object[] { new AImpl() }); storeObject(new Object[] { new AImpl() });
A[] array = (A[]) retrieveObject(); Object[] array = (Object[]) retrieveObject();
assertEquals(23, array[0].foo()); assertTrue(array[0] instanceof A);
assertEquals(23, ((A) array[0]).foo());
} }
@Test @Test

View File

@ -18,19 +18,22 @@ package org.teavm.html4j.test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.netbeans.html.json.tck.JavaScriptTCK; import org.netbeans.html.json.tck.JavaScriptTCK;
import org.netbeans.html.json.tck.KOTest; import org.netbeans.html.json.tck.KOTest;
import org.teavm.junit.SkipJVM;
import org.teavm.junit.TeaVMTestRunner;
/** /**
* *
* @author Jaroslav Tulach * @author Jaroslav Tulach
*/ */
@Ignore @RunWith(TeaVMTestRunner.class)
@SkipJVM
public class JavaScriptTCKCheckTest extends JavaScriptTCK { public class JavaScriptTCKCheckTest extends JavaScriptTCK {
@Test @Test
public void allJavaScriptBodyTestMethodsOverriden() throws Exception { public void allJavaScriptBodyTestMethodsOverridden() throws Exception {
for (Class<?> c : testClasses()) { for (Class<?> c : testClasses()) {
if (c.getName().contains("GC")) { if (c.getName().contains("GC")) {
continue; continue;

View File

@ -16,7 +16,6 @@
package org.teavm.html4j.test; package org.teavm.html4j.test;
import net.java.html.js.tests.JavaScriptBodyTest; import net.java.html.js.tests.JavaScriptBodyTest;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.teavm.junit.SkipJVM; import org.teavm.junit.SkipJVM;
@ -28,7 +27,6 @@ import org.teavm.junit.TeaVMTestRunner;
*/ */
@RunWith(TeaVMTestRunner.class) @RunWith(TeaVMTestRunner.class)
@SkipJVM @SkipJVM
@Ignore
public class JavaScriptTCKTest extends JavaScriptBodyTest { public class JavaScriptTCKTest extends JavaScriptBodyTest {
@Test @Override @Test @Override

View File

@ -24,7 +24,6 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.java.html.BrwsrCtx; import net.java.html.BrwsrCtx;
import net.java.html.js.JavaScriptBody; import net.java.html.js.JavaScriptBody;
import org.junit.Ignore;
import org.netbeans.html.context.spi.Contexts; import org.netbeans.html.context.spi.Contexts;
import org.netbeans.html.json.spi.JSONCall; import org.netbeans.html.json.spi.JSONCall;
import org.netbeans.html.json.spi.Technology; import org.netbeans.html.json.spi.Technology;
@ -38,14 +37,11 @@ import org.teavm.jso.JSObject;
import org.teavm.jso.browser.Window; import org.teavm.jso.browser.Window;
import org.teavm.jso.dom.html.HTMLDocument; import org.teavm.jso.dom.html.HTMLDocument;
import org.teavm.jso.dom.html.HTMLElement; import org.teavm.jso.dom.html.HTMLElement;
import org.teavm.junit.WholeClassCompilation;
/** /**
* *
* @author Jaroslav Tulach <jtulach@netbeans.org> * @author Jaroslav Tulach <jtulach@netbeans.org>
*/ */
@WholeClassCompilation
@Ignore
public final class KnockoutFXTest extends KnockoutTCK implements Transfer, WSTransfer<WSImpl> { public final class KnockoutFXTest extends KnockoutTCK implements Transfer, WSTransfer<WSImpl> {
private KO4J ko4j = new KO4J(); private KO4J ko4j = new KO4J();
private final Map<String, Request> urlMap = new HashMap<>(); private final Map<String, Request> urlMap = new HashMap<>();

View File

@ -19,18 +19,21 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.netbeans.html.json.tck.KOTest; import org.netbeans.html.json.tck.KOTest;
import org.teavm.junit.SkipJVM;
import org.teavm.junit.TeaVMTestRunner;
/** /**
* *
* @author Jaroslav Tulach * @author Jaroslav Tulach
*/ */
@Ignore @RunWith(TeaVMTestRunner.class)
@SkipJVM
public class KnockoutTCKCheckTest { public class KnockoutTCKCheckTest {
@Test @Test
public void allKnockoutTestMethodsOverriden() throws Exception { public void allKnockoutTestMethodsOverridden() {
for (Class<?> c : KnockoutFXTest.allTestClasses()) { for (Class<?> c : KnockoutFXTest.allTestClasses()) {
if (c.getName().contains("GC")) { if (c.getName().contains("GC")) {
continue; continue;

View File

@ -21,7 +21,6 @@ import net.java.html.json.tests.KnockoutTest;
import net.java.html.json.tests.MinesTest; import net.java.html.json.tests.MinesTest;
import net.java.html.json.tests.OperationsTest; import net.java.html.json.tests.OperationsTest;
import net.java.html.json.tests.WebSocketTest; import net.java.html.json.tests.WebSocketTest;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.teavm.junit.SkipJVM; import org.teavm.junit.SkipJVM;
@ -35,8 +34,6 @@ import org.teavm.junit.WholeClassCompilation;
@RunWith(TeaVMTestRunner.class) @RunWith(TeaVMTestRunner.class)
@SkipJVM @SkipJVM
@WholeClassCompilation @WholeClassCompilation
@Ignore
// TODO: fix JavaScriptBody implementation and unignore
public class KnockoutTCKTest { public class KnockoutTCKTest {
private final ConvertTypesTest convertTypesTest = new ConvertTypesTest(); private final ConvertTypesTest convertTypesTest = new ConvertTypesTest();
private final JSONTest jsonTest = new JSONTest(); private final JSONTest jsonTest = new JSONTest();