Package org.voltdb.client

Examples of org.voltdb.client.ClientResponse


        String procName = GetUsers.class.getSimpleName();
        long user1 = 99998;
        long user2 = 1;
        Object params[] = { user1, user2  };
        ClientResponse cresponse = client.callProcedure(procName, params);
//        String query = "UPDATE USERS SET u_attr01= COUNT(*) FROM " + UsersConstants.TABLENAME_USERS;
//        ClientResponse cresponse = client.callProcedure("@AdHoc", query);
       
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        assertEquals(1, cresponse.getResults()[0].getRowCount());
    }
View Full Code Here


        RegressionSuiteUtil.initializeTM1Database(this.getCatalogContext(), client);
       
        String procName = VoltSystemProcedure.procCallName(AdHoc.class);
        for (String tableName : TM1Constants.TABLENAMES) {
            String query = "SELECT COUNT(*) FROM " + tableName;
            ClientResponse cresponse = client.callProcedure(procName, query);
            assertEquals(Status.OK, cresponse.getStatus());
            VoltTable results[] = cresponse.getResults();
            assertEquals(1, results.length);
            long count = results[0].asScalarLong();
            if (tableName.equals(TM1Constants.TABLENAME_SUBSCRIBER)) {
                assertEquals(tableName,  NUM_SUBSCRIBERS, count);
            } else {
View Full Code Here

        RegressionSuiteUtil.initializeTM1Database(this.getCatalogContext(), client);
        TM1Client.Transaction txn = Transaction.DELETE_CALL_FORWARDING;
        Object params[] = txn.generateParams(NUM_SUBSCRIBERS);
       
        for (int i = 0; i < 1000; i++) {
            ClientResponse cresponse = null;
            try {
                cresponse = client.callProcedure(txn.callName, params);
                assertEquals(Status.OK, cresponse.getStatus());
            } catch (ProcCallException ex) {
                cresponse = ex.getClientResponse();
//                System.err.println();
                assertEquals(cresponse.toString(), Status.ABORT_USER, cresponse.getStatus());
            }
            assertNotNull(cresponse);
        } // FOR
    }
View Full Code Here

    public void testGetAccessData() throws Exception {
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTM1Database(this.getCatalogContext(), client);
        TM1Client.Transaction txn = Transaction.GET_ACCESS_DATA;
        Object params[] = txn.generateParams(NUM_SUBSCRIBERS);
        ClientResponse cresponse = client.callProcedure(txn.callName, params);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        assertTrue(cresponse.toString(), cresponse.isSinglePartition());
    }
View Full Code Here

    public void testGetNewDestination() throws Exception {
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTM1Database(this.getCatalogContext(), client);
        TM1Client.Transaction txn = Transaction.DELETE_CALL_FORWARDING;
        Object params[] = txn.generateParams(NUM_SUBSCRIBERS);
        ClientResponse cresponse = null;
        try {
            cresponse = client.callProcedure(txn.callName, params);
            assertEquals(Status.OK, cresponse.getStatus());
        } catch (ProcCallException ex) {
            cresponse = ex.getClientResponse();
            assertEquals(cresponse.toString(), Status.ABORT_USER, cresponse.getStatus());
        }
        assertNotNull(cresponse);
        assertTrue(cresponse.toString(), cresponse.isSinglePartition());
    }
View Full Code Here

    public void testGetSubscriberData() throws Exception {
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTM1Database(this.getCatalogContext(), client);
        TM1Client.Transaction txn = Transaction.GET_SUBSCRIBER_DATA;
        Object params[] = txn.generateParams(NUM_SUBSCRIBERS);
        ClientResponse cresponse = client.callProcedure(txn.callName, params);
        assertNotNull(cresponse);
        assertTrue(cresponse.toString(), cresponse.isSinglePartition());
    }
View Full Code Here

    public void testInsertCallForwarding() throws Exception {
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTM1Database(this.getCatalogContext(), client);
        TM1Client.Transaction txn = Transaction.INSERT_CALL_FORWARDING;
        Object params[] = txn.generateParams(NUM_SUBSCRIBERS);
        ClientResponse cresponse = null;
        try {
            cresponse = client.callProcedure(txn.callName, params);
            assertEquals(Status.OK, cresponse.getStatus());
        } catch (ProcCallException ex) {
            cresponse = ex.getClientResponse();
            assertEquals(Status.ABORT_USER, cresponse.getStatus());
        }
        assertNotNull(cresponse);
    }
View Full Code Here

    public void testUpdateLocation() throws Exception {
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTM1Database(this.getCatalogContext(), client);
        TM1Client.Transaction txn = Transaction.UPDATE_LOCATION;
        Object params[] = txn.generateParams(NUM_SUBSCRIBERS);
        ClientResponse cresponse = client.callProcedure(txn.callName, params);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
    }
View Full Code Here

        Object params[] = {
            VoterConstants.NUM_CONTESTANTS,
            VoterConstants.CONTESTANT_NAMES_CSV
        };
       
        ClientResponse cresponse = client.callProcedure(Initialize.class.getSimpleName(), params);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
//        System.err.println("done.");
    }
View Full Code Here

        }
       
        // Make sure that our vote is actually in the real table and materialized views
        String query = "SELECT COUNT(*) FROM votes";
        String procName = VoltSystemProcedure.procCallName(AdHoc.class);
        ClientResponse cresponse = client.callProcedure(procName, query);
        assertEquals(Status.OK, cresponse.getStatus());
        VoltTable results[] = cresponse.getResults();
        assertEquals(1, results.length);
        assertEquals(num_txns, results[0].asScalarLong());
//        System.err.println("Finished Loading Data.");
    }
View Full Code Here

TOP

Related Classes of org.voltdb.client.ClientResponse

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.