示例#1
0
    WebXmlParser(ReadableArchive archive) throws XMLStreamException, IOException {

      if (archive.exists(getXmlFileName())) {
        try (InputStream is = archive.getEntry(getXmlFileName())) {
          init(is);
        } catch (Throwable t) {
          String msg =
              localStrings.getLocalString(
                  "web.deployment.exception_parsing_webxml",
                  "Error in parsing {0} for archive [{1}]: {2}",
                  getXmlFileName(),
                  archive.getURI(),
                  t.getMessage());
          throw new RuntimeException(msg);
        }
      }
    }
示例#2
0
 protected void assertException(Throwable e, String match) {
   String msg = e.getMessage();
   String lmsg = msg.toLowerCase();
   String lmatch = match.toLowerCase();
   if (lmsg.indexOf(lmatch) < 0) {
     fail(
         "Expected an exception with sub-string \""
             + match
             + "\": got one with message \""
             + msg
             + "\"");
   }
 }