test/serviceability/attach/AttachWithStalePidFile.java

Print this page
rev 6486 : 8043915: Tests get ClassNotFoundException: com.oracle.java.testlibrary.StreamPumper


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 7162400
  27  * @key regression
  28  * @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
  29  * @library /testlibrary
  30  * @compile AttachWithStalePidFileTarget.java
  31  * @run main AttachWithStalePidFile
  32  */
  33 
  34 import com.oracle.java.testlibrary.*;
  35 import com.sun.tools.attach.VirtualMachine;
  36 import sun.tools.attach.HotSpotVirtualMachine;
  37 import java.lang.reflect.Field;
  38 import java.nio.file.*;
  39 import java.nio.file.attribute.*;
  40 import java.io.*;
  41 
  42 public class AttachWithStalePidFile {
  43   public static void main(String... args) throws Exception {
  44 
  45     // this test is only valid on non-Windows platforms
  46     if(Platform.isWindows()) {
  47       System.out.println("This test is only valid on non-Windows platforms.");
  48       return;
  49     }
  50 




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 7162400
  27  * @key regression
  28  * @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
  29  * @library /testlibrary
  30  * @build com.oracle.java.testlibrary.* AttachWithStalePidFileTarget
  31  * @run main AttachWithStalePidFile
  32  */
  33 
  34 import com.oracle.java.testlibrary.*;
  35 import com.sun.tools.attach.VirtualMachine;
  36 import sun.tools.attach.HotSpotVirtualMachine;
  37 import java.lang.reflect.Field;
  38 import java.nio.file.*;
  39 import java.nio.file.attribute.*;
  40 import java.io.*;
  41 
  42 public class AttachWithStalePidFile {
  43   public static void main(String... args) throws Exception {
  44 
  45     // this test is only valid on non-Windows platforms
  46     if(Platform.isWindows()) {
  47       System.out.println("This test is only valid on non-Windows platforms.");
  48       return;
  49     }
  50