1 /* 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package uncommontrap; 25 26 import java.io.FileReader; 27 import java.io.IOException; 28 import java.nio.file.Files; 29 import java.nio.file.Path; 30 import java.nio.file.Paths; 31 import java.util.Iterator; 32 import java.util.List; 33 import java.util.Properties; 34 import java.util.regex.Pattern; 35 36 import com.oracle.java.testlibrary.Asserts; 37 /** 38 * Utility tool aimed to verify presence or absence of specified uncommon trap 39 * in compilation log. 40 */ 41 public class Verifier { 42 public static final String PROPERTIES_FILE_SUFFIX = ".verify.properties"; 43 public static final String VERIFICATION_SHOULD_BE_SKIPPED 44 = "uncommon.trap.verification.skipped"; 45 public static final String UNCOMMON_TRAP_NAME = "uncommon.trap.name"; 46 public static final String UNCOMMON_TRAP_BCI = "uncommon.trap.bci"; 47 public static final String UNCOMMON_TRAP_COMMENT = "uncommon.trap.comment"; 48 public static final String UNCOMMON_TRAP_ACTION = "uncommon.trap.action"; 49 public static final String UNCOMMON_TRAP_SHOULD_EMITTED 50 = "uncommon.trap.emitted"; 51 public static final String UNCOMMON_TRAP_SHOULD_FIRED 52 = "uncommon.trap.fired"; 53 54 private static final String EMITTED_TRAP_PATTERN 55 = "<uncommon_trap bci='%s' reason='%s' action='%s' " 56 + "comment='%s'"; | 1 /* 2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package uncommontrap; 25 26 import java.io.FileReader; 27 import java.io.IOException; 28 import java.nio.file.Files; 29 import java.nio.file.Path; 30 import java.nio.file.Paths; 31 import java.util.Iterator; 32 import java.util.List; 33 import java.util.Properties; 34 import java.util.regex.Pattern; 35 36 import jdk.test.lib.Asserts; 37 /** 38 * Utility tool aimed to verify presence or absence of specified uncommon trap 39 * in compilation log. 40 */ 41 public class Verifier { 42 public static final String PROPERTIES_FILE_SUFFIX = ".verify.properties"; 43 public static final String VERIFICATION_SHOULD_BE_SKIPPED 44 = "uncommon.trap.verification.skipped"; 45 public static final String UNCOMMON_TRAP_NAME = "uncommon.trap.name"; 46 public static final String UNCOMMON_TRAP_BCI = "uncommon.trap.bci"; 47 public static final String UNCOMMON_TRAP_COMMENT = "uncommon.trap.comment"; 48 public static final String UNCOMMON_TRAP_ACTION = "uncommon.trap.action"; 49 public static final String UNCOMMON_TRAP_SHOULD_EMITTED 50 = "uncommon.trap.emitted"; 51 public static final String UNCOMMON_TRAP_SHOULD_FIRED 52 = "uncommon.trap.fired"; 53 54 private static final String EMITTED_TRAP_PATTERN 55 = "<uncommon_trap bci='%s' reason='%s' action='%s' " 56 + "comment='%s'"; |