Package org.apache.wink.common.internal.uritemplate

Examples of org.apache.wink.common.internal.uritemplate.JaxRsUriTemplateProcessor.compile()


    }

    public void testCompileMatchExpand() {
        JaxRsUriTemplateProcessor processor = new JaxRsUriTemplateProcessor();
        // 1
        processor.compile("/path1/{var1}");
        UriTemplateMatcher matcher = processor.matcher();
        boolean matches = matcher.matches("/path1/abc");
        assertTrue(matches);
        MultivaluedMap<String, String> values = new MultivaluedMapImpl<String, String>();
        values.add("var1", "xyz");
View Full Code Here


        values.add("var1", "xyz");
        String expanded = processor.expand(values);
        assertEquals("/path1/xyz", expanded);

        // 2
        processor.compile("/path2/{var1}");
        matcher = processor.matcher();
        matches = matcher.matches("/path1/abc");
        assertFalse(matches);
        matches = matcher.matches("/path2/abc");
        assertTrue(matches);
View Full Code Here

            fail("expected IllegalStateException to be thrown");
        } catch (IllegalStateException e) {
        }

        // compiled but not matched
        processor.compile("/path1/{var1}");
        UriTemplateMatcher matcher = processor.matcher();
        assertFalse(matcher.matches("/path2"));

        try {
            matcher.getVariables(false);
View Full Code Here

    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);
View Full Code Here

        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);
View Full Code Here

        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);
View Full Code Here

        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);
View Full Code Here

        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);
View Full Code Here

        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);
View Full Code Here

        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);
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.