ctornqvi@5256: /* ccheung@6309: * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. ctornqvi@5256: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ctornqvi@5256: * ctornqvi@5256: * This code is free software; you can redistribute it and/or modify it ctornqvi@5256: * under the terms of the GNU General Public License version 2 only, as ctornqvi@5256: * published by the Free Software Foundation. ctornqvi@5256: * ctornqvi@5256: * This code is distributed in the hope that it will be useful, but WITHOUT ctornqvi@5256: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ctornqvi@5256: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ctornqvi@5256: * version 2 for more details (a copy is included in the LICENSE file that ctornqvi@5256: * accompanied this code). ctornqvi@5256: * ctornqvi@5256: * You should have received a copy of the GNU General Public License version ctornqvi@5256: * 2 along with this work; if not, write to the Free Software Foundation, ctornqvi@5256: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ctornqvi@5256: * ctornqvi@5256: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ctornqvi@5256: * or visit www.oracle.com if you need additional information or have any ctornqvi@5256: * questions. ctornqvi@5256: */ ctornqvi@5256: ctornqvi@5256: /* ctornqvi@5256: * @test ctornqvi@5256: * @bug 7167142 ctornqvi@5256: * @summary Warn if unused .hotspot_rc file is present ctornqvi@5256: * @library /testlibrary ctornqvi@5256: */ ctornqvi@5256: ctornqvi@5256: import java.io.PrintWriter; ctornqvi@5256: import com.oracle.java.testlibrary.*; ctornqvi@5256: ctornqvi@5256: public class ConfigFileWarning { ctornqvi@5256: public static void main(String[] args) throws Exception { ccheung@6309: if (Platform.isDebugBuild()) { ctornqvi@5256: System.out.println("Skip on debug builds since we'll always read the file there"); ctornqvi@5256: return; ctornqvi@5256: } ctornqvi@5256: ctornqvi@5256: PrintWriter pw = new PrintWriter(".hotspotrc"); ctornqvi@5256: pw.println("aa"); ctornqvi@5256: pw.close(); ctornqvi@5256: ctornqvi@5256: ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-version"); ctornqvi@5256: OutputAnalyzer output = new OutputAnalyzer(pb.start()); ctornqvi@5256: output.shouldContain("warning: .hotspotrc file is present but has been ignored. Run with -XX:Flags=.hotspotrc to load the file."); ctornqvi@5256: } ctornqvi@5256: }