Package com.google.appengine.tck.users.support

Examples of com.google.appengine.tck.users.support.ServletAnswer


        userId = System.getProperty("appengine.userId");
        pw = System.getProperty("appengine.password");
    }

    private void initServletEnvironment(URL url) throws IOException {
        ServletAnswer answer = getUnAuthServletAnswer(url, "env");
        prodEnv = answer.isEnvironmentProd();
        devEnv = !prodEnv;
    }
View Full Code Here


        } else {
            pingUrl = new URL(url.toString() + "/" + servletMethod);
        }
        URLConnection conn = pingUrl.openConnection();
        String answer = Utils.readFullyAndClose(conn.getInputStream());
        return new ServletAnswer(answer);
    }
View Full Code Here

    private ServletAnswer getAuthServletAnswer(GaeAuthClient client, URL url, String method) throws IOException {

        HttpResponse response = client.getUrl(url + "/user-service-helper?method=" + method);
        String resp = EntityUtils.toString(response.getEntity());
        return new ServletAnswer(resp);
    }
View Full Code Here

        if (!isServletProd(url)) {
            return;
        }

        initAuthClient(url, userId, pw);
        ServletAnswer answer = getAuthServletAnswer(authClient, url, "getEmail");
        Assert.assertEquals("UserId should be same as authenticated user:" + answer, userId, answer.getReturnVal());
    }
View Full Code Here

    public void testGetEmailDev(@ArquillianResource URL url) throws Exception {
        if (!isServletDev(url)) {
            return;
        }

        ServletAnswer answer = getUnAuthServletAnswer(url, "getEmail");
        Assert.assertEquals("user is null", answer.getReturnVal());
    }
View Full Code Here

        if (!isServletProd(url)) {
            return;
        }

        initAuthClient(url, userId, pw);
        ServletAnswer answer = getAuthServletAnswer(authClient, url, "isUserLoggedIn");
        Assert.assertEquals("User should be Logged in since the GaeAuthClient is initialized.", "true", answer.getReturnVal());
    }
View Full Code Here

    public void testIsUserLoggedInDev(@ArquillianResource URL url) throws Exception {
        if (!isServletDev(url)) {
            return;
        }

        ServletAnswer answer = getUnAuthServletAnswer(url, "isUserLoggedIn");
        Assert.assertEquals("false", answer.getReturnVal());
    }
View Full Code Here

        if (!isServletProd(url)) {
            return;
        }

        initAuthClient(url, userId, pw);
        ServletAnswer answer = getAuthServletAnswer(authClient, url, "isUserAdmin");
        Assert.assertEquals("User should be logged in and admin.",
            "true", answer.getReturnVal());
    }
View Full Code Here

    public void testIsUserAdminInDev(@ArquillianResource URL url) throws Exception {
        if (!isServletDev(url)) {
            return;
        }

        ServletAnswer answer = getUnAuthServletAnswer(url, "isUserLoggedIn");
        Assert.assertEquals("false", answer.getReturnVal());
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.tck.users.support.ServletAnswer

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.