changeset 2385:0bea9271a681

Corrected JTreg harness - this tool now accepts "process" flag for "compile" tag.
author ptisnovs
date Mon, 16 May 2011 16:52:29 +0200
parents 5ffa85bf891c
children 280e9959fbea
files ChangeLog test/jtreg/README test/jtreg/com/sun/javatest/regtest/Action.java test/jtreg/com/sun/javatest/regtest/CompileAction.java test/jtreg/com/sun/javatest/regtest/Path.java test/jtreg/com/sun/javatest/regtest/RegressionSecurityManager.java
diffstat 6 files changed, 312 insertions(+), 90 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 05 01:17:33 2011 +0100
+++ b/ChangeLog	Mon May 16 16:52:29 2011 +0200
@@ -1,3 +1,15 @@
+2011-05-16  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* test/jtreg/README:
+	Updated.
+	* test/jtreg/com/sun/javatest/regtest/Path.java:
+	Added.
+	* test/jtreg/com/sun/javatest/regtest/Action.java:
+	* test/jtreg/com/sun/javatest/regtest/CompileAction.java:
+	* test/jtreg/com/sun/javatest/regtest/RegressionSecurityManager.java:
+	Corrected JTreg harness - this tool now accepts "process" flag for
+	"compile" tag.
+
 2011-05-04  Andrew John Hughes  <ahughes@redhat.com>
 
 	* remove-intree-libraries.sh: Renamed.
--- a/test/jtreg/README	Thu May 05 01:17:33 2011 +0100
+++ b/test/jtreg/README	Mon May 16 16:52:29 2011 +0200
@@ -20,7 +20,9 @@
 This version is based on:
 
 - jtharness-oss-4_1_3a-dev
-- jtreg-4_0-src-b02-15_oct_2008
+- jtreg-4_0-src-b02-15_oct_2008 with change backported from                    
+  jtreg-4.1-src-b02_21_may_2010.zip. This change adds support for              
+  option named "process" which can be used along with tag "compile".           
 
 IcedJTReg is distrubuted under the GPLv2.0, like jtreg and jtharness.
 See the documents in the legal directory included in this release.
--- a/test/jtreg/com/sun/javatest/regtest/Action.java	Thu May 05 01:17:33 2011 +0100
+++ b/test/jtreg/com/sun/javatest/regtest/Action.java	Mon May 16 16:52:29 2011 +0200
@@ -300,6 +300,8 @@
         section.setStatus(status);
     } // endAction()
 
