[jboss-remoting-commits] JBoss Remoting SVN: r3925 - remoting2/branches/2.x/src/tests/org/jboss/ant/taskdefs.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Thu Apr 10 16:17:37 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-10 16:17:37 -0400 (Thu, 10 Apr 2008)
New Revision: 3925

Modified:
   remoting2/branches/2.x/src/tests/org/jboss/ant/taskdefs/XMLJUnitMultipleResultFormatter.java
Log:
JBREM-920, JBREM-934: Put super.startTestSuite() in AccessController.doPrivileged() call.

Modified: remoting2/branches/2.x/src/tests/org/jboss/ant/taskdefs/XMLJUnitMultipleResultFormatter.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/ant/taskdefs/XMLJUnitMultipleResultFormatter.java	2008-04-10 20:16:18 UTC (rev 3924)
+++ remoting2/branches/2.x/src/tests/org/jboss/ant/taskdefs/XMLJUnitMultipleResultFormatter.java	2008-04-10 20:17:37 UTC (rev 3925)
@@ -22,6 +22,10 @@
 
 package org.jboss.ant.taskdefs;
 
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
 import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
 import org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter;
 import org.jboss.remoting.util.SystemUtility;
@@ -32,9 +36,9 @@
 public class XMLJUnitMultipleResultFormatter extends XMLJUnitResultFormatter
 {
 
-   public void startTestSuite(JUnitTest test)
+   public void startTestSuite(final JUnitTest test)
    {
-      String configuration = (String) SystemUtility.getSystemProperty("jboss-junit-configuration");
+      String configuration = SystemUtility.getSystemProperty("jboss-junit-configuration");
 
       // if sys prop is not null, empty, or contain default variable alias
       if(configuration != null && !configuration.trim().equals("") &&
@@ -42,7 +46,21 @@
       {
          test.setName(test.getName() + "(" + configuration + ")");
       }
-
-      super.startTestSuite(test);
+      
+      try
+      {
+          AccessController.doPrivileged( new PrivilegedExceptionAction()
+          {
+             public Object run() throws Exception
+             {
+                XMLJUnitMultipleResultFormatter.super.startTestSuite(test);
+                return null;
+             }
+          });
+      }
+      catch (PrivilegedActionException e)
+      {
+         throw (RuntimeException) e.getCause();
+      }
    }
 }
\ No newline at end of file




More information about the jboss-remoting-commits mailing list