I'm shooting from the hip here, not having looked at the code, so I might be off base.  But if I remember correctly, BeanShell does a kind of pseudo-compilation of functions, as opposed to evaluating statements outside of function blocks.  So with that in mind, it may be possible to write a tester that encloses the scripts in question in a special function and looking at the resulting instruction tree.

Frederic Tardif <frederic.tardif@gmail.com> wrote:
I have a bunch of beanshell and I would simply like to do a dummy junit test that "compile" each of them to ensure that they are valid.

Eval of the interpreter seems to do some syntaxic check but no real compilation verification.

Is there any way of doing this?

Any idea?

Thanks a lot -------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
Beanshell-users mailing list
Beanshell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/beanshell-users



Alexey
2001 Honda CBR600F4i (CCS)
1992 Kawasaki EX500
http://azinger.blogspot.com
http://bsheet.sourceforge.net
http://wcollage.sourceforge.net


Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.