One jcmd and two jps tests fail if there is another VM on the system running a .war file, something that can easily happen when the tests are run via a CI system. Thanks to Staffan Larsen for diagnosing this one. So I'd like to change the awk scripts used by these tests so that they tolerate war files. The proposed patch is attached.

Thanks,

-Alan



diff --git a/test/sun/tools/jcmd/jcmd_Output1.awk b/test/sun/tools/jcmd/jcmd_Output1.awk
--- a/test/sun/tools/jcmd/jcmd_Output1.awk
+++ b/test/sun/tools/jcmd/jcmd_Output1.awk
@@ -8,10 +8,10 @@
         current=1;
     }

-# or match on a path name to a jar file followed by arbitraty arguments
+# or match on a path name to a jar or war file followed by arbitraty arguments # - note, jar files ending with ".jar" is only a convention, not a requirement.
 #Theoretically, any valid file name could occur here.
-/^[0-9]+ .*\.jar($| .*$)/    {
+/^[0-9]+ .*\.(jar|war)($| .*$)/    {
         current=1;
 }

diff --git a/test/sun/tools/jps/jps-l_Output1.awk b/test/sun/tools/jps/jps-l_Output1.awk
--- a/test/sun/tools/jps/jps-l_Output1.awk
+++ b/test/sun/tools/jps/jps-l_Output1.awk
@@ -8,10 +8,10 @@
         matched++;
     }

-# or match on a jar file name - note, jar files ending with
+# or match on a jar or war file name - note, jar files ending with
 # ".jar" is only a convention , not a requirement. Theoretically,
 # any valid file name could occur here.
-/^[0-9]+ .*\.jar$/    {
+/^[0-9]+ .*\.(jar|war)$/    {
         matched++;
 }

diff --git a/test/sun/tools/jps/jps_Output1.awk b/test/sun/tools/jps/jps_Output1.awk
--- a/test/sun/tools/jps/jps_Output1.awk
+++ b/test/sun/tools/jps/jps_Output1.awk
@@ -8,10 +8,10 @@
         matched++;
     }

-# or match on a path name to a jar file - note, jar files ending with
+# or match on a path name to a jar or war file - note, jar files ending with
 # ".jar" is only a convention, not a requirement. Theoretically,
 # any valid file name could occur here.
-/^[0-9]+ .*\.jar$/    {
+/^[0-9]+ .*\.(jar|war)$/    {
         matched++;
 }


Reply via email to