How to unit test Java code that is expected to run within an applet Security Manager

北战南征 提交于 2019-12-05 21:37:11

Not a solution as such, but couldn't you implement your own subclass of SecurityManager, perhaps delegating all calls to a 'pseudo security manager' which would in turn be mocked by EasyMock/similar? You could then set this SecurityManager using System.setSecurityManager().

Provided you know what your applet should be able to do, you can then fail the test depending on your requirements.

I may have missed what you want to achieve, but that seems like one possible approach.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!