@@ -0,0 +1,2372 @@
+package org.binwang.bard.basic;%0A%0Aimport org.binwang.bard.core.Handler;%0Aimport org.binwang.bard.core.Servlet;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.springframework.mock.web.MockHttpServletRequest;%0Aimport org.springframework.mock.web.MockHttpServletResponse;%0A%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport javax.ws.rs.Path;%0Aimport javax.ws.rs.PathParam;%0Aimport java.io.IOException;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class PathAdapterTest %7B%0A    public Servlet servlet = null;%0A    public MockHttpServletRequest request;%0A    public HttpServletResponse response;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        servlet = new Servlet(%22org.binwang.bard.basic%22);%0A        request = new MockHttpServletRequest();%0A        response = new MockHttpServletResponse();%0A    %7D%0A%0A    @Test%0A    public void basicPathTest() throws ServletException, IOException %7B%0A        request.setPathInfo(%22/basic-abc%22);%0A        servlet.service(request, response);%0A        assertEquals(%22basic-abc%22, response.getHeader(%22path%22));%0A    %7D%0A%0A    @Test%0A    public void classPathTest() throws ServletException, IOException %7B%0A        request.setPathInfo(%22/class-abc/basic-abc%22);%0A        servlet.service(request, response);%0A        assertEquals(%22class-abc%22, response.getHeader(%22path%22));%0A    %7D%0A%0A    @Test%0A    public void paramPathTest() throws ServletException, IOException %7B%0A        request.setPathInfo(%22/param-abc/abc/def%22);%0A        servlet.service(request, response);%0A        assertEquals(%22abc%22, response.getHeader(%22param-a%22));%0A        assertEquals(%22def%22, response.getHeader(%22param-b%22));%0A    %7D%0A%0A    public static class BasicPathHandler extends Handler %7B%0A        @Path(%22/basic-abc%22)%0A        public void handle() %7B%0A            context.response.addHeader(%22path%22, %22basic-abc%22);%0A        %7D%0A    %7D%0A%0A%0A    @Path(%22/class-abc%22)%0A    public static class ClassPathHandler extends Handler %7B%0A        @Path(%22/basic-abc%22)%0A        public void handle() %7B%0A            context.response.addHeader(%22path%22, %22class-abc%22);%0A        %7D%0A    %7D%0A%0A%0A    public static class ParamPathHandler extends Handler %7B%0A        @Path(%22/param-abc/%7Ba%7D/%7Bb%7D%22)%0A        public void handle(@PathParam(%22a%22) String a, @PathParam(%22b%22) String b) %7B%0A            context.response.addHeader(%22param-a%22, a);%0A            context.response.addHeader(%22param-b%22, b);%0A        %7D%0A    %7D%0A%7D%0A

add tests for path adapter