Examples of JaxRsUriTemplateProcessor


Examples of org.apache.wink.common.internal.uritemplate.JaxRsUriTemplateProcessor

        } catch (IllegalArgumentException e) {
        }
    }

    public void testCompareTo() {
        JaxRsUriTemplateProcessor p1 = new JaxRsUriTemplateProcessor();
        JaxRsUriTemplateProcessor p2 = new JaxRsUriTemplateProcessor();

        p1.compile("/path1/path2");
        p2.compile("/path1/path2");
        assertTrue(p1.compareTo(p2) == 0);

        p1.compile("/path2/path1");
        p2.compile("/path1/path2");
        assertTrue(p1.compareTo(p2) == 0);

        p1.compile("/path1/path2/path3");
        p2.compile("/path1/path2");
        assertTrue(p1.compareTo(p2) > 0);

        p1.compile("/path1/path2");
        p2.compile("/path1/path2/path3");
        assertTrue(p1.compareTo(p2) < 0);

        p1.compile("/path1/path2/{var1}");
        p2.compile("/path1/path2/{var1}");
        assertTrue(p1.compareTo(p2) == 0);

        p1.compile("/path1/path2/{var1}");
        p2.compile("/path1/path2/{variable1}");
        assertTrue(p1.compareTo(p2) == 0);

        p1.compile("/path1/path2/{var1}");
        p2.compile("/path1/{variable1}/path2");
        assertTrue(p1.compareTo(p2) == 0);

        p1.compile("/path1/path2/path3/{var1}");
        p2.compile("/path1/path2/{var1}");
        assertTrue(p1.compareTo(p2) > 0);

        p1.compile("/path1/path2/{var1}");
        p2.compile("/path1/path2/path3/{var1}");
        assertTrue(p1.compareTo(p2) < 0);

        p1.compile("/path1/path2/{var1}/{var2}");
        p2.compile("/path1/path2/{var1}");
        assertTrue(p1.compareTo(p2) > 0);

        p1.compile("/path1/path2/{var1}");
        p2.compile("/path1/path2/{var1}/{var2}");
        assertTrue(p1.compareTo(p2) < 0);

        p1.compile("/path1/path2/path3/{var1}");
        p2.compile("/path1/path2/{var1}/{var2}");
        assertTrue(p1.compareTo(p2) > 0);

        p1.compile("/path1/path2/{var1}/{var2}");
        p2.compile("/path1/path2/path3/{var1}");
        assertTrue(p1.compareTo(p2) < 0);

        p1.compile("/path1/path2/{var1}/{var2:.*}");
        p2.compile("/path1/path2/{var1}/{var2:.*}");
        assertTrue(p1.compareTo(p2) == 0);

        p1.compile("/path1/path2/{var1}/{var2:.*}");
        p2.compile("/path1/path2/{var1}/{var2}");
        assertTrue(p1.compareTo(p2) > 0);

        p1.compile("/path1/path2/{var1}/{var2}");
        p2.compile("/path1/path2/{var1}/{var2:.*}");
        assertTrue(p1.compareTo(p2) < 0);

        p1.compile("/path1/path2/{var1:.*}/{var2}");
        p2.compile("/path1/path2/{var1}/{var2:.*}");
        assertTrue(p1.compareTo(p2) == 0);
    }
View Full Code Here

Examples of org.apache.wink.common.internal.uritemplate.JaxRsUriTemplateProcessor

     * @param testPath    The match path
     */
    private UriTemplateMatcher match(String requestPath, String testPath) {

        if (processor == null) {
            processor = new JaxRsUriTemplateProcessor(testPath);
        }

        UriTemplateMatcher matcher = processor.matcher();
        return matcher.matches(requestPath) ? matcher : null;
    }
View Full Code Here

Examples of org.apache.wink.common.internal.uritemplate.JaxRsUriTemplateProcessor

     */
    public UriTemplateMatcher match(String requestPath, String testPath) {

        if (processor == null) {
            // processor = new BitWorkingUriTemplateProcessor(testPath);
            processor = new JaxRsUriTemplateProcessor(testPath);
        }

        UriTemplateMatcher matcher = processor.matcher();
        return matcher.matches(requestPath) ? matcher : null;
    }
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.