Re: Easiest test case

Mark Swanson <mark-e2GstmqqWGa5mcYau+xr2AC/[email protected]>
Newsgroups gmane.comp.java.beanshell.devel
Organization Web Service Solutions, Inc.
Message-ID <[email protected]>
Solved. The policy file MUST give read permissions to the bsh-2.0b1.jar file.

F.E.
// Change this to suite your local environment or jwsTest will not work.
permission java.io.FilePermission 
"/mnt/hda3/mswanson/downloads/java/beanshell/BeanShell/dist/bsh-2.0b1.jar", 
"read";

maintainers: please add the above 2 lines to the bsh.policy file.

Thanks.

On April 30, 2004 12:45 am, Mark Swanson wrote:
> OK, this test code prints "rats" every time (when run with the bsh.policy
> file).
>
> I think I need sleep, because I do stuff similar to this all of the time in
> JWS. F.E. in JWS I do getClass().getResource("/test.png")) and it works.
>
> I copied the policy statements line for line from the JWS dev guide. I
> don't know what I missed.
>
>
>     public static void main (String args[]) throws Exception {
>         JWSTest jwsTest = new JWSTest();
>         jwsTest.test();
>     }
>
>     void test() throws Exception {
>         InputStream is =
> this.getClass().getClassLoader().getResourceAsStream("/bsh/commands/printBa
>nner.bsh"); if (is == null) {
>             System.out.println("rats");
>             System.exit(-1);
>         }

-- 
VoIP SIP:[email protected]
Free calendar client and server - works with Exchange/Outlook/Yahoo!
TV-Listing and Weather Schedules
http://www.ScheduleWorld.com/
http://www.ScheduleWorld.com/sw/ScheduleWorld.jnlp (JWS)


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.