public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: Monster throwpoint checks refactoring
@ 2006-06-27 12:48 Gary Benson
  0 siblings, 0 replies; only message in thread
From: Gary Benson @ 2006-06-27 12:48 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

Hi all,

With this commit the long-unused gnu.testlet.TestSecurityManager has
been replaced by what was gnu.testlet.TestSecurityManager2.  Since
this required touching all throwpoint checks I made a bunch of other
changes I've been wanting to make for some time.  The main change is
that the way that halting checks work has changed to make it more
obvious what's happening.  Other changes were that checkAllChecked()
lost it's unnecessary harness argument, tests that caught Throwable
have been changed to catch Exception, and that TestSecurityManager now
has javadoc to tell you how to use it.

Cheers,
Gary
kk

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 80530 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/mauve/mauve/ChangeLog,v
retrieving revision 1.1742
diff -u -r1.1742 ChangeLog
--- ChangeLog	27 Jun 2006 10:08:13 -0000	1.1742
+++ ChangeLog	27 Jun 2006 12:20:52 -0000
@@ -1,3 +1,30 @@
+2006-06-27  Gary Benson  <gbenson@redhat.com>
+
+	* gnu/testlet/TestSecurityManager.java: Replaced with a
+	refactored, javadocced version of what was TestSecurityManager2.
+	* gnu/testlet/java/awt/Graphics2D/security.java: Use the above.
+	* gnu/testlet/java/awt/Robot/security.java: Likewise.
+	* gnu/testlet/java/awt/Toolkit/security.java: Likewise.
+	* gnu/testlet/java/awt/Window/security.java: Likewise.
+	* gnu/testlet/java/io/File/security.java: Likewise.
+	* gnu/testlet/java/io/FileInputStream/security.java: Likewise.
+	* gnu/testlet/java/io/FileOutputStream/security.java: Likewise.
+	* gnu/testlet/java/io/ObjectInputStream/security.java: Likewise.
+	* gnu/testlet/java/io/ObjectOutputStream/security.java: Likewise.
+	* gnu/testlet/java/io/RandomAccessFile/security.java: Likewise.
+	* gnu/testlet/java/lang/Class/security.java: Likewise.
+	* gnu/testlet/java/lang/ClassLoader/security.java: Likewise.
+	* gnu/testlet/java/lang/Runtime/security.java: Likewise.
+	* gnu/testlet/java/lang/SecurityManager/thread.java: Likewise.
+	* gnu/testlet/java/lang/System/security.java: Likewise.
+	* gnu/testlet/java/lang/Thread/insecurity.java: Likewise.
+	* gnu/testlet/java/lang/Thread/security.java: Likewise.
+	* gnu/testlet/java/lang/ThreadGroup/insecurity.java: Likewise.
+	* gnu/testlet/java/lang/ThreadGroup/security.java: Likewise.
+	* gnu/testlet/java/lang/reflect/AccessibleObject/security.java:
+	Likewise.
+	* gnu/testlet/TestSecurityManager2.java: Removed.
+
 2006-06-27  Gary Benson  <gbenson@redhat.com>
 
 	* gnu/testlet/java/lang/Runtime/security.java: Classpath now
Index: gnu/testlet/TestSecurityManager.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/TestSecurityManager.java,v
retrieving revision 1.1
diff -u -r1.1 TestSecurityManager.java
--- gnu/testlet/TestSecurityManager.java	21 Jul 2003 01:29:27 -0000	1.1
+++ gnu/testlet/TestSecurityManager.java	27 Jun 2006 12:20:52 -0000
@@ -1,5 +1,7 @@
-// Copyright (c) 2003  Red Hat, Inc.
-// Written by Tom Tromey <tromey@redhat.com>
+// Copyright (C) 2004 Stephen Crawley.
+// Copyright (C) 2005, 2006 Red Hat, Inc.
+// Written by Stephen Crawley <crawley@dstc.edu.au>
+// Extensively modified by Gary Benson <gbenson@redhat.com>
 
 // This file is part of Mauve.
 
@@ -21,45 +23,274 @@
 package gnu.testlet;
 
 import java.security.Permission;
+import java.security.SecurityPermission;
+import java.util.PropertyPermission;
 
