Fix JSO tests from previous commits

This commit is contained in:
Alexey Andreev 2017-05-31 22:52:34 +03:00
parent 933a5c3efc
commit ad14176277

View File

@ -43,22 +43,20 @@ public class FunctorTest {
@Test
public void functorWithDefaultMethodPassed() {
JSFunctionWithDefaultMethod javaFunction = (s) -> s + " returned";
String returned = javaFunction.defaultMethod();
assertEquals(returned, "Content returned");
assertEquals(123, callFunctionWithDefaultMethod(s -> s + 100));
}
@JSBody(params = "f", script = "return f(23);")
private static native int callFunctionWithDefaultMethod(JSFunctionWithDefaultMethod f);
@Test
public void functorWithStaticMethodPassed() {
JSFunctionWithStaticMethod javaFunction = (s) -> s + " returned";
String returned = javaFunction.apply(JSFunctionWithStaticMethod.staticMethod());
assertEquals(returned, "Content returned");
assertEquals(123, callFunctionWithStaticMethod(s -> s + 100));
}
@JSBody(params = "f", script = "return f(23);")
private static native int callFunctionWithStaticMethod(JSFunctionWithStaticMethod f);
@Test
public void propertyWithNonAlphabeticFirstChar() {
WithProperties wp = getWithPropertiesInstance();
@ -78,21 +76,21 @@ public class FunctorTest {
@JSFunctor
interface JSBiFunction extends JSObject {
int apply(int a, int b);
int foo(int a, int b);
}
@JSFunctor
interface JSFunctionWithDefaultMethod extends JSObject {
String apply(String a);
int foo(int a);
default String defaultMethod() {
return apply("Content");
return "Content";
}
}
@JSFunctor
interface JSFunctionWithStaticMethod extends JSObject {
String apply(String a);
int foo(int a);
static String staticMethod() {
return "Content";