+    //----------workarounds-------------------------------------------------------
+
     /**
      * This method pushes the full, constructed command for the action to the
      * log.  The constructed command contains the the action and its arguments
@@ -425,6 +427,13 @@
         EXEC_ERROR_CLEANUP    = "Error while cleaning up threads after test",
         CHECK_PASS            = "Test description appears acceptable",
 
+        // used in:  compile, main
+        SAMEVM_CANT_RESET_SECMGR= "Cannot reset security manager",
+        SAMEVM_CANT_RESET_PROPS = "Cannot reset system properties",
+
+        // used in:compile, main
+        AGENTVM_CANT_GET_VM      = "Cannot get VM for test",
+
         UNEXPECT_SYS_EXIT     = "Unexpected exit from test",
         CANT_FIND_SRC         = "Can't file source file: ",
 
@@ -454,6 +463,8 @@
         BUILD_UP_TO_DATE      = "All files up to date",
         BUILD_SUCC            = "Build successful",
         BUILD_LIB_LIST        = " in directory-list: ",
+        BUILD_FUTURE_SOURCE   = "WARNING: file %s has a modification time in the future: %s",
+        BUILD_FUTURE_SOURCE_2 = "Unexpected results may occur",
 
         // clean
         CLEAN_SUCC            = "Clean successful",
@@ -478,6 +489,8 @@
         COMPILE_PASS          = "Compilation successful",
         COMPILE_FAIL_EXPECT   = "Compilation failed as expected",
         COMPILE_FAIL          = "Compilation failed",
+        COMPILE_CANT_RESET_SECMGR= "Cannot reset security manager",
+        COMPILE_CANT_RESET_PROPS = "Cannot reset system properties",
 
         // ignore
         IGNORE_UNEXPECT_OPTS  = "Unexpected option(s) for `ignore'",
@@ -486,6 +499,11 @@
         IGNORE_TEST_SUPPRESSED   = "@ignore suppressed by command line option",
         IGNORE_TEST_SUPPRESSED_C = "@ignore suppressed by command line option: ",
 
+        // junit
+        JUNIT_NO_DRIVER        = "No JUnit 4 driver (install junit.jar next to jtreg.jar)",
+        JUNIT_NO_CLASSNAME     = "No class provided for `junit'",
+        JUNIT_BAD_MAIN_ARG     = "Bad argument provided for class in `junit'",
+
         // main
         MAIN_NO_CLASSNAME     = "No class provided for `main'",
         MAIN_MANUAL_NO_VAL    = "Arguments to `manual' option not supported: ",
@@ -500,6 +518,8 @@
         MAIN_UNEXPECT_VMOPT   = ": vm option(s) found, need to specify /othervm",
         MAIN_POLICY_WRITE_PROB= "Problems writing new policy file: ",
         MAIN_POLICY_SM_PROB   = "Unable to create new policy file: ",
+        MAIN_CANT_RESET_SECMGR= "Cannot reset security manager",
+        MAIN_CANT_RESET_PROPS = "Cannot reset system properties",
 
         //    runOtherJVM
         MAIN_CANT_WRITE_ARGS  = "Can't write `main' argument file",
--- a/test/jtreg/com/sun/javatest/regtest/CompileAction.java	Thu May 05 01:17:33 2011 +0100
+++ b/test/jtreg/com/sun/javatest/regtest/CompileAction.java	Mon May 16 16:52:29 2011 +0200
@@ -37,6 +37,12 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import com.sun.javatest.Status;
 import com.sun.javatest.TestResult;
@@ -68,7 +74,7 @@
         init(opts, args, reason, script);
         return run();
     } // compile()
-
+    
     /**
      * This method does initial processing of the options and arguments for the
      * action.  Processing is determined by the requirements of run() and
@@ -97,46 +103,48 @@
             throws ParseException {
         this.script = script;
         this.reason = reason;
-
+        
         if (args.length == 0)
             throw new ParseException(COMPILE_NO_CLASSNAME);
-
+        
         for (int i = 0; i < opts.length; i++) {
             String optName  = opts[i][0];
             String optValue = opts[i][1];
-
+            
             if (optName.equals("fail")) {
                 reverseStatus = parseFail(optValue);
             } else if (optName.equals("timeout")) {
                 timeout = parseTimeout(optValue);
             } else if (optName.equals("ref")) {
                 ref = parseRef(optValue);
+            } else if (optName.equals("process")) {
+                process = true;
             } else {
                 throw new ParseException(COMPILE_BAD_OPT + optName);
             }
         }
-
+        
         if (timeout < 0)
             timeout = script.getActionTimeout(0);
-
+        
         // add absolute path name to all the .java files create appropriate
         // class directories
         try {
             for (int i = 0; i < args.length; i++) {
                 String currArg = args[i];
-
+                
                 if (currArg.endsWith(".java")) {
                     // make sure the correct file separator has been used
                     currArg = currArg.replace('/', File.separatorChar);
-
+                    
                     File sourceFile = new File(currArg);
                     if (!sourceFile.isAbsolute())
                         // User must have used @compile, so file must be
                         // in the same directory as the defining file.
-                        args[i] = script.absTestSrcDir() + FILESEP + currArg;
+                        args[i] = new File(script.absTestSrcDir(), currArg).getPath();
 //                  if (!sourceFile.exists())
 //                      throw new ParseException(CANT_FIND_SRC);
-
+                    
                     // set the destination directory only if we've actually
                     // found something to compile
                     if (script.hasEnv()) {
@@ -144,65 +152,72 @@
                         if (!destDir.exists())
                             destDir.mkdirs();
                     }
-
+                    
                 }
-
+                
                 if (currArg.equals("-classpath") || currArg.equals("-cp")) {
                     classpathp = true;
                     // assume the next element provides the classpath, add
                     // test.classes and test.src and lib-list to it
                     if (script.hasEnv()) {
-                        args[i+1] = addPath(args[i+1],
-                                script.absTestClsDir() + PATHSEP +
-                                script.absTestSrcDir() + PATHSEP +
-                                script.absClsLibListStr());
+                        Path p = new Path(args[i+1])
+                                .append(script.absTestClsDir())
+                                .append(script.absTestSrcDir())
+                                .append(script.absClsLibListStr());
+                        args[i+1] = p.toString();
                     }
                     args[i+1] = singleQuoteString(args[i+1]);
                 }
-
+                
                 if (currArg.equals("-d")) {
                     throw new ParseException(COMPILE_OPT_DISALLOW);
                 }
-
+                
                 // note that -sourcepath is only valid for JDK1.2 and beyond
                 if (currArg.equals("-sourcepath")) {
                     sourcepathp = true;
                     // assume the next element provides the sourcepath, add test.src
                     // and lib-list to it
-                    args[i+1] = addPath(args[i+1],
-                            script.absTestSrcDir() + PATHSEP +
-                            script.absSrcLibListStr());
+                    Path p = new Path(args[i+1])
+                            .append(script.absTestSrcDir())
+                            .append(script.absSrcLibListStr());
+                    args[i+1] = p.toString();
                     args[i+1] = singleQuoteString(args[i+1]);
                 }
             }
+
+            // If we didn't set the destination directory, then we must not have
+            // found something ending with ".java" to compile.
+            if (script.hasEnv() && destDir == null) {
+                if (process) {
+                    destDir = script.absTestClsDir();
+                    if (!destDir.exists())
+                        destDir.mkdirs();
+                } else
+                    throw new ParseException(COMPILE_NO_DOT_JAVA);
+            }
         } catch (RegressionScript.TestClassException e) {
             throw new ParseException(e.getMessage());
         }
 
-        // If we didn't set the destination directory, then we must not have
-        // found something ending with ".java" to compile.
-        if (script.hasEnv() && destDir == null) {
-            throw new ParseException(COMPILE_NO_DOT_JAVA);
-        }
-
         this.args = args;
     } // init()
-
+    
     @Override
     public File[] getSourceFiles() {
         List<File> l = new ArrayList<File>();
-
+        
         for (int i = 0; i < args.length; i++) {
             String currArg = args[i];
-
+            
             if (currArg.endsWith(".java")) {
                 l.add(new File(currArg));
             }
         }
-
+        
         return l.toArray(new File[l.size()]);
     }
-
+    
     /**
      * The method that does the work of the action.  The necessary work for the
      * given action is defined by the tag specification.
@@ -227,9 +242,9 @@
      */
     public Status run() throws TestRunException {
         Status status;
-
+        
         section = startAction("compile", args, reason);
-
+        
         // Make sure that all of the .java files we want to compile exist.
         // We could let the compiler handle this, but if we put the extra check
         // here, we get more information in "check" mode.
@@ -240,7 +255,7 @@
                     throw new TestRunException(CANT_FIND_SRC + currArg);
             }
         }