+/**
+ * A security manager for testing that security checks are performed.
+ *
+ * Typically a testcase would call <code>prepareChecks()</code> to
+ * specify permissions that are expected to be checked during this
+ * test.  Next you call whatever should perform the checks, and
+ * finally you call <code>checkAllChecked()</code> to check that the
+ * permissions you specified were checked.  Any unexpected checks
+ * cause a {@link SecurityException} to be thrown.
+ *
+ * As well as the permissions that must be checked it is possible to
+ * supply <code>prepareChecks()</code> with a list of permissions that
+ * may be checked.  This allows some cases where proprietary JVMs
+ * check something incidental that Classpath does not to be checked.
+ * There are also halting versions of <code>prepareChecks()</code>
+ * which will cause an exception to be thrown when all permissions
+ * have been checked.  This allows throwpoints on things like
+ * <code>System.exit()</code> to be tested.
+ *
+ * @author Stephen Crawley (crawley@dstc.edu.au)
+ * @author Gary Benson (gbenson@redhat.com)
+ */
 public class TestSecurityManager extends SecurityManager
 {
-  public boolean runChecks = true;
+  /**
+   * The security manager that was in force before we were installed.
+   */
+  private SecurityManager oldManager;
+
+  /**
+   * Permissions that must be checked for this test to pass.
+   */
+  private Permission[] mustCheck;
+
+  /**
+   * Permissions that may be checked during this test.
+   */
+  private Permission[] mayCheck;
+
+  /**
+   * Must-check permissions are flagged as they are checked.
+   */
+  private boolean[] checked;
+
+  /**
+   * The test harness in use.
+   */
+  private final TestHarness harness;
+  
+  /**
+   * Should we halt after all checks have occurred?
+   */
+  private boolean isHalting;
+
+  /**
+   * The exception to throw when halting.
+   */
+  public static class SuccessException extends SecurityException
+  {
+    private static final long serialVersionUID = 23;
+  };
+  private final SuccessException successException = new SuccessException();
+
+  /**
+   * An empty list of checks, for convenience.
+   */
+  private final Permission[] noChecks = new Permission[0];
+
+  /**
+   * Create a new test security manager.
+   *
+   * @param harness <code>TestHarness</code> the tests will be run by
+   */
+  public TestSecurityManager(TestHarness harness)
+  {
+    super();
+    this.harness = harness;
+  }
+
+  /**
+   * Install this test security manager.
+   */
+  public void install()
+  {
+    SecurityManager oldsm = System.getSecurityManager();
+    if (oldsm == this)
+      throw new IllegalStateException("already installed");
+    oldManager = oldsm;
+
+    // On some JVMs, setting the security manager for the first time
+    // triggers some initialization that reads system properties.
+    prepareChecks(noChecks, new Permission[] {
+	new SecurityPermission("getProperty.*"),
+	new PropertyPermission("*", "read")});
+
+    System.setSecurityManager(this);
+  }
+
+  /**
+   * Uninstall this test security manager, replacing it with whatever
+   * was in force before it was installed.
+   */
+  public void uninstall()
+  {
+    SecurityManager oldsm = System.getSecurityManager();
+    if (oldsm != this)
+      throw new IllegalStateException("not installed");
+
+    prepareChecks(noChecks, new Permission[] {
+	new RuntimePermission("setSecurityManager")});
+
+    System.setSecurityManager(oldManager);
+  }
+
+  /**
+   * Prepare this test security manager for a series of checks.
+   * <code>checkAllChecked()</code> should be called after the
+   * test to check that the specified permissions were checked. 
+   *
+   * @param mustCheck permissions that must be checked in order for
+   *        the test to pass
+   */
+  public void prepareChecks(Permission[] mustCheck)
+  {
+    prepareChecks(mustCheck, noChecks);
+  }
 
-  public void setRunChecks(boolean runChecks)
+  /**
+   * Prepare this test security manager for a series of checks.
+   * <code>checkAllChecked()</code> should be called after the
+   * test to check that the specified permissions were checked. 
+   *
+   * @param mustCheck permissions that must be checked in order for
+   *        the test to pass
+   * @param mayCheck permissions that may be checked during the test
+   *        but are not required in order for the test to pass
+   */
+  public void prepareChecks(Permission[] mustCheck, Permission[] mayCheck)
   {
-    this.runChecks = runChecks;
+    prepareChecks(mustCheck, mayCheck, false);
   }
 
-  public void checkPermission(Permission perm)
+  /**
+   * Prepare this test security manager for a series of checks.
+   * A <code>SuccessException</code> will be thrown when the
+   * final permission is checked, halting the test.
+   *
+   * @param mustCheck permissions that must be checked in order for
+   *        the test to pass
+   */
+  public void prepareHaltingChecks(Permission[] mustCheck)
   {
-    if (runChecks && ! checkContext())
-      super.checkPermission(perm);
+    prepareHaltingChecks(mustCheck, noChecks);
   }
 
-  public void checkPermission(Permission perm, Object context)
+  /**
+   * Prepare this test security manager for a series of checks.
+   * A <code>SuccessException</code> will be thrown when the
+   * final permission is checked, halting the test.
+   *
+   * @param mustCheck permissions that must be checked in order for
+   *        the test to pass
+   * @param mayCheck permissions that may be checked during the test
+   *        but are not required in order for the test to pass
+   */
+  public void prepareHaltingChecks(Permission[] mustCheck,
+				   Permission[] mayCheck)
   {
-    if (runChecks && ! checkContext())
-      super.checkPermission(perm, context);
+    prepareChecks(mustCheck, mayCheck, true);
+  }
+
+  /**
+   * Prepare this test security manager for a series of checks.
+   *
+   * @param mustCheck permissions that must be checked in order for
+   *        the test to pass
+   * @param mayCheck permissions that may be checked during the test
+   *        but are not required in order for the test to pass
+   * @param isHalting whether to throw a <code>SuccessException</code>
+   *        when the final permission is checked
+   */
+  protected void prepareChecks(Permission[] mustCheck,
+			       Permission[] mayCheck,
+			       boolean isHalting)
+  {
+    this.mayCheck = mayCheck;
+    this.mustCheck = mustCheck;
+    this.checked = new boolean[mustCheck.length];
+    this.isHalting = isHalting;
+  }
+
+  /**
+   * Check that this permission is one that we should be checking.
+   * 
+   * @param perm the permission to be checked
+   * @throws SuccessException if all <code>mustCheck</code>
+   *         permissions have been checked and <code>isHalting</code>
+   *         is true.
+   * @throws SecurityException if none of the <code>mustCheck</code>
+   *         or <code>mayCheck</code> permissions implies
+   *         <code>perm</code>.
+   */
+  public void checkPermission(Permission perm) throws SecurityException
+  {
+    if (harness != null)
+      harness.debug("checkPermission(" + perm + ")");
+
+    boolean matched = false;
+    for (int i = 0; i < mustCheck.length; i++) {
+      if (mustCheck[i].implies(perm))
+	matched = checked[i] = true;
+    }
+
+    if (!matched) {
+      for (int i = 0; i < mayCheck.length; i++) {
+	if (mayCheck[i].implies(perm))
+	  matched = true;
+      }
+    }
+
+    if (!matched) {
+      harness.debug("unexpected check: " + perm);
+
+      if (mustCheck.length != 0) {
+	StringBuffer expected = new StringBuffer();
+	for (int i = 0; i < mustCheck.length; i++)
+	  expected.append(' ').append(mustCheck[i]);
+	harness.debug("expected: mustCheck:" + expected.toString());
+      }
+
+      if (mayCheck.length != 0) {
+	StringBuffer expected = new StringBuffer();
+	for (int i = 0; i < mayCheck.length; i++)
+	  expected.append(' ').append(mayCheck[i]);
+	harness.debug("expected: mayCheck:" + expected.toString());
+      }
+
+      throw new SecurityException("unexpected check: " + perm);
+    }
+    
+    if (isHalting) {
+      boolean allChecked = true;
+      for (int i = 0; i < checked.length; i++) {
+	if (!checked[i])
+	  allChecked = false;
+      }
+      if (allChecked)
+	throw successException;
+    }
   }
 
-  private boolean checkContext()
+  /**
+   * Check that all <code>mustCheck</code> permissions were checked,
+   * calling <code>TestHarness.check()</code> with the result.
+   */
+  public void checkAllChecked()
   {
-    Class[] stack = getClassContext();
-    // stack[0] is this class.
-    // stack[1] is another method in TestSecurityManager.
-    // stack[2] is the class that inspired the security check.
-    // We apply a fairly simple test.
-    // First, we skip any frames after stack[2] that come from the
-    // same class as stack[2].  This lets us skip implementation
-    // details of that class.  Then if the next stack element is
-    // a testlet, we fail.  Otherwise, we pass.  This way things like
-    // class initializers automatically pass.
-    // This is a bogus approach.  More work here is needed.
-    int i;
-    for (i = 3; i < stack.length && stack[i] == stack[2]; ++i)
-      ;
-    return (i >= stack.length
-	    || stack[i].getName().indexOf("gnu.testlet") == -1);
+    boolean allChecked = true;
+    for (int i = 0; i < checked.length; i++) {
+      if (!checked[i]) {
+	harness.debug("Unchecked permission: " + mustCheck[i]);
+	allChecked = false;
+      }
+    }
+    
+    harness.check(allChecked);
   }
 }
