vm/src/test/java/org/apidesign/vm4brwsr/StaticMethodTest.java
changeset 248 0bfcb6585290
parent 205 0256fac49ea5
child 274 81f6e7778135
child 291 c6f21b56a6cf
     1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/StaticMethodTest.java	Mon Nov 26 20:29:21 2012 +0100
     1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/StaticMethodTest.java	Tue Dec 04 09:16:53 2012 +0100
     1.3 @@ -36,7 +36,7 @@
     1.4      @Test public void threePlusFour() throws Exception {
     1.5          assertExec(
     1.6              "Should be seven", 
     1.7 -            StaticMethod.class, "sumIII", 
     1.8 +            StaticMethod.class, "sum__III", 
     1.9              Double.valueOf(7), 
    1.10              3, 4
    1.11          );
    1.12 @@ -45,7 +45,7 @@
    1.13      @Test public void checkReallyInitializedValues() throws Exception {
    1.14          assertExec(
    1.15              "Return true", 
    1.16 -            StaticMethod.class, "isNullZ", 
    1.17 +            StaticMethod.class, "isNull__Z", 
    1.18              Double.valueOf(1)
    1.19          );
    1.20      }
    1.21 @@ -53,7 +53,7 @@
    1.22      @Test public void powerOfThree() throws Exception {
    1.23          assertExec(
    1.24              "Should be nine", 
    1.25 -            StaticMethod.class, "powerFF", 
    1.26 +            StaticMethod.class, "power__FF", 
    1.27              Double.valueOf(9),
    1.28              3.0f
    1.29          );
    1.30 @@ -62,7 +62,7 @@
    1.31      @Test public void minusOne() throws Exception {
    1.32          assertExec(
    1.33              "Should be minus one", 
    1.34 -            StaticMethod.class, "minusOneI", 
    1.35 +            StaticMethod.class, "minusOne__I", 
    1.36              Double.valueOf(-1)
    1.37          );
    1.38      }
    1.39 @@ -70,7 +70,7 @@
    1.40      @Test public void doubleWithoutLong() throws Exception {
    1.41          assertExec(
    1.42              "Should be two",
    1.43 -            StaticMethod.class, "minusDDJ", 
    1.44 +            StaticMethod.class, "minus__DDJ", 
    1.45              Double.valueOf(2),
    1.46              3.0d, 1l
    1.47          );
    1.48 @@ -79,7 +79,7 @@
    1.49      @Test public void divAndRound() throws Exception {
    1.50          assertExec(
    1.51              "Should be rounded to one",
    1.52 -            StaticMethod.class, "divIBD", 
    1.53 +            StaticMethod.class, "div__IBD", 
    1.54              Double.valueOf(1),
    1.55              3, 3.75
    1.56          );
    1.57 @@ -87,7 +87,7 @@
    1.58      @Test public void mixedMethodFourParams() throws Exception {
    1.59          assertExec(
    1.60              "Should be two",
    1.61 -            StaticMethod.class, "mixIIJBD", 
    1.62 +            StaticMethod.class, "mix__IIJBD", 
    1.63              Double.valueOf(20),
    1.64              2, 10l, 5, 2.0
    1.65          );
    1.66 @@ -95,7 +95,7 @@
    1.67      @Test public void factRec() throws Exception {
    1.68          assertExec(
    1.69              "Factorial of 5 is 120",
    1.70 -            StaticMethod.class, "factRecJI", 
    1.71 +            StaticMethod.class, "factRec__JI", 
    1.72              Double.valueOf(120),
    1.73              5
    1.74          );
    1.75 @@ -103,7 +103,7 @@
    1.76      @Test public void factIter() throws Exception {
    1.77          assertExec(
    1.78              "Factorial of 5 is 120",
    1.79 -            StaticMethod.class, "factIterJI", 
    1.80 +            StaticMethod.class, "factIter__JI", 
    1.81              Double.valueOf(120),
    1.82              5
    1.83          );
    1.84 @@ -112,7 +112,7 @@
    1.85      @Test public void xor() throws Exception {
    1.86          assertExec(
    1.87              "Xor is 4",
    1.88 -            StaticMethod.class, "xorJIJ",
    1.89 +            StaticMethod.class, "xor__JIJ",
    1.90              Double.valueOf(4),
    1.91              7,
    1.92              3
    1.93 @@ -122,7 +122,7 @@
    1.94      @Test public void or() throws Exception {
    1.95          assertExec(
    1.96              "Or will be 7",
    1.97 -            StaticMethod.class, "orOrAndJZII",
    1.98 +            StaticMethod.class, "orOrAnd__JZII",
    1.99              Double.valueOf(7),
   1.100              true,
   1.101              4,
   1.102 @@ -132,14 +132,14 @@
   1.103      @Test public void nullCheck() throws Exception {
   1.104          assertExec(
   1.105              "Returns nothing",
   1.106 -            StaticMethod.class, "noneLjava_lang_ObjectII",
   1.107 +            StaticMethod.class, "none__Ljava_lang_Object_2II",
   1.108              null, 1, 3
   1.109          );
   1.110      }
   1.111      @Test public void and() throws Exception {
   1.112          assertExec(
   1.113              "And will be 3",
   1.114 -            StaticMethod.class, "orOrAndJZII",
   1.115 +            StaticMethod.class, "orOrAnd__JZII",
   1.116              Double.valueOf(3),
   1.117              false,
   1.118              7,
   1.119 @@ -149,7 +149,7 @@
   1.120      @Test public void inc4() throws Exception {
   1.121          assertExec(
   1.122              "It will be 4",
   1.123 -            StaticMethod.class, "inc4I",
   1.124 +            StaticMethod.class, "inc4__I",
   1.125              Double.valueOf(4)
   1.126          );
   1.127      }
   1.128 @@ -162,7 +162,7 @@
   1.129      @Test public void shiftLeftInJS() throws Exception {
   1.130          assertExec(
   1.131              "Setting 9th bit",
   1.132 -            StaticMethod.class, "shiftLeftIII",
   1.133 +            StaticMethod.class, "shiftLeft__III",
   1.134              Double.valueOf(256),
   1.135              1, 8
   1.136          );
   1.137 @@ -176,7 +176,7 @@
   1.138      @Test public void shiftRightInJS() throws Exception {
   1.139          assertExec(
   1.140              "Get -1",
   1.141 -            StaticMethod.class, "shiftArithmRightIIIZ",
   1.142 +            StaticMethod.class, "shiftArithmRight__IIIZ",
   1.143              Double.valueOf(-1),
   1.144              -8, 3, true
   1.145          );
   1.146 @@ -189,7 +189,7 @@
   1.147      @Test public void unsignedShiftRightInJS() throws Exception {
   1.148          assertExec(
   1.149              "Get -1",
   1.150 -            StaticMethod.class, "shiftArithmRightIIIZ",
   1.151 +            StaticMethod.class, "shiftArithmRight__IIIZ",
   1.152              Double.valueOf(1),
   1.153              8, 3, false
   1.154          );
   1.155 @@ -198,7 +198,7 @@
   1.156      @Test public void javaScriptBody() throws Exception {
   1.157          assertExec(
   1.158              "JavaScript string",
   1.159 -            StaticMethod.class, "i2sLjava_lang_StringII",
   1.160 +            StaticMethod.class, "i2s__Ljava_lang_String_2II",
   1.161              "333",
   1.162              330, 3
   1.163          );
   1.164 @@ -207,7 +207,7 @@
   1.165      @Test public void switchJarda() throws Exception {
   1.166          assertExec(
   1.167              "The expected value",
   1.168 -            StaticMethod.class, "swtchLjava_lang_StringI",
   1.169 +            StaticMethod.class, "swtch__Ljava_lang_String_2I",
   1.170              "Jarda",
   1.171              0
   1.172          );
   1.173 @@ -216,7 +216,7 @@
   1.174      @Test public void switchDarda() throws Exception {
   1.175          assertExec(
   1.176              "The expected value",
   1.177 -            StaticMethod.class, "swtchLjava_lang_StringI",
   1.178 +            StaticMethod.class, "swtch__Ljava_lang_String_2I",
   1.179              "Darda",
   1.180              1
   1.181          );
   1.182 @@ -224,7 +224,7 @@
   1.183      @Test public void switchParda() throws Exception {
   1.184          assertExec(
   1.185              "The expected value",
   1.186 -            StaticMethod.class, "swtch2Ljava_lang_StringI",
   1.187 +            StaticMethod.class, "swtch2__Ljava_lang_String_2I",
   1.188              "Parda",
   1.189              22
   1.190          );
   1.191 @@ -232,7 +232,7 @@
   1.192      @Test public void switchMarda() throws Exception {
   1.193          assertExec(
   1.194              "The expected value",
   1.195 -            StaticMethod.class, "swtchLjava_lang_StringI",
   1.196 +            StaticMethod.class, "swtch__Ljava_lang_String_2I",
   1.197              "Marda",
   1.198              -433
   1.199          );