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
|
#!/bin/java bsh.Interpreter
source("TestHarness.bsh");
import bsh.*;
if ( Capabilities.canGenerateInterfaces() )
{
i=new Interpreter();
r=i.eval(
"return new Runnable() {"
+"void run() { throw new EvalError(\"foo\"); } }");
try {
r.run();
} catch ( e ) {
super.ue=e;
assert( e instanceof java.lang.reflect.UndeclaredThrowableException );
}
}
/*
make sure it properly prints the nested exception...
import bsh.TargetError;
te=new TargetError( "undec throw", ue );
print(te);
*/
complete();
|