-
+        
         if (script.isCheck()) {
             status = Status.passed(CHECK_PASS);
         } else {
@@ -249,71 +264,73 @@
             else
                 status = runSameJVM();
         }
-
+        
         endAction(status, section);
         return status;
     } // run()
-
+    
     //----------internal methods------------------------------------------------
-
+    
     private Status runOtherJVM() throws TestRunException {
         Status status;
         final boolean jdk11 = script.isJDK11();
         final boolean useCLASSPATHEnv = jdk11;
         final boolean useClassPathOpt = !jdk11;
         final boolean useSourcePathOpt = !jdk11;
-
+        
         // CONSTRUCT THE COMMAND LINE
         List<String> javacOpts = new ArrayList<String>();
-
+        
         // Why JavaTest?
+        Path cp = new Path(script.getJavaTestClassPath(), script.testClassPath());
         if (useCLASSPATHEnv) {
-            javacOpts.add("CLASSPATH=" + script.getJavaTestClassPath() + PATHSEP + script.testClassPath());
+            javacOpts.add("CLASSPATH=" + cp);
         }
-
+        
         javacOpts.add(script.getJavacProg());
-
+        
         javacOpts.addAll(script.getTestToolVMOptions());
-
+        
         javacOpts.addAll(script.getTestCompilerOptions());
-
+        
         javacOpts.add("-d");
         javacOpts.add(destDir.toString());
-
+        
         // JavaTest added, to match CLASSPATH, but not sure why JavaTest required at all
         if (!classpathp && useClassPathOpt) {
             javacOpts.add("-classpath");
-            javacOpts.add(script.getJavaTestClassPath() + PATHSEP + script.testClassPath());
+            javacOpts.add(cp.toString());
         }
-
+        
         if (!sourcepathp && useSourcePathOpt) {
             javacOpts.add("-sourcepath");
             javacOpts.add(script.testSourcePath());
         }
-
+        
+        // Set test.src and test.classes for the benefit of annotation processors
         String[] envVars = script.getEnvVars();
         String[] jcOpts = javacOpts.toArray(new String[javacOpts.size()]);
         String[] cmdArgs = StringArray.append(envVars, jcOpts);
         cmdArgs = StringArray.append(cmdArgs, args);
-
+        
         if (showCmd)
             JTCmd("compile", cmdArgs, section);
-
+        
         // PASS TO PROCESSCOMMAND
         StringWriter outSW = new StringWriter();
         StringWriter errSW = new StringWriter();
         try {
             ProcessCommand cmd = new ProcessCommand();
             cmd.setExecDir(script.absTestScratchDir());
-
+            
             if (timeout > 0)
                 script.setAlarm(timeout*1000);
-
+            
             status = cmd.run(cmdArgs, new PrintWriter(errSW), new  PrintWriter(outSW));
         } finally {
             script.setAlarm(0);
         }
-
+        
         // EVALUATE THE RESULTS
         boolean ok = status.isPassed();
         int st   = status.getType();
@@ -330,7 +347,7 @@
             sr = COMPILE_FAIL;
         }
         status = new Status(st, sr);
