Package com.firefly.mvc.web

Examples of com.firefly.mvc.web.Resource.match()


   
    resource.add("/shop/fruit/apple/?", cm);
    resource.add("/shop/fruit/banana", cm);
    resource.add("/file/info.txt", cm);
   
    Result ret = resource.match("/user/id-3344-2222/55555");
    Assert.assertThat(ret.getParams().length, is(3));
    Assert.assertThat(ret.getParams()[1], is("2222"));
    Assert.assertThat(ret.getParams()[2], is("55555"));
   
    ret = resource.match("/shop/fruit/banana");
View Full Code Here


    Result ret = resource.match("/user/id-3344-2222/55555");
    Assert.assertThat(ret.getParams().length, is(3));
    Assert.assertThat(ret.getParams()[1], is("2222"));
    Assert.assertThat(ret.getParams()[2], is("55555"));
   
    ret = resource.match("/shop/fruit/banana");
    Assert.assertThat(ret.getParams(), nullValue());
   
    ret = resource.match("/hello");
    Assert.assertThat(ret, nullValue());
   
View Full Code Here

    Assert.assertThat(ret.getParams()[2], is("55555"));
   
    ret = resource.match("/shop/fruit/banana");
    Assert.assertThat(ret.getParams(), nullValue());
   
    ret = resource.match("/hello");
    Assert.assertThat(ret, nullValue());
   
    ret = resource.match("/file/info.txt");
    Assert.assertThat(ret, notNullValue());
   
View Full Code Here

    Assert.assertThat(ret.getParams(), nullValue());
   
    ret = resource.match("/hello");
    Assert.assertThat(ret, nullValue());
   
    ret = resource.match("/file/info.txt");
    Assert.assertThat(ret, notNullValue());
   
    ret = resource.match("/document/_pengpeng");
    Assert.assertThat(ret, nullValue());
   
View Full Code Here

    Assert.assertThat(ret, nullValue());
   
    ret = resource.match("/file/info.txt");
    Assert.assertThat(ret, notNullValue());
   
    ret = resource.match("/document/_pengpeng");
    Assert.assertThat(ret, nullValue());
   
    Assert.assertThat(resource.getEncoding(), is("utf-8"));
  }
}
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.