Path: blob/master/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java
41152 views
/*1* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223import java.util.HashMap;24import java.util.List;25import java.util.Map;2627import jdk.test.lib.apps.LingeredApp;28import jtreg.SkippedException;2930/**31* @test32* @bug 819019833* @summary Test clhsdb where command34* @requires vm.hasSA35* @library /test/lib36* @run main/othervm ClhsdbWhere37*/3839public class ClhsdbWhere {4041public static void main(String[] args) throws Exception {42System.out.println("Starting ClhsdbWhere test");4344LingeredApp theApp = null;45try {46ClhsdbLauncher test = new ClhsdbLauncher();47theApp = LingeredApp.startApp();48System.out.println("Started LingeredApp with pid " + theApp.getPid());4950List<String> cmds = List.of("where -a");5152Map<String, List<String>> expStrMap = new HashMap<>();53expStrMap.put("where -a", List.of(54"Java Stack Trace for Service Thread",55"Java Stack Trace for Common-Cleaner",56"Java Stack Trace for Sweeper thread",57"CompilerThread",58"Java Stack Trace for Finalizer",59"Java Stack Trace for Signal Dispatcher",60"Java Stack Trace for Reference Handler",61"Java Stack Trace for SteadyStateThread",62"private static void steadyState"));6364test.run(theApp.getPid(), cmds, expStrMap, null);65} catch (SkippedException se) {66throw se;67} catch (Exception ex) {68throw new RuntimeException("Test ERROR " + ex, ex);69} finally {70LingeredApp.stopApp(theApp);71}7273System.out.println("Test PASSED");74}75}767778