diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/junit/com/jogamp/junit/sec/Applet01.java | 11 | ||||
-rw-r--r-- | src/junit/com/jogamp/junit/sec/TestSecIOUtil01.java | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/junit/com/jogamp/junit/sec/Applet01.java b/src/junit/com/jogamp/junit/sec/Applet01.java index f0188a2..2312aa4 100644 --- a/src/junit/com/jogamp/junit/sec/Applet01.java +++ b/src/junit/com/jogamp/junit/sec/Applet01.java @@ -111,6 +111,17 @@ public class Applet01 extends Applet { System.err.println("Unexpected exception for secure temp dir"); se0.printStackTrace(); } + } catch (final SecurityException e) { + se0 = e; + if( !isSecure ) { + System.err.println("Expected exception for insecure temp dir (2)"); + System.err.println("Message: "+se0.getMessage()); + } else { + System.err.println("Unexpected exception for secure temp dir (2)"); + se0.printStackTrace(); + } + } catch (final IOException e) { + throw new RuntimeException(e); // oops } if( isSecure ) { if( null != se0 ) { diff --git a/src/junit/com/jogamp/junit/sec/TestSecIOUtil01.java b/src/junit/com/jogamp/junit/sec/TestSecIOUtil01.java index b347680..a36b50b 100644 --- a/src/junit/com/jogamp/junit/sec/TestSecIOUtil01.java +++ b/src/junit/com/jogamp/junit/sec/TestSecIOUtil01.java @@ -123,6 +123,17 @@ public class TestSecIOUtil01 extends JunitTracer { System.err.println("Unexpected exception for secure temp dir"); se0.printStackTrace(); } + } catch (final SecurityException e) { + se0 = e; + if( !isSecure ) { + System.err.println("Expected exception for insecure temp dir (2)"); + System.err.println("Message: "+se0.getMessage()); + } else { + System.err.println("Unexpected exception for secure temp dir (2)"); + se0.printStackTrace(); + } + } catch (final IOException e) { + throw new RuntimeException(e); // oops } if( isSecure ) { Assert.assertNull("AccessControlException thrown on secure temp dir", se0); |