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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,6 @@ import java.util.HashMap;
import java.util.Map;
import net.java.html.BrwsrCtx;
import net.java.html.js.JavaScriptBody;
import org.junit.Ignore;
import org.netbeans.html.context.spi.Contexts;
import org.netbeans.html.json.spi.JSONCall;
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.dom.html.HTMLDocument;
import org.teavm.jso.dom.html.HTMLElement;
import org.teavm.junit.WholeClassCompilation;
/**
*
* @author Jaroslav Tulach <jtulach@netbeans.org>
*/
@WholeClassCompilation
@Ignore
public final class KnockoutFXTest extends KnockoutTCK implements Transfer, WSTransfer<WSImpl> {
private KO4J ko4j = new KO4J();
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.fail;
import java.lang.reflect.Method;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.netbeans.html.json.tck.KOTest;
import org.teavm.junit.SkipJVM;
import org.teavm.junit.TeaVMTestRunner;
/**
*
* @author Jaroslav Tulach
*/
@Ignore
@RunWith(TeaVMTestRunner.class)
@SkipJVM
public class KnockoutTCKCheckTest {
@Test
public void allKnockoutTestMethodsOverriden() throws Exception {
public void allKnockoutTestMethodsOverridden() {
for (Class<?> c : KnockoutFXTest.allTestClasses()) {
if (c.getName().contains("GC")) {
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.OperationsTest;
import net.java.html.json.tests.WebSocketTest;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.teavm.junit.SkipJVM;
@ -35,8 +34,6 @@ import org.teavm.junit.WholeClassCompilation;
@RunWith(TeaVMTestRunner.class)
@SkipJVM
@WholeClassCompilation
@Ignore
// TODO: fix JavaScriptBody implementation and unignore
public class KnockoutTCKTest {
private final ConvertTypesTest convertTypesTest = new ConvertTypesTest();
private final JSONTest jsonTest = new JSONTest();