Menu

[r805]: / trunk / php-java-bridge / tests.php5 / java_require.php  Maximize  Restore  History

Download this file

38 lines (31 with data), 701 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/php
<?php
require_once ("java/Java.inc");
$here=realpath(dirname($_SERVER["SCRIPT_FILENAME"]));
if(!$here) $here=getcwd();
//$s = new java("java.lang.String", "hello");
try {
java_require("$here/cachex.jar");
echo "test failed\n";
exit(1);
} catch (JavaException $ex) {
$IOException = new JavaClass("java.io.IOException");
$cause = $ex->getCause();
if(!java_instanceof($cause, $IOException)) {
echo "test failed\n";
exit(3);
}
} catch (Exception $e) {
echo "test failed: $e\n";
exit(2);
}
try {
java_require("$here/cache.jar");
} catch (Exception $ex) {
echo "test failed\n";
exit(4);
}
$Cache = new JavaClass("Cache");
echo "test okay\n";
exit(0);
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.