connect(); // test static method call // test method call $oa[0] = "www.yahoo.com"; $ot[0] = "string"; $localhost = $client->staticMethodCall("java.net.InetAddress", "getByName", $oa, $ot); $addr = $client->methodCall($localhost, "getHostAddress", array()); if (substr($addr, 0, 4) == "204.") { echo "$addr - staticMethodCall Passed\n"; } else { echo "$addr - staticMethodCall Failed\n"; } // test get static field $jlit = $client->getStaticField("java.lang.Integer", "TYPE"); $to_string = $client->methodCall($jlit, "toString", array()); if ($to_string == "int") { echo "$to_string - getStaticField Passed\n"; } else { echo "$to_string - getStaticField Failed\n"; } // test get field // test new instance call $oa2[0] = "123"; $oa2[1] = "456"; $ot2[0] = "int"; $ot2[1] = "int"; $d = $client->newInstanceCall("java.awt.Dimension", $oa2, $ot2); $w = $client->getField($d, "width"); $h = $client->getField($d, "height"); if ($w == 123 && $h == 456) { echo "(123, 456) - getField Passed\n"; } else { echo "($w, $h) - getField Failed\n"; } // test reading in an array // TO DO: Add this test $client->disconnect(); ?>