Index: gnu/testlet/java/awt/Graphics2D/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/Graphics2D/security.java,v
retrieving revision 1.1
diff -u -r1.1 security.java
--- gnu/testlet/java/awt/Graphics2D/security.java	21 Jun 2006 08:13:04 -0000	1.1
+++ gnu/testlet/java/awt/Graphics2D/security.java	27 Jun 2006 12:20:53 -0000
@@ -34,7 +34,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -51,7 +51,7 @@
       Permission[] readDisplayPixels = new Permission[] {
 	new AWTPermission("readDisplayPixels")};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -64,7 +64,7 @@
 	  }
 	  catch (UnsupportedOperationException ex) {
 	  }
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
Index: gnu/testlet/java/awt/Robot/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/Robot/security.java,v
retrieving revision 1.3
diff -u -r1.3 security.java
--- gnu/testlet/java/awt/Robot/security.java	13 Jun 2006 14:01:31 -0000	1.3
+++ gnu/testlet/java/awt/Robot/security.java	27 Jun 2006 12:20:53 -0000
@@ -31,7 +31,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -48,7 +48,7 @@
       Permission[] readProperty = new Permission[] {
 	new PropertyPermission("*", "read")};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -57,7 +57,7 @@
 	try {
 	  sm.prepareChecks(createRobot, readProperty);
 	  new Robot();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -69,7 +69,7 @@
 	try {
 	  sm.prepareChecks(createRobot, readProperty);
 	  new Robot(gd);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
Index: gnu/testlet/java/awt/Toolkit/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/Toolkit/security.java,v
retrieving revision 1.1
diff -u -r1.1 security.java
--- gnu/testlet/java/awt/Toolkit/security.java	20 Jun 2006 11:42:58 -0000	1.1
+++ gnu/testlet/java/awt/Toolkit/security.java	27 Jun 2006 12:20:53 -0000
@@ -34,7 +34,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -63,7 +63,7 @@
       Permission[] accessEventQueue = new Permission[] {
 	new AWTPermission("accessEventQueue")};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -72,7 +72,7 @@
 	try {
 	  sm.prepareChecks(listenToAllAWTEvents);
 	  toolkit.addAWTEventListener(listener, AWTEvent.KEY_EVENT_MASK);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -84,7 +84,7 @@
 	try {
 	  sm.prepareChecks(listenToAllAWTEvents);
 	  toolkit.removeAWTEventListener(listener);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -94,35 +94,31 @@
 	// throwpoint: java.awt.Toolkit-getPrintJob(Frame, String, Properties)
 	harness.checkPoint("getPrintJob(3-arg)");
 	try {
-	  sm.prepareChecks(queuePrintJob, true);
+	  sm.prepareHaltingChecks(queuePrintJob);
 	  toolkit.getPrintJob(frame, "Test job", props);
 	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 
 	// throwpoint: java.awt.Toolkit-getPrintJob(Frame, String, JobAttributes, PageAttributes)
 	harness.checkPoint("getPrintJob(4-arg)");
 	try {
-	  sm.prepareChecks(queuePrintJob, true);
+	  sm.prepareHaltingChecks(queuePrintJob);
 	  toolkit.getPrintJob(frame, "Test job", jobattrs, pageattrs);
 	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 
 	// throwpoint: java.awt.Toolkit-getSystemClipboard
@@ -130,7 +126,7 @@
 	try {
 	  sm.prepareChecks(accessClipboard);
 	  toolkit.getSystemClipboard();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -142,7 +138,7 @@
 	try {
 	  sm.prepareChecks(accessEventQueue);
 	  toolkit.getSystemEventQueue();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
Index: gnu/testlet/java/awt/Window/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/awt/Window/security.java,v
retrieving revision 1.3
diff -u -r1.3 security.java
--- gnu/testlet/java/awt/Window/security.java	13 Jun 2006 14:01:31 -0000	1.3
+++ gnu/testlet/java/awt/Window/security.java	27 Jun 2006 12:20:53 -0000
@@ -30,7 +30,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -44,7 +44,7 @@
       Permission[] showWindowWithoutWarningBanner = new Permission[] {
 	new AWTPermission("showWindowWithoutWarningBanner")};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -53,7 +53,7 @@
 	try {
 	  sm.prepareChecks(showWindowWithoutWarningBanner);
 	  new Window(frame);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -65,7 +65,7 @@
 	try {
 	  sm.prepareChecks(showWindowWithoutWarningBanner);
 	  new Window(window);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -77,7 +77,7 @@
 	try {
 	  sm.prepareChecks(showWindowWithoutWarningBanner);
 	  new Window(window, gc);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
Index: gnu/testlet/java/io/File/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/io/File/security.java,v
retrieving revision 1.11
diff -u -r1.11 security.java
--- gnu/testlet/java/io/File/security.java	3 Feb 2006 10:21:46 -0000	1.11
+++ gnu/testlet/java/io/File/security.java	27 Jun 2006 12:20:53 -0000
@@ -2,8 +2,10 @@
 
 // Copyright (C) 2003 Red Hat, Inc.
 // Copyright (C) 2004 Stephen Crawley.
+// Copyright (C) 2005, 2006 Red Hat, Inc.
 // Written by Tom Tromey <tromey@redhat.com>
 // Extensively modified by Stephen Crawley <crawley@dstc.edu.au>
+// Further modified by Gary Benson <gbenson@redhat.com>
 
 // This file is part of Mauve.
 
@@ -33,7 +35,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -83,11 +85,11 @@
     Permission tmpdirPropPerm =
       new PropertyPermission("java.io.tmpdir", "read");
 
-    TestSecurityManager2 sm = new TestSecurityManager2(harness);
-
     // Keep a record of created temp files so we can delete them later.
     File tf1 = null;
     File tf2 = null;
+
+    TestSecurityManager sm = new TestSecurityManager(harness);
     try {
       sm.install();
 	
@@ -96,7 +98,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirWritePerm}, noPerms);
 	tmpdir.canWrite();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (SecurityException ex) {
 	harness.debug(ex);
@@ -108,7 +110,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirReadPerm}, noPerms);
 	tmpdir.canRead();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (SecurityException ex) {
 	harness.debug(ex);
@@ -120,7 +122,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpfileWritePerm}, noPerms);
 	tmpfile.createNewFile();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -132,7 +134,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpfileDeletePerm}, noPerms);
 	tmpfile.delete();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -144,7 +146,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirReadPerm}, noPerms);
 	tmpdir.list(null);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -156,7 +158,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirReadPerm}, noPerms);
 	tmpdir.list();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -168,7 +170,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirReadPerm}, noPerms);
 	tmpdir.listFiles();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -180,7 +182,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirReadPerm}, noPerms);
 	tmpdir.listFiles((FilenameFilter) null);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -193,7 +195,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirReadPerm}, noPerms);
 	tmpdir.listFiles((FileFilter) null);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -207,7 +209,7 @@
 	sm.prepareChecks(new Permission[]{tmpallWritePerm},
 			 new Permission[]{tmpdirPropPerm});
 	tf1 = File.createTempFile("pfx", "sfx");
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -219,7 +221,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirallWritePerm}, noPerms);
 	tf2 = File.createTempFile("pfx", "sfx", tmpdir);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -231,7 +233,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdir2WritePerm}, noPerms);
 	tmpdir2.setReadOnly();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -244,7 +246,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdir2DeletePerm}, noPerms);
 	tmpdir2.delete();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -257,7 +259,7 @@
 	sm.prepareChecks(new Permission[]{rootReadPerm}, noPerms);
 	File[] roots = File.listRoots();
 	harness.check(roots.length >= 1, "File.listRoots()");
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -271,7 +273,7 @@
 					  tmpfile2WritePerm}, 
 			 noPerms);
 	tmpfile.renameTo(tmpfile2);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -283,7 +285,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirWritePerm}, noPerms);
 	tmpdir.setLastModified(0);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -295,7 +297,7 @@
       try {
 	sm.prepareChecks(new Permission[]{tmpdirDeletePerm}, noPerms);
 	tmpdir.deleteOnExit();
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (Exception ex) {
 	harness.debug(ex);
@@ -315,7 +317,7 @@
       // throwpoint: TODO: java.io.File-mkdirs
       // throwpoint: TODO: java.io.File-setLastModified-FILE
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "outer handler - unexpected exception");
     }
Index: gnu/testlet/java/io/FileInputStream/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/io/FileInputStream/security.java,v
retrieving revision 1.6
diff -u -r1.6 security.java
--- gnu/testlet/java/io/FileInputStream/security.java	26 Jun 2006 09:35:09 -0000	1.6
+++ gnu/testlet/java/io/FileInputStream/security.java	27 Jun 2006 12:20:53 -0000
@@ -28,7 +28,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -42,7 +42,7 @@
     Permission[] fdPerm = new Permission[] {
 	new RuntimePermission("readFileDescriptor")};
     
