Examples of UriTemplateProcessor


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

    protected void setUp() throws Exception {
        super.setUp();
    }

    public void testGetVariableNames() {
        UriTemplateProcessor template =
            new BitWorkingUriTemplateProcessor(
                                               "/prefix/{varA}/root/{variableB}/suffix/{Variable345}");
        Set<String> expectedResult = new HashSet<String>();
        expectedResult.add("varA");
        expectedResult.add("variableB");
        expectedResult.add("Variable345");
        assertEquals("variable name", expectedResult, template.getVariableNames());
    }
View Full Code Here

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

        expectedResult.add("Variable345");
        assertEquals("variable name", expectedResult, template.getVariableNames());
    }

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