From 86541252028e0b2093b87836732924b6746858ca Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 26 Sep 2014 05:53:39 +0200 Subject: Adapt unit tests to commit 1350823035597f784f9cf871aa487f896f3d1840: getTempDir(..) throws IOException --- src/junit/com/jogamp/junit/sec/Applet01.java | 11 +++++++++++ src/junit/com/jogamp/junit/sec/TestSecIOUtil01.java | 11 +++++++++++ 2 files changed, 22 insertions(+) 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); -- cgit v1.2.3