Examples of WildcardMatcher


Examples of org.apache.cocoon.sitemap.matcher.WildcardMatcher

public class WildcardMatcherTest {

    @Test
    public void testMatcher() {
        WildcardMatcher matcher = new WildcardMatcher();
        Map<String, String> result = matcher.match("*/{name}/**/{id}", "abc/def/ghi/jkl/5");
        Assert.assertEquals("A parameter 'name' is expected.", "def", result.get("name"));
        Assert.assertEquals("A parameter 'id' is expected.", "5", result.get("id"));
        Assert.assertEquals("A result value '1' is expected.", "abc", result.get("1"));
        Assert.assertEquals("A result value '2' is expected.", "def", result.get("2"));
        Assert.assertEquals("A result value '3' is expected.", "ghi/jkl", result.get("3"));
View Full Code Here

Examples of org.apache.cocoon.sitemap.matcher.WildcardMatcher

        Assert.assertEquals("A result value '0' is expected.", "abc/def/ghi/jkl/5", result.get("0"));
    }

    @Test
    public void testMatcherWithoutParamters() {
        WildcardMatcher matcher = new WildcardMatcher();
        Map<String, String> result = matcher.match("*/**", "abc/def/ghi/jkl/5");
        Assert.assertEquals("A result value '1' is expected.", "abc", result.get("1"));
        Assert.assertEquals("A result value '2' is expected.", "def/ghi/jkl/5", result.get("2"));
        Assert.assertEquals("A result value '0' is expected.", "abc/def/ghi/jkl/5", result.get("0"));
    }
View Full Code Here

Examples of org.apache.cocoon.sitemap.matcher.WildcardMatcher

        Assert.assertEquals("A result value '0' is expected.", "abc/def/ghi/jkl/5", result.get("0"));
    }

    @Test
    public void testMatcherWithoutWildcards() {
        WildcardMatcher matcher = new WildcardMatcher();
        Map<String, String> result = matcher.match("abc", "abc");
        Assert.assertNull("No matching result", result.get("1"));
        Assert.assertEquals("A result value '0' is expected.", "abc", result.get("0"));
    }
View Full Code Here

Examples of org.apache.cocoon.sitemap.matcher.WildcardMatcher

    }

    @Test
    public void testWrongNamedParameters() {
        try {
            new WildcardMatcher().match("*/{name}{id}", "abc/def/ghi");
            Assert.fail("}{ is not allowed without some character in between "
                    + "because this would be translated into a '**' which has a different meaning");
        } catch (UnsupportedNamedWildcardExpressionException e) {
            // expected
        }
View Full Code Here

Examples of org.apache.cocoon.sitemap.matcher.WildcardMatcher

     */
    protected MatcherContext lookupMatcherContext() {
        // determine the matching type and check if there are conflicting match attributes
        LinkedList<MatcherContext> matcherContextList = new LinkedList<MatcherContext>();
        if (this.pattern != null) {
            matcherContextList.add(new MatcherContext(new WildcardMatcher(), this.pattern));
        }
        if (this.regexp != null) {
            matcherContextList.add(new MatcherContext(new RegexpMatcher(), this.regexp));
        }
        if (this.equals != null) {
            matcherContextList.add(new MatcherContext(new EqualsMatcher(), this.equals));
        }
        if (this.contains != null) {
            matcherContextList.add(new MatcherContext(new ContainsMatcher(), this.contains));
        }
        if (this.wildcard != null) {
            matcherContextList.add(new MatcherContext(new WildcardMatcher(), this.wildcard));
        }
        if (this.startsWith != null) {
            matcherContextList.add(new MatcherContext(new StartsWithMatcher(), this.startsWith));
        }
        if (this.endsWith != null) {
View Full Code Here

Examples of org.apache.cocoon.sitemap.matcher.WildcardMatcher

     */
    protected MatcherContext lookupMatcherContext() {
        // determine the matching type and check if there are conflicting match attributes
        LinkedList<MatcherContext> matcherContextList = new LinkedList<MatcherContext>();
        if (this.pattern != null) {
            matcherContextList.add(new MatcherContext(new WildcardMatcher(), this.pattern));
        }
        if (this.regexp != null) {
            matcherContextList.add(new MatcherContext(new RegexpMatcher(), this.regexp));
        }
        if (this.equals != null) {
            matcherContextList.add(new MatcherContext(new EqualsMatcher(), this.equals));
        }
        if (this.contains != null) {
            matcherContextList.add(new MatcherContext(new ContainsMatcher(), this.contains));
        }
        if (this.wildcard != null) {
            matcherContextList.add(new MatcherContext(new WildcardMatcher(), this.wildcard));
        }
        if (this.startsWith != null) {
            matcherContextList.add(new MatcherContext(new StartsWithMatcher(), this.startsWith));
        }
        if (this.endsWith != null) {
View Full Code Here

Examples of org.jacoco.core.runtime.WildcardMatcher

      final AgentOptions options, final IExceptionLogger logger) {
    this.runtime = runtime;
    this.instrumenter = new Instrumenter(runtime);
    this.logger = logger;
    // Class names will be reported in VM notation:
    includes = new WildcardMatcher(
        toWildcard(toVMName(options.getIncludes())));
    excludes = new WildcardMatcher(
        toWildcard(toVMName(options.getExcludes())));
    exclClassloader = new WildcardMatcher(
        toWildcard(options.getExclClassloader()));
  }
View Full Code Here

Examples of org.jacoco.core.runtime.WildcardMatcher

  public CoverageTransformer(IRuntime runtime, AgentOptions options,
      final IExceptionLogger logger) {
    this.instrumenter = new Instrumenter(runtime);
    this.logger = logger;
    // Class names will be reported in VM notation:
    includes = new WildcardMatcher(toWildcard(toVMName(options.getIncludes())));
    excludes = new WildcardMatcher(toWildcard(toVMName(options.getExcludes())));
    exclClassloader = new WildcardMatcher(toWildcard(options.getExclClassloader()));
  }
View Full Code Here

Examples of org.jacoco.core.runtime.WildcardMatcher

  public CoverageTransformer(IRuntime runtime, AgentOptions options,
      final IExceptionLogger logger) {
    this.instrumenter = new Instrumenter(runtime);
    this.logger = logger;
    // Class names will be reported in VM notation:
    includes = new WildcardMatcher(toVMName(options.getIncludes()));
    excludes = new WildcardMatcher(toVMName(options.getExcludes()));
    exclClassloader = new WildcardMatcher(options.getExclClassloader());
  }
View Full Code Here

Examples of org.jacoco.core.runtime.WildcardMatcher

  public CoverageTransformer(IRuntime runtime, AgentOptions options,
      final IExceptionLogger logger) {
    this.instrumenter = new Instrumenter(runtime);
    this.logger = logger;
    // Class names will be reported in VM notation:
    includes = new WildcardMatcher(toVMName(options.getIncludes()));
    excludes = new WildcardMatcher(toVMName(options.getExcludes()));
    exclClassloader = new WildcardMatcher(options.getExclClassloader());
  }
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.