Path: blob/master/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java
41149 views
/*1* Copyright (c) 2017, 2020, 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.ArrayList;24import java.util.HashMap;25import java.util.List;26import java.util.Map;2728import jdk.test.lib.apps.LingeredApp;29import jdk.test.lib.Utils;30import jtreg.SkippedException;3132/**33* @test34* @bug 819165835* @summary Test clhsdb jhisto command36* @requires vm.hasSA37* @library /test/lib38* @run main/othervm ClhsdbJhisto39*/4041public class ClhsdbJhisto {4243public static void main(String[] args) throws Exception {44System.out.println("Starting ClhsdbJhisto test");4546LingeredAppWithInterface theApp = null;47try {48ClhsdbLauncher test = new ClhsdbLauncher();4950theApp = new LingeredAppWithInterface();51LingeredApp.startApp(theApp);52System.out.println("Started LingeredApp with pid " + theApp.getPid());5354List<String> cmds = List.of("jhisto");5556Map<String, List<String>> expStrMap = new HashMap<>();57expStrMap.put("jhisto", List.of(58"java.lang.String",59"java.util.HashMap",60"java.lang.Class",61"java.nio.HeapByteBuffer",62"java.net.URI",63"LingeredAppWithInterface",64"ParselTongue"));6566test.run(theApp.getPid(), cmds, expStrMap, null);67} catch (SkippedException se) {68throw se;69} catch (Exception ex) {70throw new RuntimeException("Test ERROR " + ex, ex);71} finally {72LingeredApp.stopApp(theApp);73}74System.out.println("Test PASSED");75}76}777879