Package org.apache.clerezza.triaxrs.util

Examples of org.apache.clerezza.triaxrs.util.URITemplate.match()


  public void simpleParameterizedeMatching() {
    URITemplate template1 = new URITemplate("widgets/{id}");
    Assert.assertEquals("Hello", template1.match(
        "widgets/Hello").getParameters().get("id"));
    URITemplate template2 = new URITemplate("widgets/{id}/{id2}");
    Assert.assertEquals("foo", template2.match(
        "widgets/foo/bar").getParameters().get("id"));
    Assert.assertEquals("foo", template2.match(
    "widgets/foo/bar/ignore").getParameters().get("id"));
    SortedSet<URITemplate> set = new TreeSet<URITemplate>();
    set.add(template1);
View Full Code Here


    Assert.assertEquals("Hello", template1.match(
        "widgets/Hello").getParameters().get("id"));
    URITemplate template2 = new URITemplate("widgets/{id}/{id2}");
    Assert.assertEquals("foo", template2.match(
        "widgets/foo/bar").getParameters().get("id"));
    Assert.assertEquals("foo", template2.match(
    "widgets/foo/bar/ignore").getParameters().get("id"));
    SortedSet<URITemplate> set = new TreeSet<URITemplate>();
    set.add(template1);
    set.add(template2);
    Assert.assertEquals(template2, set.first());
View Full Code Here

  }
 
  @Test
  public void simpleParameterizedeMatching() {
    URITemplate template1 = new URITemplate("widgets/{id}");
    Assert.assertEquals("Hello", template1.match(
        "widgets/Hello").getParameters().get("id"));
    URITemplate template2 = new URITemplate("widgets/{id}/{id2}");
    Assert.assertEquals("foo", template2.match(
        "widgets/foo/bar").getParameters().get("id"));
    Assert.assertEquals("foo", template2.match(
View Full Code Here

              subPathParam);
          continue;
        }
        break;
      }
      PathMatching subPathMatching = currentUriTemplate.match(remainingPath);
      if (subPathMatching == null) {
        continue;
      }
      subPathParam = new HashMap<String, String>(inheritedPathParams);
      subPathParam.putAll(subPathMatching.getParameters());
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.