1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/StringTest.java Wed Nov 21 21:48:51 2012 +0100
1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/StringTest.java Wed Nov 21 23:53:00 2012 +0100
1.3 @@ -117,6 +117,25 @@
1.4 );
1.5 }
1.6
1.7 + @Test public void compareHashCodeHi() throws Exception {
1.8 + String j = "Hi";
1.9 + int jh = StringSample.hashCode(j);
1.10 + assertExec(
1.11 + "Hashcode is the same " +jh,
1.12 + "org_apidesign_vm4brwsr_StringSample_hashCodeILjava_lang_String",
1.13 + Double.valueOf(jh), j
1.14 + );
1.15 + }
1.16 + @Test public void compareHashCode1() throws Exception {
1.17 + String j = "Hello Java!";
1.18 + int jh = StringSample.hashCode(j);
1.19 + assertExec(
1.20 + "Hashcode is the same " + jh,
1.21 + "org_apidesign_vm4brwsr_StringSample_hashCodeILjava_lang_String",
1.22 + Double.valueOf(jh), j
1.23 + );
1.24 + }
1.25 +
1.26 @Test public void countAB() throws Exception {
1.27 assertEquals(StringSample.countAB("Ahoj Bedo!"), 3, "Verify Java code is sane");
1.28 assertExec(
1.29 @@ -147,7 +166,7 @@
1.30 } catch (ScriptException ex) {
1.31 fail("Execution failed in\n" + StaticMethodTest.dumpJS(codeSeq), ex);
1.32 } catch (NoSuchMethodException ex) {
1.33 - fail("Cannot find method in\n" + codeSeq, ex);
1.34 + fail("Cannot find method in\n" + StaticMethodTest.dumpJS(codeSeq), ex);
1.35 }
1.36 if (ret == null && expRes == null) {
1.37 return;
1.38 @@ -155,7 +174,7 @@
1.39 if (expRes.equals(ret)) {
1.40 return;
1.41 }
1.42 - assertEquals(ret, expRes, msg + "was: " + ret + "\n" + codeSeq);
1.43 + assertEquals(ret, expRes, msg + "was: " + ret + "\n" + StaticMethodTest.dumpJS(codeSeq));
1.44
1.45 }
1.46