Package java.util

Examples of java.util.Scanner.match()


        Pattern statLinePattern = Pattern.compile(regex);
        Scanner scanner = new Scanner(new File("target/statisticsLog-timeslicebug.log"));

        int totalCount = 0;
        while (scanner.findWithinHorizon(statLinePattern, 0) != null) {
            totalCount += Integer.parseInt(scanner.match().group(1));
        }
        assertEquals(testThreads.length * TestLoggingThread.STOP_WATCH_COUNT, totalCount);
    }

    //test for http://jira.codehaus.org/browse/PERFFORJ-22
View Full Code Here


  public void ParseReport(File report, String charset, String reportRegEx, List<Warning> warnings) throws java.io.FileNotFoundException {
    Scanner scanner = new Scanner(report, charset);
    Pattern p = Pattern.compile(reportRegEx, Pattern.MULTILINE);
    CxxUtils.LOG.debug("Using pattern : '" + p.toString() + "'");
    while (scanner.findWithinHorizon(p, 0) != null) {
      String filename = scanner.match().group(1);
      String line = scanner.match().group(2);
      String msg = scanner.match().group(3);
      String id = scanner.match().group(4).replaceAll("=$", "");
      CxxUtils.LOG.debug("Scanner-matches file='" + filename + "' line='" + line + "' id='" + id + "' msg=" + msg);
      warnings.add(new Warning(filename, line, id, msg));
View Full Code Here

    Scanner scanner = new Scanner(report, charset);
    Pattern p = Pattern.compile(reportRegEx, Pattern.MULTILINE);
    CxxUtils.LOG.debug("Using pattern : '" + p.toString() + "'");
    while (scanner.findWithinHorizon(p, 0) != null) {
      String filename = scanner.match().group(1);
      String line = scanner.match().group(2);
      String msg = scanner.match().group(3);
      String id = scanner.match().group(4).replaceAll("=$", "");
      CxxUtils.LOG.debug("Scanner-matches file='" + filename + "' line='" + line + "' id='" + id + "' msg=" + msg);
      warnings.add(new Warning(filename, line, id, msg));
    }
View Full Code Here

    Pattern p = Pattern.compile(reportRegEx, Pattern.MULTILINE);
    CxxUtils.LOG.debug("Using pattern : '" + p.toString() + "'");
    while (scanner.findWithinHorizon(p, 0) != null) {
      String filename = scanner.match().group(1);
      String line = scanner.match().group(2);
      String msg = scanner.match().group(3);
      String id = scanner.match().group(4).replaceAll("=$", "");
      CxxUtils.LOG.debug("Scanner-matches file='" + filename + "' line='" + line + "' id='" + id + "' msg=" + msg);
      warnings.add(new Warning(filename, line, id, msg));
    }
    scanner.close();
View Full Code Here

    CxxUtils.LOG.debug("Using pattern : '" + p.toString() + "'");
    while (scanner.findWithinHorizon(p, 0) != null) {
      String filename = scanner.match().group(1);
      String line = scanner.match().group(2);
      String msg = scanner.match().group(3);
      String id = scanner.match().group(4).replaceAll("=$", "");
      CxxUtils.LOG.debug("Scanner-matches file='" + filename + "' line='" + line + "' id='" + id + "' msg=" + msg);
      warnings.add(new Warning(filename, line, id, msg));
    }
    scanner.close();
  }
View Full Code Here

  public void ParseReport(File report, String charset, String reportRegEx, List<Warning> warnings) throws java.io.FileNotFoundException {
    Scanner scanner = new Scanner(report, charset);
    Pattern p = Pattern.compile(reportRegEx, Pattern.MULTILINE);
    CxxUtils.LOG.debug("Using pattern : '" + p.toString() + "'");
    while (scanner.findWithinHorizon(p, 0) != null) {
      String filename = scanner.match().group(1);
      String line = scanner.match().group(2);
      String id = scanner.match().group(3);
      String msg = scanner.match().group(4);
      CxxUtils.LOG.debug("Scanner-matches file='" + filename + "' line='" + line + "' id='" + id + "' msg=" + msg);
      warnings.add(new Warning(filename, line, id, msg));
View Full Code Here

    Scanner scanner = new Scanner(report, charset);
    Pattern p = Pattern.compile(reportRegEx, Pattern.MULTILINE);
    CxxUtils.LOG.debug("Using pattern : '" + p.toString() + "'");
    while (scanner.findWithinHorizon(p, 0) != null) {
      String filename = scanner.match().group(1);
      String line = scanner.match().group(2);
      String id = scanner.match().group(3);
      String msg = scanner.match().group(4);
      CxxUtils.LOG.debug("Scanner-matches file='" + filename + "' line='" + line + "' id='" + id + "' msg=" + msg);
      warnings.add(new Warning(filename, line, id, msg));
    }
View Full Code Here

    Pattern p = Pattern.compile(reportRegEx, Pattern.MULTILINE);
    CxxUtils.LOG.debug("Using pattern : '" + p.toString() + "'");
    while (scanner.findWithinHorizon(p, 0) != null) {
      String filename = scanner.match().group(1);
      String line = scanner.match().group(2);
      String id = scanner.match().group(3);
      String msg = scanner.match().group(4);
      CxxUtils.LOG.debug("Scanner-matches file='" + filename + "' line='" + line + "' id='" + id + "' msg=" + msg);
      warnings.add(new Warning(filename, line, id, msg));
    }
    scanner.close();
View Full Code Here

    CxxUtils.LOG.debug("Using pattern : '" + p.toString() + "'");
    while (scanner.findWithinHorizon(p, 0) != null) {
      String filename = scanner.match().group(1);
      String line = scanner.match().group(2);
      String id = scanner.match().group(3);
      String msg = scanner.match().group(4);
      CxxUtils.LOG.debug("Scanner-matches file='" + filename + "' line='" + line + "' id='" + id + "' msg=" + msg);
      warnings.add(new Warning(filename, line, id, msg));
    }
    scanner.close();
  }
View Full Code Here

        assertNull(result);

        s = new Scanner("abcd1234test\n");
        result = s.findInLine(Pattern.compile("\\p{Lower}+"));
        assertEquals("abcd", result);
        matchResult = s.match();
        assertEquals(0, matchResult.start());
        assertEquals(4, matchResult.end());

        result = s.findInLine(Pattern.compile("\\p{Digit}{5}"));
        assertNull(result);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.