-
+        
         String outString = outSW.toString();
         String errString = errSW.toString();
         PrintWriter sysOut = section.createOutput("System.out");
@@ -338,11 +355,11 @@
         try {
             sysOut.write(outString);
             sysErr.write(errString);
-
+            
             // COMPARE OUTPUT TO GOLDENFILE IF REQUIRED
             // tag-spec says that "standard error is redirected to standard out
             // so that /ref can be used."  Simulate this by concatenating streams.
-
+            
             try {
                 if ((ref != null) && (status.getType() == Status.PASSED)) {
                     File refFile = new File(script.absTestSrcDir(), ref);
@@ -361,7 +378,7 @@
             if (sysOut != null) sysOut.close();
             if (sysErr != null) sysErr.close();
         }
-
+        
         return status;
     } // runOtherJVM()
 
@@ -370,86 +387,90 @@
 
         // CONSTRUCT THE COMMAND LINE
         List<String> javacOpts = new ArrayList<String>();
-
+        
         javacOpts.addAll(script.getTestCompilerOptions());
-
-        javacOpts.add("-d");
-        javacOpts.add(destDir.toString());
-
+        
+        if (destDir != null) {
+            javacOpts.add("-d");
+            javacOpts.add(destDir.toString());
+        }
+        
         if (!classpathp) {
             javacOpts.add("-classpath");
             javacOpts.add(script.testClassPath());
         }
-
+        
         if (!sourcepathp) { // must be JDK1.4 or greater, to even run JavaTest 3
             javacOpts.add("-sourcepath");
             javacOpts.add(script.testSourcePath());
         }
-
+        
         String[] jcOpts = javacOpts.toArray(new String[javacOpts.size()]);
         String[] cmdArgs = StringArray.append(jcOpts, args);
-
+        
         if (showCmd)
             JTCmd("compile", cmdArgs, section);
 
         // RUN THE COMPILER
 
+        // RUN THE COMPILER
+        
         // for direct use with JavaCompileCommand
         StringWriter outSW = new StringWriter();
         StringWriter errSW = new StringWriter();
         PrintWriter outPW = new PrintWriter(outSW);
         PrintWriter errPW = new PrintWriter(errSW);
-
+        
         // to catch sysout and syserr
         ByteArrayOutputStream outOS = new ByteArrayOutputStream();
         ByteArrayOutputStream errOS = new ByteArrayOutputStream();
         PrintStream outPS = new PrintStream(outOS);
         PrintStream errPS = new PrintStream(errOS);
-
+        
         PrintStream saveOut = System.out;
         PrintStream saveErr = System.err;
-
+        
         try {
             Status stat = redirectOutput(outPS, errPS);
             if (!stat.isPassed())
                 return stat;
-
+            
             JavaCompileCommand jcc = new JavaCompileCommand();
             if (timeout > 0)
                 script.setAlarm(timeout*1000);
-
+            
             status = jcc.run(cmdArgs, errPW, outPW);
         } finally {
             Status stat = redirectOutput(saveOut, saveErr);
             if (!stat.isPassed())
                 return stat;
-
+            
             script.setAlarm(0);
         }
-
+        
         outPW.close();
         errPW.close();
         outPS.close();
         errPS.close();
-
+        
         String outString = outSW.toString();
         String errString = errSW.toString();
         String stdoutString = outOS.toString();
         String stderrString = errOS.toString();
-
+        
         if (outString.length() > 0) {
             PrintWriter pw = section.createOutput("direct");
             pw.write(outString);
             pw.close();
         }
-
+        
         if (errString.length() > 0) {
             // should never happen -- only if JavaCompilerCommand kicked into verbose mode
             PrintWriter pw = section.createOutput("direct.log");
             pw.write(outString);
             pw.close();
         }
-
+        
         if (stdoutString.length() > 0 || stderrString.length() > 0) {
             // should never happen -- only if somehow using JDK 1.3 (but JavaTest assumes 1.4.2+)
             PrintWriter pwOut = section.createOutput("System.out");
@@ -459,7 +480,7 @@
             pwErr.write(stderrString);
             pwErr.close();
         }
-
+        
         // XXX remember to comment out!
 //      System.out.println("compile command:");
 //      for (int i = 0; i < cmdArgs.length; i++)
@@ -483,11 +504,11 @@
             st   = Status.FAILED;
         }
         status = new Status(st, sr);
