< prev index next >

test/hotspot/jtreg/serviceability/dcmd/thread/ThreadDumpToFileTest.java

Print this page
*** 25,11 ***
   * @test
   * @bug 8284161 8287008
   * @summary Basic test for jcmd Thread.dump_to_file
   * @modules jdk.jcmd
   * @library /test/lib
!  * @run junit/othervm ThreadDumpToFileTest
   */
  
  import java.io.IOException;
  import java.nio.file.Files;
  import java.nio.file.Path;
--- 25,12 ---
   * @test
   * @bug 8284161 8287008
   * @summary Basic test for jcmd Thread.dump_to_file
   * @modules jdk.jcmd
   * @library /test/lib
!  * @run junit/othervm -Dminify=true ThreadDumpToFileTest
+  * @run junit/othervm -Dminify=false ThreadDumpToFileTest
   */
  
  import java.io.IOException;
  import java.nio.file.Files;
  import java.nio.file.Path;

*** 37,13 ***
--- 38,20 ---
  import jdk.test.lib.dcmd.PidJcmdExecutor;
  import jdk.test.lib.process.OutputAnalyzer;
  import jdk.test.lib.threaddump.ThreadDump;
  
  import org.junit.jupiter.api.Test;
+ import org.junit.jupiter.api.BeforeAll;
  import static org.junit.jupiter.api.Assertions.*;
  
  class ThreadDumpToFileTest {
+     private static boolean minify;
+ 
+     @BeforeAll
+     static void setup() throws Exception {
+         minify = Boolean.getBoolean("minify");
+     }
  
      /**
       * Test thread dump, should be in plain text format.
       */
      @Test

*** 153,10 ***
--- 161,13 ---
      private OutputAnalyzer jcmdThreadDumpToFile(Path file, String... options) {
          String cmd = "Thread.dump_to_file";
          for (String option : options) {
              cmd += " " + option;
          }
+         if (minify) {
+             cmd += " -minify";
+         }
          return new PidJcmdExecutor().execute(cmd + " " + file);
      }
  
      /**
       * Returns true if the given file contains a line with the string.
< prev index next >