Examples of matcher()


Examples of juzu.impl.router.regex.RE.matcher()

public class RegexTestCase extends AbstractTestCase {

  @Test
  public void testLiteral() {
    RE regex = JRegexFactory.INSTANCE.compile("abc");
    RE.Match[] matches = regex.matcher().find("abc");
    assertEquals(1, matches.length);
    assertEquals(0, matches[0].getStart());
    assertEquals(3, matches[0].getEnd());
    assertEquals("abc", matches[0].getValue());
  }
View Full Code Here

Examples of org.apache.wicket.util.parse.metapattern.MetaPattern.matcher()

  @Test
  public void testStandardUrlSegmentPattern()
  {
    MetaPattern pattern = new MetaPattern(AbstractURLSegment.SEGMENT_PARAMETER);

    Matcher matcher = pattern.matcher("");
    assertFalse(matcher.matches());

    matcher = pattern.matcher("seg&ment");
    assertFalse(matcher.matches());
View Full Code Here

Examples of org.apache.wicket.util.parse.metapattern.parsers.TagNameParser.matcher()

    // Get the length of the tagtext
    final int tagTextLength = tagText.length();

    // If we match tagname pattern
    final TagNameParser tagnameParser = new TagNameParser(tagText);
    if (tagnameParser.matcher().lookingAt())
    {
      // Extract the tag from the pattern matcher
      tag.name = tagnameParser.getName();
      tag.namespace = tagnameParser.getNamespace();
View Full Code Here

Examples of org.apache.wicket.util.parse.metapattern.parsers.VariableAssignmentParser.matcher()

        return true;
      }

      // Extract attributes
      final VariableAssignmentParser attributeParser = new VariableAssignmentParser(tagText);
      while (attributeParser.matcher().find(pos))
      {
        // Get key and value using attribute pattern
        String value = attributeParser.getValue();

        // In case like <html xmlns:wicket> will the value be null
View Full Code Here

Examples of org.apache.wink.common.internal.uritemplate.BitWorkingUriTemplateProcessor.matcher()

        assertEquals("instantiate template7", "food()", template7.expand(hashMap));
    }

    public void testUnreservedMatch() {
        UriTemplateProcessor template = new BitWorkingUriTemplateProcessor("/prefix/{varA}");
        UriTemplateMatcher matcher = template.matcher();
        MultivaluedMap<String, String> result = matcher.match("/prefix/a.b");
        assertNotNull("match ok .", result);
        assertEquals("match size .", 1, result.size());
        assertEquals("varA", "a.b", result.getFirst("varA"));
View Full Code Here

Examples of org.apache.wink.common.internal.uritemplate.JaxRsUriTemplateProcessor.matcher()

    }

    public void testMatches() {
        String template = "/path1/{var1}/path2{var2:[ab]*}/tail";
        JaxRsUriTemplateProcessor processor = new JaxRsUriTemplateProcessor(template);
        UriTemplateMatcher matcher = processor.matcher();
        assertEquals(template, processor.getTemplate());

        boolean matches = matcher.matches("/path1/value1/path2/tail");
        assertTrue(matches);
        matches = matcher.matches("/path1/value1/path2ab/tail");
View Full Code Here

Examples of org.apache.wink.common.internal.uritemplate.UriTemplateProcessor.matcher()

        assertEquals("instantiate template7", "food()", template7.expand(hashMap));
    }

    public void testUnreservedMatch() {
        UriTemplateProcessor template = new BitWorkingUriTemplateProcessor("/prefix/{varA}");
        UriTemplateMatcher matcher = template.matcher();
        MultivaluedMap<String, String> result = matcher.match("/prefix/a.b");
        assertNotNull("match ok .", result);
        assertEquals("match size .", 1, result.size());
        assertEquals("varA", "a.b", result.getFirst("varA"));
View Full Code Here

Examples of org.drools.fluent.test.impl.ReflectiveMatcherFactory.matcher()

        imports.add( "org.junit.Assert.assertThat" );
        imports.add( "org.hamcrest.CoreMatchers.is" );
        imports.add( "org.hamcrest.CoreMatchers.equalTo" );
       
        ReflectiveMatcherFactory f = new ReflectiveMatcherFactory(imports);
        ReflectiveMatcherAssert matchAssert = f.assertThat( "p.name", f.matcher( "equalTo", "'yoda'" ) );
       
        Map vars = new HashMap();
        vars.put("p", p);
       
        //matchAssert.eval(vars);
View Full Code Here

Examples of org.drools.simulation.fluent.test.impl.ReflectiveMatcherFactory.matcher()

        imports.add( "org.junit.Assert.assertThat" );
        imports.add( "org.hamcrest.CoreMatchers.is" );
        imports.add( "org.hamcrest.CoreMatchers.equalTo" );
       
        ReflectiveMatcherFactory f = new ReflectiveMatcherFactory(imports);
        ReflectiveMatcherAssert matchAssert = f.assertThat( "p.name", f.matcher( "equalTo", "'yoda'" ) );
       
        Map vars = new HashMap();
        vars.put("p", p);
       
        //matchAssert.eval(vars);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevCommit.matcher()

    makeGrayText(d, styles);
    d.append(LF);
    String msg = commit.getFullMessage();
    Pattern p = Pattern.compile("\n([A-Z](?:[A-Za-z]+-)+by: [^\n]+)"); //$NON-NLS-1$
    if (fill) {
      Matcher spm = p.matcher(msg);
      if (spm.find()) {
        String subMsg = msg.substring(0, spm.end());
        msg = subMsg.replaceAll("([\\w.,; \t])\n(\\w)", "$1 $2") //$NON-NLS-1$ //$NON-NLS-2$
            + msg.substring(spm.end());
      }
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.