Path: blob/master/test/jdk/com/sun/jdi/CommandCommentDelimiter.java
41152 views
/*1* Copyright (c) 2004, 2018, 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*/2223/*24* @test25* @bug 450708826* @summary TTY: Add a comment delimiter to the jdb command set27* @comment converted from test/jdk/com/sun/jdi/CommandCommentDelimiter.sh28*29* @library /test/lib30* @build CommandCommentDelimiter31* @run main/othervm CommandCommentDelimiter32*/3334import jdk.test.lib.process.OutputAnalyzer;35import lib.jdb.JdbCommand;36import lib.jdb.JdbTest;3738class CommandCommentDelimiterTarg {39public static void main(String args[]) {40System.out.print ("Hello");41System.out.print (", ");42System.out.print ("world");43System.out.println("!");44}45}464748public class CommandCommentDelimiter extends JdbTest {49public static void main(String argv[]) {50new CommandCommentDelimiter().run();51}5253private CommandCommentDelimiter() {54super(DEBUGGEE_CLASS);55}5657private static final String DEBUGGEE_CLASS = CommandCommentDelimiterTarg.class.getName();5859@Override60protected void runCases() {61jdb.command(JdbCommand.stopIn(DEBUGGEE_CLASS, "main"));62jdb.command(JdbCommand.run());6364jdb.command(JdbCommand.step());65jdb.command("#");66jdb.command("#foo");67jdb.command("3 #blah");68jdb.command("# connectors");69jdb.command(JdbCommand.step());7071jdb.contToExit(1);7273new OutputAnalyzer(getJdbOutput())74.shouldNotContain("Unrecognized command: '#'. Try help...")75.shouldNotContain("Available connectors are");76}7778}798081