File: basic.bsh

package info (click to toggle)
bsh 1.1alpha5-1
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 2,336 kB
  • ctags: 2,083
  • sloc: java: 16,095; makefile: 134; sh: 51
file content (32 lines) | stat: -rw-r--r-- 847 bytes parent folder | download | duplicates (2)
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
#!/bin/java bsh.Interpreter

source("TestHarness.bsh");

java.lang.System.out.println("Basic print: passed");
System.out.println("Imported java.lang: passed");

System.out.println("print date:");
System.out.println( new java.util.Date() );
System.out.println("print var containing date:");
a = new java.util.Date();
System.out.println( a );

print("method access on var");
s = "failed pass failed";
assert( s.substring(7,11).equals("pass") );

System.out.println("static method access");
assert( System.currentTimeMillis() > 900000000000L );

System.out.println("static field access");
out = System.out;
assert( out instanceof PrintStream );

out.println("more field access:");
// note: this could conceivably change , but I doubt it
assert( java.awt.GridBagConstraints.BOTH == 1 );

assert( this == this );
assert( super == super );

complete();