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

Examples of org.apache.wink.common.internal.uritemplate.UriTemplateProcessor.expand()


        hashMap = new HashMap<String, Object>();
        hashMap.put("var1", (String)null);
        hashMap.put("var2", (String)null);
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        assertEquals("instantiate template", "artifacts", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {});
        assertEquals("instantiate template", "artifacts", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {null});
View Full Code Here


        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        assertEquals("instantiate template", "artifacts", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {});
        assertEquals("instantiate template", "artifacts", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {null});
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {""});
View Full Code Here

        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {});
        assertEquals("instantiate template", "artifacts", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {null});
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {""});
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {"a", "b"});
View Full Code Here

        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {null});
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {""});
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {"a", "b"});
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));

        try {
View Full Code Here

        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {""});
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", new String[] {"a", "b"});
        assertEquals("instantiate template", "artifacts;", template.expand(hashMap));

        try {
            new BitWorkingUriTemplateProcessor("artifacts{-opt|;|}");
            fail("no variable in operator");
        } catch (IllegalArgumentException e) {
View Full Code Here

        hashMap = new HashMap<String, Object>();
        hashMap.put("var", new String[] {"animals", "domestic"});
        assertEquals("instantiate template", "/animals/domestic/cat", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var", new String[] {"hello", "baby", "go", "home"});
        assertEquals("instantiate template3", "telegram:hellostopbabystopgostophomestop", template3
            .expand(hashMap));
    }

    public void testJoinOperator() {
        UriTemplateProcessor template =
View Full Code Here

        assertMatchTemplate(template, "people%3Fvar2=kate&var1=mary", allDefined);
        assertMatchTemplate(template, "people%3Fvar3=jin", null);

        HashMap<String, Object> hashMap = new HashMap<String, Object>();
        hashMap.put("var1", "");
        assertEquals("instantiate template", "people%3Fvar1=", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var1", "jay");
        assertEquals("instantiate template", "people%3Fvar1=jay", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", "joe");
View Full Code Here

        HashMap<String, Object> hashMap = new HashMap<String, Object>();
        hashMap.put("var1", "");
        assertEquals("instantiate template", "people%3Fvar1=", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var1", "jay");
        assertEquals("instantiate template", "people%3Fvar1=jay", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", "joe");
        assertEquals("instantiate template", "people%3Fvar2=joe", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var1", "mary");
View Full Code Here

        hashMap = new HashMap<String, Object>();
        hashMap.put("var1", "jay");
        assertEquals("instantiate template", "people%3Fvar1=jay", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var2", "joe");
        assertEquals("instantiate template", "people%3Fvar2=joe", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var1", "mary");
        hashMap.put("var2", "kate");
        assertEquals("instantiate template", "people%3Fvar1=mary&var2=kate", template
            .expand(hashMap));
View Full Code Here

        hashMap.put("var2", "joe");
        assertEquals("instantiate template", "people%3Fvar2=joe", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var1", "mary");
        hashMap.put("var2", "kate");
        assertEquals("instantiate template", "people%3Fvar1=mary&var2=kate", template
            .expand(hashMap));
        hashMap = new HashMap<String, Object>();
        hashMap.put("var3", "joe");
        assertEquals("instantiate template", "people%3F", template.expand(hashMap));
        hashMap = new HashMap<String, Object>();
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.