< prev index next >

test/compiler/testlibrary/uncommontrap/Verifier.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


   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 compiler.testlibrary.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 /**
  39  * Utility tool aimed to verify presence or absence of specified uncommon trap
  40  * in compilation log.
  41  */
  42 public class Verifier {
  43     public static final String PROPERTIES_FILE_SUFFIX = ".verify.properties";
  44     public static final String VERIFICATION_SHOULD_BE_SKIPPED
  45             = "uncommon.trap.verification.skipped";
  46     public static final String UNCOMMON_TRAP_NAME = "uncommon.trap.name";
  47     public static final String UNCOMMON_TRAP_BCI = "uncommon.trap.bci";
  48     public static final String UNCOMMON_TRAP_COMMENT = "uncommon.trap.comment";
  49     public static final String UNCOMMON_TRAP_ACTION = "uncommon.trap.action";
  50     public static final String UNCOMMON_TRAP_SHOULD_EMITTED
  51             = "uncommon.trap.emitted";
  52     public static final String UNCOMMON_TRAP_SHOULD_FIRED
  53             = "uncommon.trap.fired";
  54 
  55     private static final String EMITTED_TRAP_PATTERN
  56             = "<uncommon_trap bci='%s' reason='%s' action='%s' "
  57                     + "comment='%s'";




   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 compiler.testlibrary.uncommontrap;
  25 
  26 import jdk.test.lib.Asserts;
  27 
  28 import java.io.FileReader;
  29 import java.io.IOException;
  30 import java.nio.file.Files;
  31 import java.nio.file.Path;
  32 import java.nio.file.Paths;
  33 import java.util.Iterator;
  34 import java.util.List;
  35 import java.util.Properties;
  36 import java.util.regex.Pattern;
  37 


  38 /**
  39  * Utility tool aimed to verify presence or absence of specified uncommon trap
  40  * in compilation log.
  41  */
  42 public class Verifier {
  43     public static final String PROPERTIES_FILE_SUFFIX = ".verify.properties";
  44     public static final String VERIFICATION_SHOULD_BE_SKIPPED
  45             = "uncommon.trap.verification.skipped";
  46     public static final String UNCOMMON_TRAP_NAME = "uncommon.trap.name";
  47     public static final String UNCOMMON_TRAP_BCI = "uncommon.trap.bci";
  48     public static final String UNCOMMON_TRAP_COMMENT = "uncommon.trap.comment";
  49     public static final String UNCOMMON_TRAP_ACTION = "uncommon.trap.action";
  50     public static final String UNCOMMON_TRAP_SHOULD_EMITTED
  51             = "uncommon.trap.emitted";
  52     public static final String UNCOMMON_TRAP_SHOULD_FIRED
  53             = "uncommon.trap.fired";
  54 
  55     private static final String EMITTED_TRAP_PATTERN
  56             = "<uncommon_trap bci='%s' reason='%s' action='%s' "
  57                     + "comment='%s'";


< prev index next >