@Test public void shouldNotThrowSecurityExceptionWhenCalledBySystem() { try { securityManager.checkPermission( new FilePermission( "<<ALL FILES>>", "read,write,delete" ) ); securityManager.checkPermission( new FilePermission( System.getProperty( "user.home" ), "read,write,delete" ) ); securityManager.checkPermission( new FilePermission( System.getProperty( "java.home" ), "read,write,delete" ) ); securityManager.checkPermission( new RuntimePermission( "shutdownHooks" ) ); securityManager.checkPermission( new PropertyPermission( "java.home", "read" ) ); securityManager.checkPermission( new SocketPermission( "example.com", "connect" ) ); securityManager.checkPermission( new AllPermission() ); } catch ( SecurityException e ) { fail( e.getMessage() ); } }
@Override public void checkPermission( Permission perm, Object context ) { return; }
WebSpoonSecurityManager extends SecurityManager { @Override public void checkPermission( Permission perm, Object context ) { return; } }
WebSpoonSecurityManager extends SecurityManager { @Override public void checkPermission( Permission perm, Object context ) { return; } WebSpoonSecurityManager(); }
WebSpoonSecurityManager extends SecurityManager { @Override public void checkPermission( Permission perm, Object context ) { return; } WebSpoonSecurityManager(); @Override void checkPermission( Permission perm, Object context ); @Override void checkPermission( Permission perm ); void setUserName( String userName ); String getUserName(); }
WebSpoonSecurityManager extends SecurityManager { @Override public void checkPermission( Permission perm, Object context ) { return; } WebSpoonSecurityManager(); @Override void checkPermission( Permission perm, Object context ); @Override void checkPermission( Permission perm ); void setUserName( String userName ); String getUserName();  }