Examples of sessionAuthenticate()


Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

    public void sessionAuthenticate() {
        OpenERPJSONRPCClient server = new OpenERPJSONRPCClient(SERVER_URL+":"+SERVER_PORT);

        // Bad database
        try {
            JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_clientooooo", "admin", "admin", null, null);
        } catch ( OpenERPJSONRPCClientException exc ) {
           System.out.println(exc);
            Assert.assertEquals("OpenERP Server Error", exc.message, "Authenticate Exception failed");
        }
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

            Assert.assertEquals("OpenERP Server Error", exc.message, "Authenticate Exception failed");
        }

        // Bad username or password
        try {
            JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "adminisssss", null, null);
            Assert.assertEquals( -1, sessionInfo.getInt("uid"), "Bad Authentication Failure (password) returned value");

            sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "adminisss", "admin", null, null);
            Assert.assertEquals( -1, sessionInfo.getInt("uid"), "Bad Authentication Failure (user) returned value");
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

        // Bad username or password
        try {
            JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "adminisssss", null, null);
            Assert.assertEquals( -1, sessionInfo.getInt("uid"), "Bad Authentication Failure (password) returned value");

            sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "adminisss", "admin", null, null);
            Assert.assertEquals( -1, sessionInfo.getInt("uid"), "Bad Authentication Failure (user) returned value");

        } catch ( OpenERPJSONRPCClientException exc ) {
           System.out.println(exc);
            Assert.assertEquals("OpenERP Server Error", exc.message, "Authenticate Exception failed");
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

            Assert.assertEquals("OpenERP Server Error", exc.message, "Authenticate Exception failed");
        }

        // Authentication success.
        // User must store sessionInfo as it contains important information
        JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "admin", null, null);
        Assert.assertTrue(sessionInfo instanceof JSONObject, "Login failed");
        System.out.println("login success sessionInfo="+sessionInfo);
    }

    @Test(groups = {"session_service"}, dependsOnMethods = {"sessionAuthenticate"})
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

        OpenERPJSONRPCClient server = new OpenERPJSONRPCClient(SERVER_URL+":"+SERVER_PORT);

        JSONObject sessionInfo = server.sessionGetInfo(null);
        Assert.assertEquals(-1, sessionInfo.get("uid"), "Bad 'No Session' returned value.");

        sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "admin", null, null);
        Assert.assertEquals(1, sessionInfo.get("uid"), "Admin login failed");

        // We retest GetSessionInfo after login and expect uid = 1 ( 1 = admin user )
        sessionInfo = server.sessionGetInfo(null);
        Assert.assertEquals(1, sessionInfo.get("uid"), "GetSessionInfo() failed as loggedin.");
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

    public void callkw_fill_res_users() {
        /**
         * We use CallKW to create a user using args postional
         */
        OpenERPJSONRPCClient server = new OpenERPJSONRPCClient(SERVER_URL+":"+SERVER_PORT);
        JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "admin", null, null);

        String[] userNames = {
                "Adeline-Candida LISEHIPOLITO",
                "Alma-Anderson MARCELOHARRIETKAYLA",
                "Alphonse CHERISH",
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

    @Test(groups = {"dataset_service"}, dependsOnGroups = {"fill_database"})
    public void searchRead_Naive() {
        final String[] fieldNames = {"id", "name", "login"};

        OpenERPJSONRPCClient server = new OpenERPJSONRPCClient(SERVER_URL+":"+SERVER_PORT);
        JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "admin", null, null);

        // res.users, 3 fields, all objects(no domain), no sort, no context
        // Note that we are supposed to have 40 + 1 users in database
        JSONObject objects = server.modelSearchRead("res.users", fieldNames, 0, 0, null, null, null);
        Integer userCount = (Integer) objects.get("length");
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

    @Test(groups = {"dataset_service"}, dependsOnMethods = {"searchRead_Naive"})
    public void searchRead_Sort() {
        final String[] fieldNames = {"id", "name", "login"};

        OpenERPJSONRPCClient server = new OpenERPJSONRPCClient(SERVER_URL+":"+SERVER_PORT);
        JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "admin", null, null);

        // Test sort parameters
        JSONObject sortedObjects = server.modelSearchRead("res.users", fieldNames, 0, 0, null, "id", null);
        Integer sortedObjectCount = (Integer) sortedObjects.get("length");
        Integer idOf5th = (Integer) ((JSONObject)((JSONArray)sortedObjects.get("records")).get(5)).get("id");
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

    @Test(groups = {"dataset_service"}, dependsOnMethods = {"searchRead_Sort"})
    public void searchRead_Domain() {
        final String[] fieldNames = {"id", "name", "login"};

        OpenERPJSONRPCClient server = new OpenERPJSONRPCClient(SERVER_URL+":"+SERVER_PORT);
        JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "admin", null, null);

        // Test domain parameter
        JSONArray domain_expr = new JSONArray("[['id','>',5],['id','<',10]]");
        JSONObject filteredObjects = server.modelSearchRead("res.users", fieldNames, 0, 0, domain_expr, "id", null);
        Integer filteredObjectCount = (Integer) filteredObjects.get("length");
View Full Code Here

Examples of fr.inouk.OpenERPJSONRPCClient.sessionAuthenticate()

    @Test(groups = {"dataset_service"}, dependsOnMethods = {"searchRead_Domain"})
    public void searchRead_Paginated() {
        final String[] fieldNames = {"id", "name", "login"};

        OpenERPJSONRPCClient server = new OpenERPJSONRPCClient(SERVER_URL+":"+SERVER_PORT);
        JSONObject sessionInfo = server.sessionAuthenticate("openerp_jsonrpc_client", "admin", "admin", null, null);
        /*
         * Warning: with limit and offset, result.length still contains total number of records returned by the search.
         * But result.records contains only limit record.
         * Example with limit=2 offset=10
            {
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.