title: How to unit test Java code that is expected to run within an applet Security Manager
body: <p>I have some Java library code which sometimes runs as an unsigned applet. Because of this it is not always allowed to do some operations (for instance checking for system properties).  </p>
  
  <p>I would like to run some unit tests with an Applet-like security manager so that I can verify that the code is either not performing any restricted operations, or correctly handling any security exceptions.</p>
  
  <p>What is the best way to run these unit-tests with a realistic Security-Manager configuration? Preferable the solution would be something that can integrate with JUnit.</p>