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

Examples of org.apache.wink.common.internal.uritemplate.UriTemplateMatcher.match()


    public void testMatch() {
        UriTemplateProcessor template =
            new BitWorkingUriTemplateProcessor("/prefix/{varA}/root/{variableB}/suffix");
        UriTemplateMatcher matcher = template.matcher();
        MultivaluedMap<String, String> result = matcher.match("/prefix/aaaaaa/root/BbBbB/suffix");
        assertNotNull("match ok", result);
        assertEquals("match size", 2, result.size());
        assertEquals("varA", "aaaaaa", result.getFirst("varA"));
        assertEquals("variableB", "BbBbB", result.getFirst("variableB"));
    }
View Full Code Here


    public void testMatchVariableDoubleUsage() {
        UriTemplateProcessor template =
            new BitWorkingUriTemplateProcessor("/prefix/{varA}/root/{varA}/suffix");
        UriTemplateMatcher matcher = template.matcher();
        MultivaluedMap<String, String> result = matcher.match("/prefix/aaaaaa/root/aaaaaa/suffix");
        assertNotNull("match ok", result);
        assertEquals("match size", 1, result.size());
        assertEquals("varA", "aaaaaa", result.getFirst("varA"));
    }
View Full Code Here

    public void testMatchNegative() {
        UriTemplateProcessor template =
            new BitWorkingUriTemplateProcessor("/prefix/{variable}/suffix");
        UriTemplateMatcher matcher = template.matcher();
        assertNull("not matching", matcher.match("aprefix/value/suffix"));
    }

    public void testInstantiate() {
        UriTemplateProcessor templateA =
            new BitWorkingUriTemplateProcessor("/part1/{variable}/part2");
View Full Code Here

    }

    public void testUnreservedMatch() {
        UriTemplateProcessor template = new BitWorkingUriTemplateProcessor("/prefix/{varA}");
        UriTemplateMatcher matcher = template.matcher();
        MultivaluedMap<String, String> result = matcher.match("/prefix/a.b");
        assertNotNull("match ok .", result);
        assertEquals("match size .", 1, result.size());
        assertEquals("varA", "a.b", result.getFirst("varA"));

        result = matcher.match("/prefix/a_b");
View Full Code Here

        MultivaluedMap<String, String> result = matcher.match("/prefix/a.b");
        assertNotNull("match ok .", result);
        assertEquals("match size .", 1, result.size());
        assertEquals("varA", "a.b", result.getFirst("varA"));

        result = matcher.match("/prefix/a_b");
        assertNotNull("match ok _", result);
        assertEquals("match size _", 1, result.size());
        assertEquals("varA", "a_b", result.getFirst("varA"));

        result = matcher.match("/prefix/a-b");
View Full Code Here

        result = matcher.match("/prefix/a_b");
        assertNotNull("match ok _", result);
        assertEquals("match size _", 1, result.size());
        assertEquals("varA", "a_b", result.getFirst("varA"));

        result = matcher.match("/prefix/a-b");
        assertNotNull("match ok -", result);
        assertEquals("match size ,", 1, result.size());
        assertEquals("varA", "a-b", result.getFirst("varA"));

        result = matcher.match("/prefix/a~b");
View Full Code Here

        result = matcher.match("/prefix/a-b");
        assertNotNull("match ok -", result);
        assertEquals("match size ,", 1, result.size());
        assertEquals("varA", "a-b", result.getFirst("varA"));

        result = matcher.match("/prefix/a~b");
        assertNotNull("match ok ~", result);
        assertEquals("match size ~", 1, result.size());
        assertEquals("varA", "a~b", result.getFirst("varA"));
    }
View Full Code Here

    }

    public void testReservedMatch() {
        UriTemplateProcessor template = new BitWorkingUriTemplateProcessor("/prefix/{varA}");
        UriTemplateMatcher matcher = template.matcher();
        MultivaluedMap<String, String> result = matcher.match("/prefix/a%3Ab");
        assertNotNull("match ok :", result);
        assertEquals("match size :", 1, result.size());
        assertEquals("varA", "a%3Ab", result.getFirst("varA"));

        // character ":" is reserved, however hp-soa requires to match it
View Full Code Here

        assertNotNull("match ok :", result);
        assertEquals("match size :", 1, result.size());
        assertEquals("varA", "a%3Ab", result.getFirst("varA"));

        // character ":" is reserved, however hp-soa requires to match it
        result = matcher.match("/prefix/a:b");
        assertNotNull("match ok :", result);
        assertEquals("match size :", 1, result.size());
        assertEquals("varA", "a:b", result.getFirst("varA"));

        result = matcher.match("/prefix/a%2Fb");
View Full Code Here

        result = matcher.match("/prefix/a:b");
        assertNotNull("match ok :", result);
        assertEquals("match size :", 1, result.size());
        assertEquals("varA", "a:b", result.getFirst("varA"));

        result = matcher.match("/prefix/a%2Fb");
        assertNotNull("match ok /", result);
        assertEquals("match size /", 1, result.size());
        assertEquals("varA", "a%2Fb", result.getFirst("varA"));

        result = matcher.match("/prefix/%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D");
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.