-    TestSecurityManager2 sm = new TestSecurityManager2(harness);
+    TestSecurityManager sm = new TestSecurityManager(harness);
     try {
       sm.install();
 	
@@ -51,7 +51,7 @@
       try {
 	sm.prepareChecks(perm);
 	new FileInputStream(file);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (SecurityException ex) {
 	harness.debug(ex);
@@ -63,7 +63,7 @@
       try {
 	sm.prepareChecks(perm);
 	new FileInputStream(path);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (SecurityException ex) {
 	harness.debug(ex);
@@ -75,14 +75,14 @@
       try {
 	sm.prepareChecks(fdPerm);
 	new FileInputStream(FileDescriptor.in);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (SecurityException ex) {
 	harness.debug(ex);
 	harness.check(false, "Unexpected check");
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
Index: gnu/testlet/java/io/FileOutputStream/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/io/FileOutputStream/security.java,v
retrieving revision 1.6
diff -u -r1.6 security.java
--- gnu/testlet/java/io/FileOutputStream/security.java	3 Feb 2006 10:21:46 -0000	1.6
+++ gnu/testlet/java/io/FileOutputStream/security.java	27 Jun 2006 12:20:53 -0000
@@ -1,4 +1,4 @@
-// Copyright (C) 2005 Red Hat, Inc.
+// Copyright (C) 2005, 2006 Red Hat, Inc.
 // Written by Gary Benson <gbenson@redhat.com>
 
 // This file is part of Mauve.
@@ -28,7 +28,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -44,8 +44,7 @@
     Permission wperm = new FilePermission(path, "write");
     Permission fdPerm = new RuntimePermission("writeFileDescriptor");
     
-    TestSecurityManager2 sm = new TestSecurityManager2(harness);
-
+    TestSecurityManager sm = new TestSecurityManager(harness);
     try {
       sm.install();
 	
@@ -54,7 +53,7 @@
       try {
 	sm.prepareChecks(new Permission[] {wperm}, new Permission[] {rperm});
 	new FileOutputStream(file);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (SecurityException ex) {
 	harness.debug(ex);
@@ -67,7 +66,7 @@
 	try {
 	  sm.prepareChecks(new Permission[] {wperm}, new Permission[] {rperm});
 	  new FileOutputStream(file, i == 1);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -80,7 +79,7 @@
       try {
 	sm.prepareChecks(new Permission[] {wperm}, new Permission[] {rperm});
 	new FileOutputStream(path);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (SecurityException ex) {
 	harness.debug(ex);
@@ -93,7 +92,7 @@
 	try {
 	  sm.prepareChecks(new Permission[] {wperm}, new Permission[] {rperm});
 	  new FileOutputStream(path, i == 1);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -106,14 +105,14 @@
       try {
 	sm.prepareChecks(new Permission[] {fdPerm});
 	new FileOutputStream(FileDescriptor.out);
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
       }
       catch (SecurityException ex) {
 	harness.debug(ex);
 	harness.check(false, "Unexpected check");
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
Index: gnu/testlet/java/io/ObjectInputStream/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/io/ObjectInputStream/security.java,v
retrieving revision 1.3
diff -u -r1.3 security.java
--- gnu/testlet/java/io/ObjectInputStream/security.java	3 Feb 2006 10:21:46 -0000	1.3
+++ gnu/testlet/java/io/ObjectInputStream/security.java	27 Jun 2006 12:20:53 -0000
@@ -27,7 +27,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -44,7 +44,7 @@
 
       Permission[] noPerms = new Permission[] {};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -53,7 +53,7 @@
 	try {
 	  sm.prepareChecks(enableSubclassImplementation);
 	  new TestObjectInputStream();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -65,7 +65,7 @@
 	try {
 	  sm.prepareChecks(noPerms);
 	  teststream.testEnableResolveObject(false);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -74,7 +74,7 @@
 	try {
 	  sm.prepareChecks(enableSubstitution);
 	  teststream.testEnableResolveObject(true);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -85,7 +85,7 @@
 	sm.uninstall();
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
Index: gnu/testlet/java/io/ObjectOutputStream/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/io/ObjectOutputStream/security.java,v
retrieving revision 1.3
diff -u -r1.3 security.java
--- gnu/testlet/java/io/ObjectOutputStream/security.java	3 Feb 2006 10:21:46 -0000	1.3
+++ gnu/testlet/java/io/ObjectOutputStream/security.java	27 Jun 2006 12:20:53 -0000
@@ -27,7 +27,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -44,7 +44,7 @@
 
       Permission[] noPerms = new Permission[] {};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -53,7 +53,7 @@
 	try {
 	  sm.prepareChecks(enableSubclassImplementation);
 	  new TestObjectOutputStream();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -65,7 +65,7 @@
 	try {
 	  sm.prepareChecks(noPerms);
 	  teststream.testEnableReplaceObject(false);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -74,7 +74,7 @@
 	try {
 	  sm.prepareChecks(enableSubstitution);
 	  teststream.testEnableReplaceObject(true);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -85,7 +85,7 @@
 	sm.uninstall();
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
Index: gnu/testlet/java/io/RandomAccessFile/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/io/RandomAccessFile/security.java,v
retrieving revision 1.2
diff -u -r1.2 security.java
--- gnu/testlet/java/io/RandomAccessFile/security.java	3 Feb 2006 10:21:46 -0000	1.2
+++ gnu/testlet/java/io/RandomAccessFile/security.java	27 Jun 2006 12:20:53 -0000
@@ -1,4 +1,4 @@
-// Copyright (C) 2005 Red Hat, Inc.
+// Copyright (C) 2005, 2006 Red Hat, Inc.
 // Written by Gary Benson <gbenson@redhat.com>
 
 // This file is part of Mauve.
@@ -30,7 +30,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -56,8 +56,7 @@
 
     String[] modes = new String[] {"r", "rw", "rws", "rwd"};
     
-    TestSecurityManager2 sm = new TestSecurityManager2(harness);
-
+    TestSecurityManager sm = new TestSecurityManager(harness);
     try {
       sm.install();
 
@@ -81,7 +80,7 @@
 	try {
 	  sm.prepareChecks(mustCheck, mayCheck);
 	  raf = new RandomAccessFile(file, mode);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	  if (mode == "r")
 	    ensureUnwritable(harness, raf);
 	}
@@ -95,7 +94,7 @@
 	try {
 	  sm.prepareChecks(mustCheck, mayCheck);
 	  raf = new RandomAccessFile(path, mode);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	  if (mode == "r")
 	    ensureUnwritable(harness, raf);
 	}
@@ -105,7 +104,7 @@
 	}
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
Index: gnu/testlet/java/lang/Class/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Class/security.java,v
retrieving revision 1.4
diff -u -r1.4 security.java
--- gnu/testlet/java/lang/Class/security.java	6 Apr 2006 13:05:06 -0000	1.4
+++ gnu/testlet/java/lang/Class/security.java	27 Jun 2006 12:20:53 -0000
@@ -1,4 +1,4 @@
-// Copyright (C) 2005 Red Hat, Inc.
+// Copyright (C) 2005, 2006 Red Hat, Inc.
 // Written by Gary Benson <gbenson@redhat.com>
 
 // This file is part of Mauve.
@@ -29,7 +29,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -76,7 +76,7 @@
 	Permission[] getProtectionDomain = new Permission[] {
 	  new RuntimePermission("getProtectionDomain")};
 	
-	TestSecurityManager2 sm = new TestSecurityManager2(harness);
+	TestSecurityManager sm = new TestSecurityManager(harness);
 	try {
 	  sm.install();
 
@@ -85,7 +85,7 @@
 	  try {
 	    sm.prepareChecks(getClassLoader);
 	    Class.forName("java.lang.Class", false, null);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -97,7 +97,7 @@
 	  try {
 	    sm.prepareChecks(getClassLoader);
 	    testClass.getClassLoader();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -109,7 +109,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    Thread.class.getClassLoader();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -124,7 +124,7 @@
 	  try {
 	    sm.prepareChecks(getProtectionDomain);
 	    testClass.getProtectionDomain();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -133,7 +133,7 @@
 	  try {
 	    sm.prepareChecks(getProtectionDomain);
 	    getClass().getProtectionDomain();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -160,13 +160,13 @@
 	Security.setProperty("package.access", oldrestrictions);
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
   }
 
-  private void getMemberChecks(TestHarness harness, TestSecurityManager2 sm,
+  private void getMemberChecks(TestHarness harness, TestSecurityManager sm,
 			       Class testClass, boolean declared,
 			       Permission[] mustCheck)
   {
@@ -184,7 +184,7 @@
 	testClass.getDeclaredClasses();
       else
 	testClass.getClasses();
-      sm.checkAllChecked(harness);
+      sm.checkAllChecked();
     }
     catch (SecurityException ex) {
       harness.debug(ex);
@@ -203,7 +203,7 @@
 	testClass.getDeclaredFields();
       else
 	testClass.getFields();
-      sm.checkAllChecked(harness);
+      sm.checkAllChecked();
     }
     catch (SecurityException ex) {
       harness.debug(ex);
@@ -222,7 +222,7 @@
 	testClass.getDeclaredMethods();
       else
 	testClass.getMethods();
-      sm.checkAllChecked(harness);
+      sm.checkAllChecked();
     }
     catch (SecurityException ex) {
       harness.debug(ex);
@@ -241,7 +241,7 @@
 	testClass.getDeclaredConstructors();
       else
 	testClass.getConstructors();
-      sm.checkAllChecked(harness);
+      sm.checkAllChecked();
     }
     catch (SecurityException ex) {
       harness.debug(ex);
@@ -274,7 +274,7 @@
 	  catch (NoSuchFieldException e) {
 	    exists = false;
 	  }
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	  harness.check(exists == (j > level));
 	}
       }
@@ -307,7 +307,7 @@
 	    catch (NoSuchMethodException e) {
 	      exists = false;
 	    }
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	    harness.check(exists == (j > level && k > 0));
 	  }
 	}
@@ -342,7 +342,7 @@
 	catch (NoSuchMethodException e) {
 	  exists = false;
 	}
-	sm.checkAllChecked(harness);
+	sm.checkAllChecked();
 	harness.check(exists == (i > level));
       }
     }
@@ -422,7 +422,7 @@
   // checks no permissions if memberType is Member.PUBLIC.  This class
   // changes this, allowing us to test get{Field,Method,Constructor}.
   // No other tests should use this class.
-  private static class TestSecurityManager3 extends TestSecurityManager2
+  private static class TestSecurityManager3 extends TestSecurityManager
   {
     TestSecurityManager3(TestHarness harness)
     {
Index: gnu/testlet/java/lang/ClassLoader/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/ClassLoader/security.java,v
retrieving revision 1.3
diff -u -r1.3 security.java
--- gnu/testlet/java/lang/ClassLoader/security.java	3 Feb 2006 10:21:46 -0000	1.3
+++ gnu/testlet/java/lang/ClassLoader/security.java	27 Jun 2006 12:20:53 -0000
@@ -28,7 +28,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -61,7 +61,7 @@
       Permission[] getClassLoader = new Permission[] {
 	new RuntimePermission("getClassLoader")};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -70,7 +70,7 @@
 	try {
 	  sm.prepareChecks(createClassLoader);
 	  new TestClassLoader();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -82,7 +82,7 @@
 	try {
 	  sm.prepareChecks(createClassLoader);
 	  new TestClassLoader(ourLoader);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -94,7 +94,7 @@
 	try {
 	  sm.prepareChecks(getClassLoader);
 	  getSystemClassLoaderTest.invoke(null, new Object[] {});
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -106,7 +106,7 @@
 	try {
 	  sm.prepareChecks(getClassLoader);
 	  getParentTest.invoke(null, new Object[] {ourLoader});
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -117,7 +117,7 @@
 	sm.uninstall();
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
Index: gnu/testlet/java/lang/Runtime/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Runtime/security.java,v
retrieving revision 1.5
diff -u -r1.5 security.java
--- gnu/testlet/java/lang/Runtime/security.java	27 Jun 2006 10:08:13 -0000	1.5
+++ gnu/testlet/java/lang/Runtime/security.java	27 Jun 2006 12:20:53 -0000
@@ -26,7 +26,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -63,7 +63,7 @@
       Permission[] loadLibrary_path = new Permission[] {
 	new RuntimePermission("loadLibrary." + library_path)};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -72,7 +72,7 @@
 	try {
 	  sm.prepareChecks(executeCommand, modifyThreadOrGroup);
 	  runtime.exec(sCommand).waitFor();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -84,7 +84,7 @@
 	try {
 	  sm.prepareChecks(executeCommand, modifyThreadOrGroup);
 	  runtime.exec(sCommand, null).waitFor();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -96,7 +96,7 @@
 	try {
 	  sm.prepareChecks(executeCommand, modifyThreadOrGroup);
 	  runtime.exec(sCommand, null, null).waitFor();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -108,7 +108,7 @@
 	try {
 	  sm.prepareChecks(executeCommand, modifyThreadOrGroup);
 	  runtime.exec(aCommand).waitFor();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -120,7 +120,7 @@
 	try {
 	  sm.prepareChecks(executeCommand, modifyThreadOrGroup);
 	  runtime.exec(aCommand, null).waitFor();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -132,7 +132,7 @@
 	try {
 	  sm.prepareChecks(executeCommand, modifyThreadOrGroup);
 	  runtime.exec(aCommand, null, null).waitFor();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -142,26 +142,24 @@
 	// throwpoint: java.lang.Runtime-exit
 	harness.checkPoint("exit");
 	try {
-	  sm.prepareChecks(exitVM, true);
+	  sm.prepareHaltingChecks(exitVM);
 	  runtime.exit(0);
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
-	
+
 	// throwpoint: java.lang.Runtime-runFinalizersOnExit
 	harness.checkPoint("runFinalizersOnExit");
 	try {
 	  sm.prepareChecks(exitVM);
 	  Runtime.runFinalizersOnExit(false);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -173,7 +171,7 @@
 	try {
 	  sm.prepareChecks(shutdownHooks);
 	  runtime.addShutdownHook(thread);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -185,7 +183,7 @@
 	try {
 	  sm.prepareChecks(shutdownHooks);
 	  runtime.removeShutdownHook(thread);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -195,42 +193,38 @@
 	// throwpoint: java.lang.Runtime-load
 	harness.checkPoint("load");
 	try {
-	  sm.prepareChecks(loadLibrary_name, true);
+	  sm.prepareHaltingChecks(loadLibrary_name);
 	  runtime.load(library_name);
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 
 	// throwpoint: java.lang.Runtime-loadLibrary
 	harness.checkPoint("loadLibrary");
 	try {
-	  sm.prepareChecks(loadLibrary_path, true);
+	  sm.prepareHaltingChecks(loadLibrary_path);
 	  runtime.loadLibrary(library_path);
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
       }
       finally {
 	sm.uninstall();
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
Index: gnu/testlet/java/lang/SecurityManager/thread.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/SecurityManager/thread.java,v
retrieving revision 1.2
diff -u -r1.2 thread.java
--- gnu/testlet/java/lang/SecurityManager/thread.java	31 Jan 2006 15:00:55 -0000	1.2
+++ gnu/testlet/java/lang/SecurityManager/thread.java	27 Jun 2006 12:20:53 -0000
@@ -1,4 +1,4 @@
-// Copyright (C) 2005, Red Hat, Inc.
+// Copyright (C) 2005, 2006 Red Hat, Inc.
 //
 // This file is part of Mauve.
 //
@@ -25,7 +25,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class thread implements Testlet
 {
@@ -52,16 +52,16 @@
       thread = new Thread(group, "dummy");
 
     // Check we're checking
-    TestSecurityManager2 sm = new TestSecurityManager2(harness);
+    TestSecurityManager sm = new TestSecurityManager(harness);
 
     sm.prepareChecks(new Permission[] {
       new RuntimePermission("modifyThread")});
     sm.checkAccess(thread);
-    sm.checkAllChecked(harness);
+    sm.checkAllChecked();
 
     sm.prepareChecks(new Permission[] {
       new RuntimePermission("modifyThreadGroup")});
     sm.checkAccess(group);
-    sm.checkAllChecked(harness);
+    sm.checkAllChecked();
   }
 }
Index: gnu/testlet/java/lang/System/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/System/security.java,v
retrieving revision 1.4
diff -u -r1.4 security.java
--- gnu/testlet/java/lang/System/security.java	3 Feb 2006 10:21:47 -0000	1.4
+++ gnu/testlet/java/lang/System/security.java	27 Jun 2006 12:20:53 -0000
@@ -26,7 +26,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -82,25 +82,23 @@
       Permission[] setSecurityManager = new Permission[] {
 	new RuntimePermission("setSecurityManager")};
       
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
 	// throwpoint: java.lang.System-exit
 	harness.checkPoint("exit");
 	try {
-	  sm.prepareChecks(exitVM, true);
+	  sm.prepareHaltingChecks(exitVM);
 	  System.exit(0);
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 	
 	// throwpoint: java.lang.System-runFinalizersOnExit
@@ -108,7 +106,7 @@
 	try {
 	  sm.prepareChecks(exitVM);
 	  System.runFinalizersOnExit(false);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -118,35 +116,31 @@
 	// throwpoint: java.lang.System-load
 	harness.checkPoint("load");
 	try {
-	  sm.prepareChecks(loadLibrary_name, true);
+	  sm.prepareHaltingChecks(loadLibrary_name);
 	  System.load(library_name);
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 
 	// throwpoint: java.lang.System-loadLibrary
 	harness.checkPoint("loadLibrary");
 	try {
-	  sm.prepareChecks(loadLibrary_path, true);
+	  sm.prepareHaltingChecks(loadLibrary_path);
 	  System.loadLibrary(library_path);
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 
 	// throwpoint: TODO: java.lang.System-getenv()
@@ -156,7 +150,7 @@
 	try {
 	  sm.prepareChecks(readVariable);
 	  System.getenv(a_variable);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -165,7 +159,7 @@
 	try {
 	  sm.prepareChecks(readNonVariable);
 	  System.getenv(not_a_variable);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -177,7 +171,7 @@
 	try {
 	  sm.prepareChecks(readWriteAllProperties);
 	  System.getProperties();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -189,7 +183,7 @@
 	try {
 	  sm.prepareChecks(readWriteAllProperties);
 	  System.setProperties(properties);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -201,7 +195,7 @@
 	try {
 	  sm.prepareChecks(readProperty);
 	  System.getProperty(a_property);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -210,7 +204,7 @@
 	try {
 	  sm.prepareChecks(readNonProperty);
 	  System.getProperty(not_a_property);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -222,7 +216,7 @@
 	try {
 	  sm.prepareChecks(readProperty);
 	  System.getProperty(a_property, "quadrant");
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -231,7 +225,7 @@
 	try {
 	  sm.prepareChecks(readNonProperty);
 	  System.getProperty(not_a_property, "blade");
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -243,7 +237,7 @@
 	try {
 	  sm.prepareChecks(setIO);
 	  System.setIn(System.in);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -255,7 +249,7 @@
 	try {
 	  sm.prepareChecks(setIO);
 	  System.setOut(System.out);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -267,7 +261,7 @@
 	try {
 	  sm.prepareChecks(setIO);
 	  System.setErr(System.err);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -279,7 +273,7 @@
 	try {
 	  sm.prepareChecks(writeProperty);
 	  System.setProperty(a_property, properties.getProperty(a_property));
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -288,7 +282,7 @@
 	try {
 	  sm.prepareChecks(writeNonProperty);
 	  System.setProperty(not_a_property, "hello mum");
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -302,7 +296,7 @@
 	try {
 	  sm.prepareChecks(setSecurityManager);
 	  System.setSecurityManager(sm);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -313,7 +307,7 @@
 	sm.uninstall();
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
Index: gnu/testlet/java/lang/Thread/insecurity.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Thread/insecurity.java,v
retrieving revision 1.2
diff -u -r1.2 insecurity.java
--- gnu/testlet/java/lang/Thread/insecurity.java	27 Jun 2006 09:58:34 -0000	1.2
+++ gnu/testlet/java/lang/Thread/insecurity.java	27 Jun 2006 12:20:54 -0000
@@ -24,7 +24,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class insecurity implements Testlet
 {
@@ -35,7 +35,7 @@
     try {
       harness.checkPoint("setup");
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
 
       // The default SecurityManager.checkAccess(Thread) method should
       // only check permissions when the thread in question is a system
@@ -79,7 +79,7 @@
 	try {
 	  sm.prepareChecks(noChecks);
 	  testThread.checkAccess();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -91,7 +91,7 @@
 	try {
 	  sm.prepareChecks(noChecks);
 	  testThread.interrupt();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -103,7 +103,7 @@
 	try {
 	  sm.prepareChecks(noChecks);
 	  testThread.suspend();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -115,7 +115,7 @@
 	try {
 	  sm.prepareChecks(noChecks);
 	  testThread.resume();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -128,7 +128,7 @@
 	  int priority = testThread.getPriority();
 	  sm.prepareChecks(noChecks);
 	  testThread.setPriority(priority);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -140,7 +140,7 @@
 	try {
 	  sm.prepareChecks(noChecks);
 	  testThread.setName("a test thread");
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -152,7 +152,7 @@
 	try {
 	  sm.prepareChecks(noChecks);
 	  testThread.setDaemon(false);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -164,7 +164,7 @@
 	try {
 	  sm.prepareChecks(stopThread);
 	  testThread.stop();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -176,7 +176,7 @@
 	try {
 	  sm.prepareChecks(stopThread);
 	  testThread.stop(threadDeath);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -186,7 +186,7 @@
 	try {
 	  sm.prepareChecks(stopThread);
 	  testThread.stop(notThreadDeath);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -216,7 +216,7 @@
 	      new Thread(nonSystemGroup, "test thread");
 	      break;
 	    }
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -228,7 +228,7 @@
 	sm.uninstall();
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
@@ -238,7 +238,7 @@
   public static class SysTestRunner implements Runnable
   {
     private TestHarness harness;
-    private TestSecurityManager2 sm;
+    private TestSecurityManager sm;
 
     private static Runnable runnable = new Runnable()
     {
@@ -247,7 +247,7 @@
       }
     };
 
-    public SysTestRunner(TestHarness harness, TestSecurityManager2 sm)
+    public SysTestRunner(TestHarness harness, TestSecurityManager sm)
     {
       this.harness = harness;
       this.sm = sm;
@@ -261,7 +261,7 @@
 	try {
 	  sm.prepareChecks(noChecks);
 	  Thread.enumerate(new Thread[0]);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -290,7 +290,7 @@
 	      new Thread(runnable, "test thread");
 	      break;
 	    }
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
Index: gnu/testlet/java/lang/Thread/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Thread/security.java,v
retrieving revision 1.4
diff -u -r1.4 security.java
--- gnu/testlet/java/lang/Thread/security.java	9 May 2006 09:34:02 -0000	1.4
+++ gnu/testlet/java/lang/Thread/security.java	27 Jun 2006 12:20:54 -0000
@@ -28,7 +28,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -52,7 +52,7 @@
       Method getContextClassLoaderTest = testClass.getMethod(
 	"testGetContextClassLoader", new Class[] {Thread.class});
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
 
       // The default SecurityManager.checkAccess(Thread) method only
       // checks permissions when the thread in question is a system
@@ -108,7 +108,7 @@
 	try {
 	  sm.prepareChecks(getClassLoader);
  	  getContextClassLoaderTest.invoke(null, new Object[] {testThread});
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -121,7 +121,7 @@
 	  ClassLoader loader = testThread.getContextClassLoader();
 	  sm.prepareChecks(setContextClassLoader);
 	  testThread.setContextClassLoader(loader);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -133,7 +133,7 @@
 	try {
 	  sm.prepareChecks(modifyThread);
 	  testThread.checkAccess();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -145,7 +145,7 @@
 	try {
 	  sm.prepareChecks(modifyThread);
 	  testThread.interrupt();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -157,7 +157,7 @@
 	try {
 	  sm.prepareChecks(modifyThread);
 	  testThread.suspend();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -169,7 +169,7 @@
 	try {
 	  sm.prepareChecks(modifyThread);
 	  testThread.resume();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -182,7 +182,7 @@
 	  int priority = testThread.getPriority();
 	  sm.prepareChecks(modifyThread);
 	  testThread.setPriority(priority);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -194,7 +194,7 @@
 	try {
 	  sm.prepareChecks(modifyThread);
 	  testThread.setName("a test thread");
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -206,7 +206,7 @@
 	try {
 	  sm.prepareChecks(modifyThread);
 	  testThread.setDaemon(false);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -218,7 +218,7 @@
 	try {
 	  sm.prepareChecks(stopThread);
 	  testThread.stop();
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -226,19 +226,17 @@
 	}
 
 	try {
-	  sm.prepareChecks(modifyThread, true);
+	  sm.prepareHaltingChecks(modifyThread);
 	  if (we_are_gnu_classpath)
 	    Thread.currentThread().stop();
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 
 	// throwpoint: java.lang.Thread-stop(Throwable)
@@ -246,7 +244,7 @@
 	try {
 	  sm.prepareChecks(stopThread);
 	  testThread.stop(threadDeath);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -256,7 +254,7 @@
 	try {
 	  sm.prepareChecks(stopThread);
 	  testThread.stop(notThreadDeath);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -264,35 +262,31 @@
 	}
 	
 	try {
-	  sm.prepareChecks(modifyThread, true);
+	  sm.prepareHaltingChecks(modifyThread);
 	  if (we_are_gnu_classpath)
 	    Thread.currentThread().stop(threadDeath);
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 
 	try {
-	  sm.prepareChecks(stopThread, true);
+	  sm.prepareHaltingChecks(stopThread);
 	  if (we_are_gnu_classpath)
 	    Thread.currentThread().stop(notThreadDeath);
-	  harness.check(false, "shouldn't be reached");	  
+	  harness.check(false);	  
 	}
+	catch (TestSecurityManager.SuccessException ex) {
+	  harness.check(true);
+	} 
 	catch (SecurityException ex) {
-	  if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	    harness.check(true);
-	  }
-	  else {
-	    harness.debug(ex);
-	    harness.check(false, "unexpected check");
-	  }
+	  harness.debug(ex);
+	  harness.check(false, "unexpected check");
 	}
 
 	// The modifyThreadGroup tests get run in a system thread.
@@ -321,7 +315,7 @@
 	      new Thread(systemGroup, "test thread");
 	      break;
 	    }
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -333,7 +327,7 @@
 	sm.uninstall();
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
@@ -349,7 +343,7 @@
   public static class SysTestRunner implements Runnable
   {
     private TestHarness harness;
-    private TestSecurityManager2 sm;
+    private TestSecurityManager sm;
 
     private static Runnable runnable = new Runnable()
     {
@@ -358,7 +352,7 @@
       }
     };
 
-    public SysTestRunner(TestHarness harness, TestSecurityManager2 sm)
+    public SysTestRunner(TestHarness harness, TestSecurityManager sm)
     {
       this.harness = harness;
       this.sm = sm;
@@ -372,7 +366,7 @@
 	try {
 	  sm.prepareChecks(modifyThreadGroup);
 	  Thread.enumerate(new Thread[0]);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -401,7 +395,7 @@
 	      new Thread(runnable, "test thread");
 	      break;
 	    }
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
Index: gnu/testlet/java/lang/ThreadGroup/insecurity.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/ThreadGroup/insecurity.java,v
retrieving revision 1.2
diff -u -r1.2 insecurity.java
--- gnu/testlet/java/lang/ThreadGroup/insecurity.java	27 Jun 2006 09:54:43 -0000	1.2
+++ gnu/testlet/java/lang/ThreadGroup/insecurity.java	27 Jun 2006 12:20:54 -0000
@@ -24,7 +24,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class insecurity implements Testlet
 {
@@ -49,7 +49,7 @@
       testThread.start();
       testThread.join();
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
@@ -75,7 +75,7 @@
 	
 	Permission[] noChecks = new Permission[0];
 
-	TestSecurityManager2 sm = new TestSecurityManager2(harness);
+	TestSecurityManager sm = new TestSecurityManager(harness);
 	try {
 	  sm.install();
 
@@ -85,7 +85,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    new ThreadGroup("test");
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -98,7 +98,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    new ThreadGroup(testGroup, "test");
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -110,7 +110,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    testGroup.checkAccess();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -123,7 +123,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    testGroup.enumerate(new Thread[0]);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -137,7 +137,7 @@
 	    try {
 	      sm.prepareChecks(noChecks);
 	      testGroup.enumerate(new Thread[0], i == 1);
-	      sm.checkAllChecked(harness);
+	      sm.checkAllChecked();
 	    }
 	    catch (SecurityException ex) {
 	      harness.debug(ex);
@@ -151,7 +151,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    testGroup.enumerate(new ThreadGroup[0]);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -165,7 +165,7 @@
 	    try {
 	      sm.prepareChecks(noChecks);
 	      testGroup.enumerate(new ThreadGroup[0], i == 1);
-	      sm.checkAllChecked(harness);
+	      sm.checkAllChecked();
 	    }
 	    catch (SecurityException ex) {
 	      harness.debug(ex);
@@ -178,7 +178,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    nonSystemGroup.getParent();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -190,7 +190,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    testGroup.setDaemon(false);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -203,7 +203,7 @@
 	    int priority = testGroup.getMaxPriority();
 	    sm.prepareChecks(noChecks);
 	    testGroup.setMaxPriority(priority);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -215,7 +215,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    nonSystemGroup.suspend();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -227,7 +227,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    nonSystemGroup.resume();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -239,7 +239,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    nonSystemGroup.interrupt();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -251,7 +251,7 @@
 	  try {
 	    sm.prepareChecks(noChecks);
 	    nonSystemGroup.stop();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -262,7 +262,7 @@
 	  sm.uninstall();
 	}
       }
-      catch (Throwable ex) {
+      catch (Exception ex) {
 	harness.debug(ex);
 	harness.check(false, "Unexpected exception");
       }
Index: gnu/testlet/java/lang/ThreadGroup/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/ThreadGroup/security.java,v
retrieving revision 1.2
diff -u -r1.2 security.java
--- gnu/testlet/java/lang/ThreadGroup/security.java	5 May 2006 12:26:24 -0000	1.2
+++ gnu/testlet/java/lang/ThreadGroup/security.java	27 Jun 2006 12:20:54 -0000
@@ -24,7 +24,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -47,7 +47,7 @@
       testThread.start();
       testThread.join();
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }
@@ -81,7 +81,7 @@
 	  new RuntimePermission("modifyThread"),
 	  new RuntimePermission("stopThread")};
 
-	TestSecurityManager2 sm = new TestSecurityManager2(harness);
+	TestSecurityManager sm = new TestSecurityManager(harness);
 	try {
 	  sm.install();
 
@@ -90,7 +90,7 @@
 	  try {
 	    sm.prepareChecks(modifyThreadGroup);
 	    new ThreadGroup("test");
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -102,7 +102,7 @@
 	  try {
 	    sm.prepareChecks(modifyThreadGroup);
 	    new ThreadGroup(testGroup, "test");
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -114,7 +114,7 @@
 	  try {
 	    sm.prepareChecks(modifyThreadGroup);
 	    testGroup.checkAccess();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -126,7 +126,7 @@
 	  try {
 	    sm.prepareChecks(modifyThreadGroup);
 	    testGroup.enumerate(new Thread[0]);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -139,7 +139,7 @@
 	    try {
 	      sm.prepareChecks(modifyThreadGroup);
 	      testGroup.enumerate(new Thread[0], i == 1);
-	      sm.checkAllChecked(harness);
+	      sm.checkAllChecked();
 	    }
 	    catch (SecurityException ex) {
 	      harness.debug(ex);
@@ -152,7 +152,7 @@
 	  try {
 	    sm.prepareChecks(modifyThreadGroup);
 	    testGroup.enumerate(new ThreadGroup[0]);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -165,7 +165,7 @@
 	    try {
 	      sm.prepareChecks(modifyThreadGroup);
 	      testGroup.enumerate(new ThreadGroup[0], i == 1);
-	      sm.checkAllChecked(harness);
+	      sm.checkAllChecked();
 	    }
 	    catch (SecurityException ex) {
 	      harness.debug(ex);
@@ -178,7 +178,7 @@
 	  try {
 	    sm.prepareChecks(modifyThreadGroup);
 	    nonSystemGroup.getParent();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -190,7 +190,7 @@
 	  try {
 	    sm.prepareChecks(modifyThreadGroup);
 	    testGroup.setDaemon(false);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -203,7 +203,7 @@
 	    int priority = testGroup.getMaxPriority();
 	    sm.prepareChecks(modifyThreadGroup);
 	    testGroup.setMaxPriority(priority);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -213,35 +213,31 @@
 	  // throwpoint: java.lang.ThreadGroup-suspend
 	  harness.checkPoint("suspend");
 	  try {
-	    sm.prepareChecks(modifyThreadGroup, modifyThread, true);
+	    sm.prepareHaltingChecks(modifyThreadGroup, modifyThread);
 	    testGroup.suspend();
-	    harness.check(false, "shouldn't be reached");
+	    harness.check(false);
 	  }
+	  catch (TestSecurityManager.SuccessException ex) {
+	    harness.check(true);
+	  } 
 	  catch (SecurityException ex) {
-	    if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	      harness.check(true);
-	    }
-	    else {
-	      harness.debug(ex);
-	      harness.check(false, "unexpected check");
-	    }
+	    harness.debug(ex);
+	    harness.check(false, "unexpected check");
 	  }
 
 	  // throwpoint: java.lang.ThreadGroup-resume
 	  harness.checkPoint("resume");
 	  try {
-	    sm.prepareChecks(modifyThreadGroup, modifyThread, true);
+	    sm.prepareHaltingChecks(modifyThreadGroup, modifyThread);
 	    testGroup.resume();
-	    harness.check(false, "shouldn't be reached");
+	    harness.check(false);
 	  }
+	  catch (TestSecurityManager.SuccessException ex) {
+	    harness.check(true);
+	  } 
 	  catch (SecurityException ex) {
-	    if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	      harness.check(true);
-	    }
-	    else {
-	      harness.debug(ex);
-	      harness.check(false, "unexpected check");
-	    }
+	    harness.debug(ex);
+	    harness.check(false, "unexpected check");
 	  }
 
 	  // throwpoint: TODO: java.lang.ThreadGroup-destroy
@@ -253,35 +249,31 @@
 	  // throwpoint: java.lang.ThreadGroup-interrupt
 	  harness.checkPoint("interrupt");
 	  try {
-	    sm.prepareChecks(modifyThreadGroup, modifyThread, true);
+	    sm.prepareHaltingChecks(modifyThreadGroup, modifyThread);
 	    testGroup.interrupt();
-	    harness.check(false, "shouldn't be reached");
+	    harness.check(false);
 	  }
+	  catch (TestSecurityManager.SuccessException ex) {
+	    harness.check(true);
+	  } 
 	  catch (SecurityException ex) {
-	    if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	      harness.check(true);
-	    }
-	    else {
-	      harness.debug(ex);
-	      harness.check(false, "unexpected check");
-	    }
+	    harness.debug(ex);
+	    harness.check(false, "unexpected check");
 	  }
 
 	  // throwpoint: java.lang.ThreadGroup-stop
 	  harness.checkPoint("stop");
 	  try {
-	    sm.prepareChecks(modifyThreadGroup, stopThread, true);
+	    sm.prepareHaltingChecks(modifyThreadGroup, stopThread);
 	    testGroup.stop();
-	    harness.check(false, "shouldn't be reached");
+	    harness.check(false);
 	  }
+	  catch (TestSecurityManager.SuccessException ex) {
+	    harness.check(true);
+	  } 
 	  catch (SecurityException ex) {
-	    if (ex.getMessage().equals(TestSecurityManager2.successMessage)) {
-	      harness.check(true);
-	    }
-	    else {
-	      harness.debug(ex);
-	      harness.check(false, "unexpected check");
-	    }
+	    harness.debug(ex);
+	    harness.check(false, "unexpected check");
 	  }
 	}
 	finally {
@@ -297,7 +289,7 @@
 	  try {
 	    sm.prepareChecks(modifyThreadGroup);
 	    nonSystemGroup.destroy();
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -308,14 +300,14 @@
 	  sm.uninstall();
 	}
       }
-      catch (Throwable ex) {
+      catch (Exception ex) {
 	harness.debug(ex);
 	harness.check(false, "Unexpected exception");
       }
     }
   }
 
-  public static class SpecialSecurityManager extends TestSecurityManager2
+  public static class SpecialSecurityManager extends TestSecurityManager
   {
     public SpecialSecurityManager(TestHarness harness)
     {
Index: gnu/testlet/java/lang/reflect/AccessibleObject/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/reflect/AccessibleObject/security.java,v
retrieving revision 1.1
diff -u -r1.1 security.java
--- gnu/testlet/java/lang/reflect/AccessibleObject/security.java	21 Jun 2006 10:02:08 -0000	1.1
+++ gnu/testlet/java/lang/reflect/AccessibleObject/security.java	27 Jun 2006 12:20:54 -0000
@@ -30,7 +30,7 @@
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;
-import gnu.testlet.TestSecurityManager2;
+import gnu.testlet.TestSecurityManager;
 
 public class security implements Testlet
 {
@@ -84,7 +84,7 @@
       Permission[] suppressAccessChecks = new Permission[] {
  	new ReflectPermission("suppressAccessChecks")};
 
-      TestSecurityManager2 sm = new TestSecurityManager2(harness);
+      TestSecurityManager sm = new TestSecurityManager(harness);
       try {
 	sm.install();
 
@@ -94,7 +94,7 @@
 	  try {
 	    sm.prepareChecks(suppressAccessChecks);
 	    objects[i].setAccessible(true);
-	    sm.checkAllChecked(harness);
+	    sm.checkAllChecked();
 	  }
 	  catch (SecurityException ex) {
 	    harness.debug(ex);
@@ -109,7 +109,7 @@
 	  harness.check(false);
 	}
 	catch (SecurityException ex) {
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 
 	// throwpoint: java.lang.reflect.AccessibleObject-setAccessible(AccessibleObject[], boolean)
@@ -117,7 +117,7 @@
 	try {
 	  sm.prepareChecks(suppressAccessChecks);
 	  AccessibleObject.setAccessible(objects, true);
-	  sm.checkAllChecked(harness);
+	  sm.checkAllChecked();
 	}
 	catch (SecurityException ex) {
 	  harness.debug(ex);
@@ -128,7 +128,7 @@
 	sm.uninstall();
       }
     }
-    catch (Throwable ex) {
+    catch (Exception ex) {
       harness.debug(ex);
       harness.check(false, "Unexpected exception");
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-27 12:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-27 12:48 FYI: Monster throwpoint checks refactoring Gary Benson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).