1 # Before `make install' is performed this script should be runnable with
2 # `make test'. After `make install' it should work as `perl test.pl'
4 ######################### We start with some black magic to print on failure.
6 # Change 1..1 below to 1..last_test_to_print .
7 # (It may become useful if the test is moved to ./t subdirectory.)
9 BEGIN { $| = 1; print "1..3\n"; }
10 END {print "not ok 1\n" unless $loaded;}
15 ######################### End of black magic.
17 # Insert your test code below (better if it prints "ok 13"
18 # (correspondingly "not ok 13") depending on the success of chunk 13
21 # Simple StringBuffer test.
24 use JPL::Class 'java::lang::StringBuffer';
25 $sb = java::lang::StringBuffer->new__s("TEST");
26 if ($sb->toString____s() eq "TEST") {
32 # Put up a frame and let the user close it.
35 use JPL::Class 'java::awt::Frame';
36 use JPL::Class 'Closer';
38 $f = java::awt::Frame->new__s("Close Me, Please!");
39 my $setSize = getmeth("setSize", ["int", "int"], []);
40 my $addWindowListener = getmeth("addWindowListener",
41 ["java.awt.event.WindowListener"], []);
43 $f->$addWindowListener( new Closer );
44 $f->$setSize(200,200);
49 if (!$f->isVisible____Z) {