-
+        
         // COMPARE OUTPUT TO GOLDENFILE IF REQUIRED
         // tag-spec says that "standard error is redirected to standard out
         // so that /ref can be used."  Simulate this by concatenating streams.
-
+        
         try {
             if ((ref != null) && (status.getType() == Status.PASSED)) {
                 File refFile = new File(script.absTestSrcDir(), ref);
@@ -506,9 +527,9 @@
 
         return status;
     } // runSameJVM()
-
+    
     //----------internal methods------------------------------------------------
-
+    
     /**
      * This method parses the <em>ref</em> action option used by the compile
      * action. It verifies that the indicated reference file exists in the
@@ -528,7 +549,7 @@
             throw new ParseException(COMPILE_CANT_FIND_REF + refFile);
         return value;
     } // parseRef()
-
+    
     /**
      * This method returns a new path which is the appropriate append of the old
      * and new paths.  The new path will have a trailing
@@ -554,7 +575,7 @@
         }
         return newPath;
     } // addPath()
-
+    
     /**
      * Line by line comparison of compile output and a reference file.  If no
      * differences are found, then 0 is returned.  Otherwise, the line number
@@ -573,7 +594,7 @@
                 String s1 = r1.readLine();
                 String s2 = r2.readLine();
                 lineNum++;
-
+                
                 if ((s1 == null) && (s2 == null))
                     return 0;
                 if ((s1 == null) || (s2 == null) || !s1.equals(s2)) {
@@ -585,17 +606,18 @@
             throw new TestRunException(COMPILE_GOLD_READ_PROB + refFile);
         }
     } // compareGoldenFile()
-
+    
     //----------member variables------------------------------------------------
-
+    
     private String[] args;
     private File destDir;
-
+    
     private boolean reverseStatus = false;
     private String  ref = null;
     private int     timeout = -1;
     private boolean classpathp  = false;
     private boolean sourcepathp = false;
-
+    private boolean process = false;
+    
     private TestResult.Section section;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jtreg/com/sun/javatest/regtest/Path.java	Mon May 16 16:52:29 2011 +0200
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.javatest.regtest;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A path, as in a sequence of file system locations, such as directories,
+ * zip files and jar files.
+ */
+public class Path {
+    /**
+     * Create an empty path.
+     */
+    Path() {
+    }
+
+    /**
+     * Create a path containing the concatenation of a series of files.
+     * Equivalent to {@code new Path().append(files)}.
+     * @param files
+     */
+    Path(File... files) {
+        append(files);
+    }
+
+    /**
+     * Create a path containing the concatenation of a series of paths.
+     * Equivalent to {@code new Path().append(paths)}.
+     * @param paths
+     */
+    Path(Path... paths) {
+        append(paths);
+    }
+
+    /**
+     * Create a path containing the concatenation of a series of paths.
+     * Equivalent to {@code new Path().append(paths)}.
+     * @param paths
+     */
+    Path(String... paths) {
+        append(paths);
+    }
+
+    /**
+     * Append a series of files to the path.  Files that do not exist
+     * are ignored.
+     * @param files files to be added to the path
+     * @return the path itself
+     */
+    Path append(File... files) {
+        for (File f: files) {
+            if (f.exists()) {
+                if (value.length() > 0)
+                    value += PATHSEP;
+                value += f.getPath();
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Append a series of paths to the path.
+     * @param paths paths to be added to the path
+     * @return the path itself
+     */
+    Path append(Path... paths) {
+        for (Path p: paths) {
+            if (p.value.length() > 0) {
+                if (value.length() > 0)
+                    value += PATHSEP;
+                value += p.value;
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Append a series of paths to the path.
+     * @param paths paths to be added to the path
+     * @return the path itself
+     */
+    Path append(String... paths) {
+        for (String p: paths) {
+            if (p.length() > 0) {
+                if (value.length() > 0)
+                    value += PATHSEP;
+                value += p;
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Return the series of files that are currently on the path.
+     * @return the files on the path
+     */
+    File[] split() {
+        List<File> v = new ArrayList<File>();
+        for (String s: StringArray.splitSeparator(PATHSEP, value)) {
+            if (s.length() > 0) {
+                v.add(new File(s));
+            }
+        }
+        return v.toArray(new File[v.size()]);
+    }
+
+    /**
+     * Check if this path contains a subpath.
+     * @param path the subpath to be checked
+     * @return true if this path contains the subpath
+     */
+    boolean contains(Path path) {
+        return value.equals(path.value)
+                || value.startsWith(path.value + PATHSEP)
+                || value.endsWith(PATHSEP + path.value)
+                || value.contains(PATHSEP + path.value + PATHSEP);
+    }
+
+    /**
+     * Check if this path is empty.
+     * @return true if this path does not have any files on it
+     */
+    boolean isEmpty() {
+        return (value.length() == 0);
+    }
+
+    /**
+     * Return the string value of this path.
+     * @return the string value of this path
+     */
+    @Override
+    public String toString() {
+        return value;
+    }
+
+    String value = "";
+    private static String PATHSEP = File.pathSeparator;
+}
--- a/test/jtreg/com/sun/javatest/regtest/RegressionSecurityManager.java	Thu May 05 01:17:33 2011 +0100
+++ b/test/jtreg/com/sun/javatest/regtest/RegressionSecurityManager.java	Mon May 16 16:52:29 2011 +0200
@@ -73,6 +73,7 @@
         }
     }
 
+    @Override
     public void checkExec(String cmd) {
         if (allowExec == false) {
             if (verbose) {
@@ -99,6 +100,7 @@
     static private boolean allowExec = true; // no overrides on this one; API control only
 
 
+    @Override
     public void checkPermission(Permission perm) {
         // allow most stuff, but limit as appropriate
         if (perm instanceof RuntimePermission) {