Examples of Perl5Matcher


Examples of org.apache.oro.text.regex.Perl5Matcher

     * @see org.apache.jmeter.protocol.http.parser.HtmlParser#getEmbeddedResourceURLs(byte[], java.net.URL)
     */
    public Iterator getEmbeddedResourceURLs(byte[] html, URL baseUrl, URLCollection urls)
    {

        Perl5Matcher matcher= (Perl5Matcher)localMatcher.get();
        PatternMatcherInput input= (PatternMatcherInput)localInput.get();
        // TODO: find a way to avoid the cost of creating a String here --
        // probably a new PatternMatcherInput working on a byte[] would do
        // better.
        input.setInput(new String(html));
        while (matcher.contains(input, pattern))
        {
            MatchResult match= matcher.getMatch();
            String s;
            if (log.isDebugEnabled())
                log.debug("match groups " + match.groups());
            // Check for a BASE HREF:
            for (int g=1; g <= NUM_BASE_GROUPS && g <= match.groups(); g++)
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

        // Adapt loggerPattern for oro
        String realLoggerPattern = StringUtils
                .replace(loggerPattern, "" + WILDCARD, "." + WILDCARD);

        Perl5Compiler compiler = new Perl5Compiler();
        Perl5Matcher matcher = new Perl5Matcher();
        Pattern compiled;
        try
        {
            compiled = compiler.compile(realLoggerPattern);
        }
        catch (MalformedPatternException e)
        {
            throw new ApplicationRuntimeException("Malformed Logger Pattern:" + realLoggerPattern);
        }
        return matcher.matches(loggerName, compiled);

    }
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

      }

      try
      {
         // Get the Matcher for this thread
         Perl5Matcher localMatcher = (Perl5Matcher) matcher.get();
         PropertyIterator iter = getTestStrings().iterator();
         while (iter.hasNext())
         {
            String stringPattern = iter.next().getStringValue();
            Pattern pattern =
               patternCache.getPattern(
                  stringPattern,
                  Perl5Compiler.READ_ONLY_MASK);
            boolean found;
            if ((CONTAINS & getTestType()) > 0)
            {
               found = localMatcher.contains(toCheck, pattern);
            }
            else
            {
               found = localMatcher.matches(toCheck, pattern);
            }
            pass = not ? !found : found;
            if (!pass)
            {
               result.setFailure(true);
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.