Package org.stringtree.mojasef.local

Examples of org.stringtree.mojasef.local.LocalRequest


        assertEquals("I am aa: ${*hello}", tpls.getObject("home"));
        assertEquals("Hello, ${value}!", tpls.getObject("hello"));
    }

    private void check(LocalServer server, String expected, String page) {
        ByteTract request = new LocalRequest(page);
        Tract response = server.request(request);
        assertTrue(response.hasContent());
        assertEquals(expected, response.getContent());
    }
View Full Code Here


    public AuthRestTest() {
        super("src/test/files/authrest/http.spec", "src/test/expected/authrest/");
    }

    public void testGetPublicUnknown() {
        request = new LocalRequest("public/12344");
        callAndCheckXML(request, "item12344");
    }
View Full Code Here

        request = new LocalRequest("public/12344");
        callAndCheckXML(request, "item12344");
    }

    public void testGetPublicKnown() {
        request = new LocalRequest("public/12345");
        callAndCheckXML(request, "item12345");
    }
View Full Code Here

        request = new LocalRequest("public/12345");
        callAndCheckXML(request, "item12345");
    }

    public void testGetPrivateUnknown() {
        request = new LocalRequest("private/12344");
        callAndCheckCode(request, "404");
    }
View Full Code Here

        request = new LocalRequest("private/12344");
        callAndCheckCode(request, "404");
    }

    public void testGetPrivateKnownButUnauthenticated() {
        request = new LocalRequest("private/12345");
        request.put("Authorization", "Basic 12345:1112");
        callAndCheckCode(request, "401");
        assertEquals("Basic realm=\"private:12345\"", response.get("WWW-Authenticate"));
    }
View Full Code Here

        callAndCheckCode(request, "401");
        assertEquals("Basic realm=\"private:12345\"", response.get("WWW-Authenticate"));
    }

    public void testGetPrivateKnownButWrongPIN() {
        request = new LocalRequest("private/12345");
        callAndCheckCode(request, "401");
        assertEquals("Basic realm=\"private:12345\"", response.get("WWW-Authenticate"));
    }
View Full Code Here

        callAndCheckCode(request, "401");
        assertEquals("Basic realm=\"private:12345\"", response.get("WWW-Authenticate"));
    }

    public void testGetPrivateKnownAndAuthenticated() {
        request = new LocalRequest("private/12345");
        request.put("Authorization", "Basic 12345:1111");
        callAndCheckXML(request, "item12345");
    }
View Full Code Here

        request.put("Authorization", "Basic 12345:1111");
        callAndCheckXML(request, "item12345");
    }

    public void testGetPrivateIdUnknown() {
        request = new LocalRequest("id/12344/details");
        callAndCheckCode(request, "404");
    }
View Full Code Here

        request = new LocalRequest("id/12344/details");
        callAndCheckCode(request, "404");
    }

    public void testGetPrivateIdKnownButUnauthenticated() {
        request = new LocalRequest("id/12345/details");
        request.put("Authorization", "Basic 12345:1112");
        callAndCheckCode(request, "401");
        assertEquals("Basic realm=\"id:12345\"", response.get("WWW-Authenticate"));
    }
View Full Code Here

        callAndCheckCode(request, "401");
        assertEquals("Basic realm=\"id:12345\"", response.get("WWW-Authenticate"));
    }

    public void testGetPrivateIdKnownButWrongPIN() {
        request = new LocalRequest("id/12345/details");
        callAndCheckCode(request, "401");
        assertEquals("Basic realm=\"id:12345\"", response.get("WWW-Authenticate"));
    }
View Full Code Here

TOP

Related Classes of org.stringtree.mojasef.local.LocalRequest

Copyright © 2018 www.massapicom. 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.