use of org.eclipse.scout.rt.server.jdbc.fixture.VerboseMock in project scout.rt by eclipse.
the class BindValueTest method testNullBindWithLong.
@Test
public void testNullBindWithLong() throws Exception {
m_sqlService.clearProtocol();
// actual behaviour
m_sqlService.select("SELECT A FROM T WHERE A = :a", new NVPair("a", null));
String actual = m_sqlService.getProtocol().toString();
// expected behaviour
VerboseMock m = new VerboseMock(new StringBuffer());
m.log(Connection.class, "prepareStatement", "SELECT A FROM T WHERE A = ?");
m.log(PreparedStatement.class, "setNull", 1, Types.NULL);
m.log(PreparedStatement.class, "executeQuery");
m.log(ResultSet.class, "getFetchSize");
m.log(ResultSet.class, "next");
m.log(ResultSet.class, "close");
String expected = m.getProtocol().toString();
// check
assertEquals(expected, actual);
}
use of org.eclipse.scout.rt.server.jdbc.fixture.VerboseMock in project scout.rt by eclipse.
the class BindValueTest method testNullBindWithLongAndNullType.
@Test
public void testNullBindWithLongAndNullType() throws Exception {
m_sqlService.clearProtocol();
// actual behaviour
m_sqlService.select("SELECT A FROM T WHERE A = :a", new NVPair("a", null, Long.class));
String actual = m_sqlService.getProtocol().toString();
// expected behaviour
VerboseMock m = new VerboseMock(new StringBuffer());
m.log(Connection.class, "prepareStatement", "SELECT A FROM T WHERE A = ?");
m.log(PreparedStatement.class, "setObject", 1, null, Types.BIGINT);
m.log(PreparedStatement.class, "executeQuery");
m.log(ResultSet.class, "getFetchSize");
m.log(ResultSet.class, "next");
m.log(ResultSet.class, "close");
String expected = m.getProtocol().toString();
// check
assertEquals(expected, actual);
}
use of org.eclipse.scout.rt.server.jdbc.fixture.VerboseMock in project scout.rt by eclipse.
the class BindValueTest method testNullBindWithLongHolder.
@Test
public void testNullBindWithLongHolder() throws Exception {
m_sqlService.clearProtocol();
// actual behaviour
m_sqlService.select("SELECT A FROM T WHERE A = :a", new NVPair("a", new LongHolder()));
String actual = m_sqlService.getProtocol().toString();
// expected behaviour
VerboseMock m = new VerboseMock(new StringBuffer());
m.log(Connection.class, "prepareStatement", "SELECT A FROM T WHERE A = ?");
m.log(PreparedStatement.class, "setObject", 1, null, Types.BIGINT);
m.log(PreparedStatement.class, "executeQuery");
m.log(ResultSet.class, "getFetchSize");
m.log(ResultSet.class, "next");
m.log(ResultSet.class, "close");
String expected = m.getProtocol().toString();
// check
assertEquals(expected, actual);
}
Aggregations