9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 jdk.test.lib.* AttachWithStalePidFileTarget
31 * @run main AttachWithStalePidFile
32 */
33
34 import jdk.test.lib.*;
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;
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 * @modules jdk.attach/sun.tools.attach
30 * @library /testlibrary
31 * @build jdk.test.lib.* AttachWithStalePidFileTarget
32 * @run main AttachWithStalePidFile
33 */
34
35 import jdk.test.lib.*;
36 import com.sun.tools.attach.VirtualMachine;
37 import sun.tools.attach.HotSpotVirtualMachine;
38 import java.lang.reflect.Field;
39 import java.nio.file.*;
40 import java.nio.file.attribute.*;
41 import java.io.*;
42
43 public class AttachWithStalePidFile {
44 public static void main(String... args) throws Exception {
45
46 // this test is only valid on non-Windows platforms
47 if(Platform.isWindows()) {
48 System.out.println("This test is only valid on non-Windows platforms.");
49 return;
|