< prev index next >

test/jdk/sun/tools/jcmd/TestJcmdDefaults.java

Print this page
rev 51638 : [mq]: 8210112
rev 51639 : [mq]: 8210112-1

@@ -21,27 +21,27 @@
  * questions.
  */
 
 import static jdk.testlibrary.Asserts.*;
 
-import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.List;
 
-import jdk.testlibrary.OutputAnalyzer;
+import jdk.test.lib.process.OutputAnalyzer;
 import jdk.testlibrary.Utils;
 
 /*
  * @test
  * @bug 7104647
  * @summary Unit test for jcmd utility. Tests jcmd options which do not send
  * requests to a specific JVM process.
  *
  * @library /lib/testlibrary
+ * @library /test/lib
  *
  * @build jdk.testlibrary.*
  * @run main TestJcmdDefaults
  */
 public class TestJcmdDefaults {

@@ -88,16 +88,13 @@
      * The output should look like:
      * 12246 sun.tools.jcmd.JCmd
      * 24428 com.sun.javatest.regtest.MainWrapper /tmp/jtreg/jtreg-workdir/classes/sun/tools/jcmd/TestJcmdDefaults.jta
      *
      * @param output The generated output from the jcmd.
-     * @throws Exception
      */
-    private static void matchListedProcesses(OutputAnalyzer output) throws Exception {
-        int matchedCount = output.shouldMatchByLine(JCMD_LIST_REGEX);
-        assertGreaterThan(matchedCount , 0,
-                "Found no lines matching pattern: " + JCMD_LIST_REGEX);
+    private static void matchListedProcesses(OutputAnalyzer output) {
+        output.shouldMatchByLine(JCMD_LIST_REGEX);
     }
 
     private static void verifyOutputAgainstFile(OutputAnalyzer output) throws IOException {
         Path path = Paths.get(TEST_SRC, "usage.out");
         List<String> fileOutput = Files.readAllLines(path);
< prev index next >