< prev index next >

test/com/sun/tools/attach/TempDirTest.java

Print this page
rev 11832 : 8078896: Add @modules as needed to the jdk_svc tests
Reviewed-by: alanb, mchung
   1 /*
   2  * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   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 import com.sun.tools.attach.*;
  25 
  26 import java.nio.file.Files;
  27 import java.nio.file.Path;
  28 import java.util.Properties;
  29 import java.util.List;
  30 import java.io.File;
  31 
  32 import jdk.testlibrary.OutputAnalyzer;
  33 import jdk.testlibrary.ProcessTools;
  34 import jdk.testlibrary.ProcessThread;
  35 
  36 /*
  37  * @test
  38  * @bug 8033104
  39  * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
  40  * @library /lib/testlibrary


  41  * @run build jdk.testlibrary.* Application RunnerUtil
  42  * @run main/timeout=200 TempDirTest
  43  */
  44 
  45 /*
  46  * This test runs with an extra long timeout since it takes a really long time with -Xcomp
  47  * when starting many processes.
  48  */
  49 
  50 public class TempDirTest {
  51 
  52     private static long startTime;
  53 
  54     public static void main(String args[]) throws Throwable {
  55 
  56         startTime = System.currentTimeMillis();
  57 
  58         Path clientTmpDir = Files.createTempDirectory("TempDirTest-client");
  59         clientTmpDir.toFile().deleteOnExit();
  60         Path targetTmpDir = Files.createTempDirectory("TempDirTest-target");


   1 /*
   2  * Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   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 import com.sun.tools.attach.*;
  25 
  26 import java.nio.file.Files;
  27 import java.nio.file.Path;
  28 import java.util.Properties;
  29 import java.util.List;
  30 import java.io.File;
  31 
  32 import jdk.testlibrary.OutputAnalyzer;
  33 import jdk.testlibrary.ProcessTools;
  34 import jdk.testlibrary.ProcessThread;
  35 
  36 /*
  37  * @test
  38  * @bug 8033104
  39  * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
  40  * @library /lib/testlibrary
  41  * @modules java.management
  42  *          jdk.jartool/sun.tools.jar
  43  * @run build jdk.testlibrary.* Application RunnerUtil
  44  * @run main/timeout=200 TempDirTest
  45  */
  46 
  47 /*
  48  * This test runs with an extra long timeout since it takes a really long time with -Xcomp
  49  * when starting many processes.
  50  */
  51 
  52 public class TempDirTest {
  53 
  54     private static long startTime;
  55 
  56     public static void main(String args[]) throws Throwable {
  57 
  58         startTime = System.currentTimeMillis();
  59 
  60         Path clientTmpDir = Files.createTempDirectory("TempDirTest-client");
  61         clientTmpDir.toFile().deleteOnExit();
  62         Path targetTmpDir = Files.createTempDirectory("TempDirTest-target");


< prev index next >