use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestMPBasecaseSuite method testOneShotWrite.
public void testOneShotWrite() throws Exception {
final Client client = this.getClient();
loadData(client);
ClientResponse resp = client.callProcedure("UpdateP1");
assertTrue("Successful oneshot write.", resp.getStatus() == ClientResponse.SUCCESS);
assertEquals("Touched 10 rows", 10L, resp.getResults()[0].asScalarLong());
// verify the update results.
resp = client.callProcedure("SumP1");
assertTrue("Verified updates", resp.getStatus() == ClientResponse.SUCCESS);
assertEquals("Updated sum=20", 20L, resp.getResults()[0].asScalarLong());
}
use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestMPBasecaseSuite method testOneShotRead.
public void testOneShotRead() throws Exception {
final Client client = this.getClient();
loadData(client);
// testcase: single-stmt read.
ClientResponse resp = client.callProcedure("CountP1");
assertTrue("Successful oneshot read.", resp.getStatus() == ClientResponse.SUCCESS);
assertEquals("Expect count=10", 10L, resp.getResults()[0].asScalarLong());
}
use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestMPBasecaseSuite method testOneShotConstraintViolationAllSites.
public void testOneShotConstraintViolationAllSites() throws Exception {
final Client client = this.getClient();
loadData(client);
boolean caught = false;
try {
client.callProcedure("ConstraintViolationUpdate");
assertFalse("Failed to produce constraint violation", true);
} catch (ProcCallException e) {
assertEquals("Client response is rollback.", ClientResponse.GRACEFUL_FAILURE, e.getClientResponse().getStatus());
caught = true;
}
assertTrue("Expected exception.", caught);
// verify initial result is unchanged (transactions!)
ClientResponse resp = client.callProcedure("SumB1");
assertTrue("Verified updates", resp.getStatus() == ClientResponse.SUCCESS);
assertEquals("Updated sum=45", 45L, resp.getResults()[0].asScalarLong());
}
use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestMPMultiRoundTripSuite method testMultiRoundtripMixReplicatedReadsAndWrites.
public void testMultiRoundtripMixReplicatedReadsAndWrites() throws Exception {
final Client client = this.getClient();
ClientResponse resp = client.callProcedure("MultiRoundMixReplicatedReadsAndWrites", 10, 20);
assertTrue("Successful multi-roundtrip read/write.", resp.getStatus() == ClientResponse.SUCCESS);
assertEquals("Expect count=55", 55L, resp.getResults()[0].asScalarLong());
}
use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestMPMultiRoundTripSuite method testMultiRoundRead.
public void testMultiRoundRead() throws Exception {
final Client client = this.getClient();
loadData(client);
ClientResponse resp = client.callProcedure("MultiRoundP1Count", 10);
assertTrue("Successful multi-roundtrip read.", resp.getStatus() == ClientResponse.SUCCESS);
assertEquals("Expect count=100", 100L, resp.getResults()[0].asScalarLong());
}
Aggregations