use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestVoltProcedure method testNullDecimal.
public void testNullDecimal() {
ClientResponse r = call(DecimalProcedure.class);
assertEquals(null, DecimalProcedure.arg);
assertEquals(ClientResponse.SUCCESS, r.getStatus());
}
use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestVoltProcedure method testUnexpectedFailureFour.
public void testUnexpectedFailureFour() {
ClientResponse r = call(UnexpectedFailureFourProcedure.class);
assertEquals(ClientResponse.UNEXPECTED_FAILURE, r.getStatus());
System.out.println(r.getStatusString());
assertTrue(r.getStatusString().contains("java.lang.ArrayIndexOutOfBoundsException"));
}
use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestVoltProcedure method testNullDouble.
public void testNullDouble() {
ClientResponse r = call(DoubleProcedure.class);
assertEquals(VoltType.NULL_FLOAT, DoubleProcedure.arg);
assertEquals(ClientResponse.SUCCESS, r.getStatus());
}
use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestVoltProcedure method testNullTimestamp.
public void testNullTimestamp() {
ClientResponse r = call(TimestampProcedure.class);
assertEquals(null, TimestampProcedure.arg);
assertEquals(ClientResponse.SUCCESS, r.getStatus());
}
use of org.voltdb.client.ClientResponse in project voltdb by VoltDB.
the class TestFixedSQLSuite method subTestTicketEng2250_IsNull.
private void subTestTicketEng2250_IsNull() throws IOException, ProcCallException, InterruptedException {
System.out.println("STARTING testTicketEng2250_IsNull");
Client client = getClient();
ProcedureCallback callback = new ProcedureCallback() {
@Override
public void clientCallback(ClientResponse clientResponse) throws Exception {
if (clientResponse.getStatus() != ClientResponse.SUCCESS) {
throw new RuntimeException("Failed with response: " + clientResponse.getStatusString());
}
}
};
/*
CREATE TABLE P1 (
ID INTEGER DEFAULT '0' NOT NULL,
DESC VARCHAR(300),
NUM INTEGER,
RATIO FLOAT,
PRIMARY KEY (ID)
);
*/
System.out.println("Eng2250: null entries.");
for (int id = 0; id < 5; id++) {
client.callProcedure(callback, "P1.insert", id, null, 10, 1.1);
client.drain();
}
System.out.println("Eng2250: not null entries.");
for (int id = 5; id < 8; id++) {
client.callProcedure(callback, "P1.insert", id, "description", 10, 1.1);
client.drain();
}
VoltTable r1 = client.callProcedure("@AdHoc", "select count(*) from P1 where desc is null").getResults()[0];
//* enable for debugging */ System.out.println(r1);
assertEquals(5, r1.asScalarLong());
VoltTable r2 = client.callProcedure("@AdHoc", "select count(*) from P1 where not desc is null").getResults()[0];
//* enable for debugging */ System.out.println(r2);
assertEquals(3, r2.asScalarLong());
VoltTable r3 = client.callProcedure("@AdHoc", "select count(*) from P1 where NOT (id=2 and desc is null)").getResults()[0];
//* enable for debugging */ System.out.println(r3);
assertEquals(7, r3.asScalarLong());
VoltTable r4 = client.callProcedure("@AdHoc", "select count(*) from P1 where NOT (id=6 and desc is null)").getResults()[0];
//* enable for debugging */ System.out.println(r4);
assertEquals(8, r4.asScalarLong());
VoltTable r5 = client.callProcedure("@AdHoc", "select count(*) from P1 where id < 6 and NOT desc is null;").getResults()[0];
//* enable for debugging */ System.out.println(r5);
assertEquals(1, r5.asScalarLong());
truncateTable(client, "P1");
}
Aggregations