src_fm_fc_ms_ff stringlengths 43 86.8k | target stringlengths 20 276k |
|---|---|
BeanLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<BeanLazyUpdateOutputHandler, S> { public boolean hasNext() { return super.innerHasNext(); } BeanLazyUpdateOutputHandler(Class<S> type); BeanLazyUpdateOutputHandler(Class<S> type, QueryOutputProcessor processor)... | @Test public void testHasNext() throws Exception { innerTestHasPrepare(); innerTestHasNext(new BeanLazyUpdateOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<BeanLazyUpdateOutputHandler, S> { public S getNext() { S result = null; QueryParameters params = innerGetNext(); try { result = processor.toBean(params, this.type); } catch (MjdbcException ex) { throw new MjdbcR... | @Test public void testGetNext() throws Exception { innerTestGetPrepare(); innerTestGetNext(new BeanLazyUpdateOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<BeanLazyUpdateOutputHandler, S> { public S getCurrent() { S result = null; QueryParameters params = innerGetCurrent(); try { result = processor.toBean(params, this.type); } catch (MjdbcException ex) { throw new ... | @Test public void testGetCurrent() throws Exception { innerTestGetPrepare(); innerTestGetCurrent(new BeanLazyUpdateOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MjdbcFactory { public static QueryRunnerService getQueryRunner(DataSource ds) { return (QueryRunnerService) ProfilerFactory.newInstance(new QueryRunner(ds)); } static QueryRunnerService getQueryRunner(DataSource ds); static QueryRunnerService getQueryRunner(DataSource ds, Class<? extends TypeHandler> typeHandlerClazz)... | @Test public void testGetQueryRunnerDataSource() throws Exception { Assert.assertEquals(true, MjdbcFactory.getQueryRunner(ds) instanceof QueryRunner); }
@Test public void testGetQueryRunnerDataSourceTypeHandler() throws Exception { Assert.assertEquals(true, MjdbcFactory.getQueryRunner(ds, EmptyTypeHandler.class) instan... |
BeanLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<BeanLazyUpdateOutputHandler, S> { public void close() { innerClose(); } BeanLazyUpdateOutputHandler(Class<S> type); BeanLazyUpdateOutputHandler(Class<S> type, QueryOutputProcessor processor); private BeanLazyU... | @Test public void testClose() throws Exception { innerTestClosePrepare(); innerTestClose(new BeanLazyUpdateOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<BeanLazyUpdateOutputHandler, S> { public BeanLazyUpdateOutputHandler handle(List<QueryParameters> outputList) throws MjdbcException { if (outputList instanceof QueryParametersLazyList) { return new BeanLazyUpdat... | @Test public void testHandle() throws Exception { innerTestHandle(new BeanLazyUpdateOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false)) instanceof BeanLazyUpdateOutputHandler); }
@Test public void testEmpty() throws Exception { innerTestEmpty(new BeanLazyUpdateOutputH... |
BeanLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<BeanLazyUpdateOutputHandler, S> { public void updateRow(S row) throws SQLException { innerUpdateRow(new QueryParameters(row.getClass(), row)); } BeanLazyUpdateOutputHandler(Class<S> type); BeanLazyUpdateOutputH... | @Test public void testUpdateRow() throws Exception { testTestUpdatePrepare(); QueryParametersLazyList queryParamsLazyList = new QueryParametersLazyList(stmt, typeHandler, false); queryParamsLazyList.setType(QueryParametersLazyList.Type.UPDATE_SCROLL); testTestUpdateRow(new BeanLazyUpdateOutputHandler<Character>(Charact... |
BeanLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<BeanLazyUpdateOutputHandler, S> { public void insertRow(S row) throws SQLException { innerInsertRow(new QueryParameters(row.getClass(), row)); } BeanLazyUpdateOutputHandler(Class<S> type); BeanLazyUpdateOutputH... | @Test public void testInsertRow() throws Exception { testTestUpdatePrepare(); QueryParametersLazyList queryParamsLazyList = new QueryParametersLazyList(stmt, typeHandler, false); queryParamsLazyList.setType(QueryParametersLazyList.Type.UPDATE_SCROLL); testTestInsertRow(new BeanLazyUpdateOutputHandler<Character>(Charact... |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public boolean hasNext() { return super.innerHasNext(); } BeanLazyScrollOutputHandler(Class<S> type); BeanLazyScrollOutputHandler(Class<S> type, QueryOutputProcessor processor)... | @Test public void testHasNext() throws Exception { innerTestHasPrepare(); innerTestHasNext(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public S getNext() { S result = null; QueryParameters params = innerGetNext(); try { result = processor.toBean(params, this.type); } catch (MjdbcException ex) { throw new MjdbcR... | @Test public void testGetNext() throws Exception { innerTestGetPrepare(); innerTestGetNext(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public S getCurrent() { S result = null; QueryParameters params = innerGetCurrent(); try { result = processor.toBean(params, this.type); } catch (MjdbcException ex) { throw new ... | @Test public void testGetCurrent() throws Exception { innerTestGetPrepare(); innerTestGetCurrent(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public void close() { innerClose(); } BeanLazyScrollOutputHandler(Class<S> type); BeanLazyScrollOutputHandler(Class<S> type, QueryOutputProcessor processor); private BeanLazyS... | @Test public void testClose() throws Exception { innerTestClosePrepare(); innerTestClose(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public BeanLazyScrollOutputHandler handle(List<QueryParameters> outputList) throws MjdbcException { if (outputList instanceof QueryParametersLazyList) { return new BeanLazyScrol... | @Test public void testHandle() throws Exception { innerTestHandle(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false)) instanceof BeanLazyScrollOutputHandler); }
@Test public void testEmpty() throws Exception { innerTestEmpty(new BeanLazyScrollOutputH... |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public boolean hasPrev() { return innerHasPrev(); } BeanLazyScrollOutputHandler(Class<S> type); BeanLazyScrollOutputHandler(Class<S> type, QueryOutputProcessor processor); priv... | @Test public void testHasPrev() throws Exception { innerTestHasPrepare(); innerTestHasPrev(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public S getPrev() { S result = null; QueryParameters params = innerGetPrev(); try { result = processor.toBean(params, this.type); } catch (MjdbcException ex) { throw new MjdbcR... | @Test public void testGetPrev() throws Exception { innerTestGetPrepare(); innerTestGetPrev(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public boolean moveTo(int row) { return innerMoveTo(row); } BeanLazyScrollOutputHandler(Class<S> type); BeanLazyScrollOutputHandler(Class<S> type, QueryOutputProcessor processo... | @Test public void testMoveTo() throws Exception { innerTestGetPrepare(); innerTestMoveTo(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public boolean moveRelative(int rows) { return innerMoveRelative(rows); } BeanLazyScrollOutputHandler(Class<S> type); BeanLazyScrollOutputHandler(Class<S> type, QueryOutputProc... | @Test public void testMoveRelative() throws Exception { innerTestGetPrepare(); innerTestMoveRelative(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<BeanLazyScrollOutputHandler, S> { public int position() { return innerPosition(); } BeanLazyScrollOutputHandler(Class<S> type); BeanLazyScrollOutputHandler(Class<S> type, QueryOutputProcessor processor); privat... | @Test public void testPosition() throws Exception { innerTestGetPrepare(); innerTestPosition(new BeanLazyScrollOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<MapLazyUpdateOutputHandler, Map<String, Object>> { public boolean hasNext() { return innerHasNext(); } MapLazyUpdateOutputHandler(); MapLazyUpdateOutputHandler(QueryOutputProcessor processor); private MapLazyUp... | @Test public void testHasNext() throws Exception { innerTestHasPrepare(); innerTestHasNext(new MapLazyUpdateOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<MapLazyUpdateOutputHandler, Map<String, Object>> { public Map<String, Object> getNext() { Map<String, Object> result = null; QueryParameters params = innerGetNext(); result = processor.toMap(params); return resul... | @Test public void testGetNext() throws Exception { innerTestGetPrepare(); innerTestGetNext(new MapLazyUpdateOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<MapLazyUpdateOutputHandler, Map<String, Object>> { public Map<String, Object> getCurrent() { Map<String, Object> result = null; QueryParameters params = innerGetCurrent(); result = processor.toMap(params); return... | @Test public void testGetCurrent() throws Exception { innerTestGetPrepare(); innerTestGetCurrent(new MapLazyUpdateOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<MapLazyUpdateOutputHandler, Map<String, Object>> { public void close() { innerClose(); } MapLazyUpdateOutputHandler(); MapLazyUpdateOutputHandler(QueryOutputProcessor processor); private MapLazyUpdateOutputHand... | @Test public void testClose() throws Exception { innerTestClosePrepare(); innerTestClose(new MapLazyUpdateOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<MapLazyUpdateOutputHandler, Map<String, Object>> { public MapLazyUpdateOutputHandler handle(List<QueryParameters> outputList) throws MjdbcException { if (outputList instanceof QueryParametersLazyList) { return ne... | @Test public void testHandle() throws Exception { innerTestHandle(new MapLazyUpdateOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false)) instanceof MapLazyUpdateOutputHandler); }
@Test public void testEmpty() throws Exception { innerTestEmpty(new MapLazyUpdateOutputHandler().handle(new QueryPara... |
MapLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<MapLazyUpdateOutputHandler, Map<String, Object>> { public void updateRow(Map<String, Object> row) throws SQLException { innerUpdateRow(new QueryParameters(row)); } MapLazyUpdateOutputHandler(); MapLazyUpdateOutp... | @Test public void testUpdateRow() throws Exception { testTestUpdatePrepare(); QueryParametersLazyList queryParamsLazyList = new QueryParametersLazyList(stmt, typeHandler, false); queryParamsLazyList.setType(QueryParametersLazyList.Type.UPDATE_SCROLL); testTestUpdateRow(new MapLazyUpdateOutputHandler().handle(queryParam... |
MapLazyUpdateOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyUpdateOutputHandler<MapLazyUpdateOutputHandler, Map<String, Object>> { public void insertRow(Map<String, Object> row) throws SQLException { innerInsertRow(new QueryParameters(row)); } MapLazyUpdateOutputHandler(); MapLazyUpdateOutp... | @Test public void testInsertRow() throws Exception { testTestUpdatePrepare(); QueryParametersLazyList queryParamsLazyList = new QueryParametersLazyList(stmt, typeHandler, false); queryParamsLazyList.setType(QueryParametersLazyList.Type.UPDATE_SCROLL); testTestInsertRow(new MapLazyUpdateOutputHandler().handle(queryParam... |
BeanLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<BeanLazyOutputHandler, S> { public boolean hasNext() { return super.innerHasNext(); } BeanLazyOutputHandler(Class<S> type); BeanLazyOutputHandler(Class<S> type, QueryOutputProcessor processor); private BeanLazyOutputHandler(Class<S> ... | @Test public void testHasNext() throws Exception { innerTestHasPrepare(); innerTestHasNext(new BeanLazyOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<BeanLazyOutputHandler, S> { public S getNext() { S result = null; QueryParameters params = innerGetNext(); try { result = processor.toBean(params, this.type); } catch (MjdbcException ex) { throw new MjdbcRuntimeException(ex); } return ... | @Test public void testGetNext() throws Exception { innerTestGetPrepare(); innerTestGetNext(new BeanLazyOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<BeanLazyOutputHandler, S> { public S getCurrent() { S result = null; QueryParameters params = innerGetCurrent(); try { result = processor.toBean(params, this.type); } catch (MjdbcException ex) { throw new MjdbcRuntimeException(ex); } r... | @Test public void testGetCurrent() throws Exception { innerTestGetPrepare(); innerTestGetCurrent(new BeanLazyOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<BeanLazyOutputHandler, S> { public void close() { innerClose(); } BeanLazyOutputHandler(Class<S> type); BeanLazyOutputHandler(Class<S> type, QueryOutputProcessor processor); private BeanLazyOutputHandler(Class<S> type, QueryOutputPro... | @Test public void testClose() throws Exception { innerTestClosePrepare(); innerTestClose(new BeanLazyOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
BeanLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<BeanLazyOutputHandler, S> { public BeanLazyOutputHandler handle(List<QueryParameters> outputList) throws MjdbcException { if (outputList instanceof QueryParametersLazyList) { return new BeanLazyOutputHandler(this.type, this.processor, ... | @Test public void testHandle() throws Exception { innerTestHandle(new BeanLazyOutputHandler<Character>(Character.class).handle(new QueryParametersLazyList(stmt, typeHandler, false)) instanceof BeanLazyOutputHandler); }
@Test public void testEmpty() throws Exception { innerTestEmpty(new BeanLazyOutputHandler<Character>(... |
MapLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<MapLazyOutputHandler, Map<String, Object>> { public boolean hasNext() { return innerHasNext(); } MapLazyOutputHandler(); MapLazyOutputHandler(QueryOutputProcessor processor); private MapLazyOutputHandler(QueryOutputProcessor processor... | @Test public void testHasNext() throws Exception { innerTestHasPrepare(); innerTestHasNext(new MapLazyOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<MapLazyOutputHandler, Map<String, Object>> { public Map<String, Object> getNext() { Map<String, Object> result = null; QueryParameters params = innerGetNext(); result = processor.toMap(params); return result; } MapLazyOutputHandler(); ... | @Test public void testGetNext() throws Exception { innerTestGetPrepare(); innerTestGetNext(new MapLazyOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<MapLazyOutputHandler, Map<String, Object>> { public Map<String, Object> getCurrent() { Map<String, Object> result = null; QueryParameters params = innerGetCurrent(); result = processor.toMap(params); return result; } MapLazyOutputHandle... | @Test public void testGetCurrent() throws Exception { innerTestGetPrepare(); innerTestGetCurrent(new MapLazyOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<MapLazyOutputHandler, Map<String, Object>> { public void close() { innerClose(); } MapLazyOutputHandler(); MapLazyOutputHandler(QueryOutputProcessor processor); private MapLazyOutputHandler(QueryOutputProcessor processor, QueryParamet... | @Test public void testClose() throws Exception { innerTestClosePrepare(); innerTestClose(new MapLazyOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyOutputHandler extends AbstractLazyOutputHandler implements LazyOutputHandler<MapLazyOutputHandler, Map<String, Object>> { public MapLazyOutputHandler handle(List<QueryParameters> outputList) throws MjdbcException { if (outputList instanceof QueryParametersLazyList) { return new MapLazyOutputHandler(this.processo... | @Test public void testHandle() throws Exception { innerTestHandle(new MapLazyOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false)) instanceof MapLazyOutputHandler); }
@Test public void testEmpty() throws Exception { innerTestEmpty(new MapLazyOutputHandler().handle(new QueryParametersLazyList(stm... |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public boolean hasNext() { return innerHasNext(); } MapLazyScrollOutputHandler(); MapLazyScrollOutputHandler(QueryOutputProcessor processor); private MapLazySc... | @Test public void testHasNext() throws Exception { innerTestHasPrepare(); innerTestHasNext(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public Map<String, Object> getNext() { Map<String, Object> result = null; QueryParameters params = innerGetNext(); result = processor.toMap(params); return resul... | @Test public void testGetNext() throws Exception { innerTestGetPrepare(); innerTestGetNext(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public Map<String, Object> getCurrent() { Map<String, Object> result = null; QueryParameters params = innerGetCurrent(); result = processor.toMap(params); return... | @Test public void testGetCurrent() throws Exception { innerTestGetPrepare(); innerTestGetCurrent(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public void close() { innerClose(); } MapLazyScrollOutputHandler(); MapLazyScrollOutputHandler(QueryOutputProcessor processor); private MapLazyScrollOutputHand... | @Test public void testClose() throws Exception { innerTestClosePrepare(); innerTestClose(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public MapLazyScrollOutputHandler handle(List<QueryParameters> outputList) throws MjdbcException { if (outputList instanceof QueryParametersLazyList) { return ne... | @Test public void testHandle() throws Exception { innerTestHandle(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false)) instanceof MapLazyScrollOutputHandler); }
@Test public void testEmpty() throws Exception { innerTestEmpty(new MapLazyScrollOutputHandler().handle(new QueryPara... |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public boolean hasPrev() { return innerHasPrev(); } MapLazyScrollOutputHandler(); MapLazyScrollOutputHandler(QueryOutputProcessor processor); private MapLazySc... | @Test public void testHasPrev() throws Exception { innerTestHasPrepare(); innerTestHasPrev(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public Map<String, Object> getPrev() { Map<String, Object> result = null; QueryParameters params = innerGetPrev(); result = processor.toMap(params); return resul... | @Test public void testGetPrev() throws Exception { innerTestGetPrepare(); innerTestGetPrev(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public boolean moveTo(int row) { return innerMoveTo(row); } MapLazyScrollOutputHandler(); MapLazyScrollOutputHandler(QueryOutputProcessor processor); private M... | @Test public void testMoveTo() throws Exception { innerTestGetPrepare(); innerTestMoveTo(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public boolean moveRelative(int rows) { return innerMoveRelative(rows); } MapLazyScrollOutputHandler(); MapLazyScrollOutputHandler(QueryOutputProcessor processo... | @Test public void testMoveRelative() throws Exception { innerTestGetPrepare(); innerTestMoveRelative(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
MapLazyScrollOutputHandler extends AbstractScrollUpdateLazyOutputHandler implements LazyScrollOutputHandler<MapLazyScrollOutputHandler, Map<String, Object>> { public int position() { return innerPosition(); } MapLazyScrollOutputHandler(); MapLazyScrollOutputHandler(QueryOutputProcessor processor); private MapLazyScro... | @Test public void testPosition() throws Exception { innerTestGetPrepare(); innerTestPosition(new MapLazyScrollOutputHandler().handle(new QueryParametersLazyList(stmt, typeHandler, false))); } |
ScalarOutputHandler extends AbstractOutputHandler<T> { public T handle(List<QueryParameters> output) { T result = null; String parameterName = null; Object parameterValue = null; if (output.size() > 1) { if (this.columnName == null) { parameterName = output.get(1).getNameByPosition(columnIndex); parameterValue = output... | @Test public void testHandle() throws Exception { ScalarOutputHandler<String> handler = new ScalarOutputHandler<String>(); String result = handler.handle(paramsList); Assert.assertEquals("jack", result); }
@Test public void testEmpty() { ScalarOutputHandler<String> handler = new ScalarOutputHandler<String>(); String re... |
MapOutputHandler extends AbstractOutputHandler<Map<String, Object>> { public Map<String, Object> handle(List<QueryParameters> outputList) throws MjdbcException { return this.outputProcessor.toMap(outputList); } MapOutputHandler(); MapOutputHandler(QueryOutputProcessor processor); Map<String, Object> handle(List<QueryP... | @Test public void testHandle() throws Exception { MapOutputHandler handler = new MapOutputHandler(); Map<String, Object> result = handler.handle(paramsList); org.junit.Assert.assertArrayEquals(new Object[]{"jack", "sheriff", 36}, new Object[]{result.get("name"), result.get("occupation"), result.get("age")}); }
@Test pu... |
BeanMapOutputHandler extends AbstractKeyedOutputHandler<K, V> { @Override protected V createRow(QueryParameters params) throws MjdbcException { return this.outputProcessor.toBean(params, type); } BeanMapOutputHandler(Class<V> type); BeanMapOutputHandler(Class<V> type, QueryOutputProcessor processor); BeanMapOutputHan... | @Test public void testCreateRow() throws Exception { BeanMapOutputHandler<String, Character> handler = new BeanMapOutputHandler<String, Character>(Character.class); Character result = handler.createRow(params); Assert.assertEquals(params.getValue("name"), result.getName()); Assert.assertEquals(params.getValue("occupati... |
ColumnListOutputHandler extends AbstractOutputListHandler<T> { public List<T> handle(List<QueryParameters> outputList) throws MjdbcException { List<T> result = new ArrayList<T>(); String parameterName = null; Object parameterValue = null; for (int i = 1; i < outputList.size(); i++) { if (this.columnName == null) { para... | @Test public void testHandle() throws Exception { List<String> result = new ColumnListOutputHandler<String>().handle(paramsList); Assert.assertArrayEquals(new Object[]{"jack", "henry", "alison"}, result.toArray()); }
@Test public void testEmpty() throws MjdbcException { List<String> result = new ColumnListOutputHandler... |
MapListOutputHandler extends AbstractOutputListHandler<Map<String, Object>> { public List<Map<String, Object>> handle(List<QueryParameters> outputList) throws MjdbcException { return this.outputProcessor.toMapList(outputList); } MapListOutputHandler(); MapListOutputHandler(QueryOutputProcessor processor); List<Map<Str... | @Test public void testHandle() throws Exception { MapListOutputHandler handler = new MapListOutputHandler(); List<Map<String, Object>> result = handler.handle(paramsList); org.junit.Assert.assertArrayEquals(new Object[]{"jack", "sheriff", 36}, new Object[]{result.get(0).get("name"), result.get(0).get("occupation"), res... |
BaseMetadataHandler implements MetadataHandler { public int updateCache(DatabaseMetaData metaData, String catalogName, String schemaName, String procedureName) throws SQLException { String dbProductName = MetadataUtils.processDatabaseProductName(metaData.getDatabaseProductName()); ResultSet procedures = null; ResultSet... | @Test public void testUpdateCache() throws Exception { BaseMetadataHandler metadataHandler = new BaseMetadataHandler(conn, false); Assert.assertEquals(1, metadataHandler.updateCache(metaData, null, null, "bla")); } |
BaseMetadataHandler implements MetadataHandler { public QueryParameters getProcedureParameters(Connection conn, String catalogName, String schemaName, String procedureName, boolean useCache) throws SQLException { DatabaseMetaData metaData = conn.getMetaData(); String userName = metaData.getUserName(); String dbProductN... | @Test public void testGetProcedureParameters() throws Exception { QueryRunnerService queryRunner = null; queryRunner = MjdbcFactory.getQueryRunner(ds); ((QueryRunner) queryRunner).setStatementHandler(statementHandler); queryRunner.update(inputHandler); queryRunner.query(inputHandler, outputHandler); queryRunner.batch(n... |
StoredProcedure implements Comparable<StoredProcedure> { @Override public boolean equals(Object obj) { boolean result = false; StoredProcedure procedure = null; if (obj instanceof StoredProcedure) { procedure = (StoredProcedure) obj; AssertUtils.assertNotNull(procedure.getProcedureName(), "Procedure name cannot be null... | @Test public void testEquals() throws Exception { String catalog = "catalog"; String schema = "schema"; String name = "executeproc"; StoredProcedure proc = new StoredProcedure(catalog, schema, name); StoredProcedure procCompare = new StoredProcedure(null, null, name); Assert.assertEquals(false, proc.equals(procCompare)... |
MjdbcFactory { public static AsyncQueryRunnerService getAsyncQueryRunner(QueryRunner runner, ExecutorService executorService) { return new AsyncQueryRunner(runner, executorService); } static QueryRunnerService getQueryRunner(DataSource ds); static QueryRunnerService getQueryRunner(DataSource ds, Class<? extends TypeHa... | @Test public void testGetAsyncQueryRunner() throws Exception { Assert.assertEquals(true, MjdbcFactory.getAsyncQueryRunner(null, null) instanceof AsyncQueryRunner); } |
StoredProcedure implements Comparable<StoredProcedure> { public int compareTo(StoredProcedure o) { int result = -2; result = order(getCatalog(), o.getCatalog()); result = (result == 0 ? order(getSchema(), o.getSchema()) : result); result = (result == 0 ? order(getProcedureName(), o.getProcedureName()) : result); return... | @Test public void testCompareTo() throws Exception { String catalog = "catalog"; String schema = "schema"; String name = "executeproc"; StoredProcedure proc = new StoredProcedure(catalog, schema, name); StoredProcedure procCompare = new StoredProcedure(null, null, name); Assert.assertEquals(1, proc.compareTo(procCompar... |
StoredProcedure implements Comparable<StoredProcedure> { @Override public String toString() { return this.getCatalog() + "." + this.getSchema() + "." + this.getProcedureName(); } StoredProcedure(String catalog, String schema, String procedureName); String getCatalog(); String getSchema(); String getProcedureName(); @Ov... | @Test public void testToString() throws Exception { String catalog = "catalog"; String schema = "schema"; String name = "executeproc"; String expectedString = catalog + "." + schema + "." + name; StoredProcedure proc = new StoredProcedure(catalog, schema, name); Assert.assertEquals(expectedString, proc.toString()); } |
MetadataUtils { public static String processDatabaseProductName(String databaseProductName) { String result = databaseProductName; if (databaseProductName != null && databaseProductName.startsWith("DB2") == true) { result = "DB2"; } else if ("Sybase SQL Server".equals(databaseProductName) == true || "Adaptive Server En... | @Test public void testProcessDatabaseProductName() throws Exception { Assert.assertEquals("Sybase", MetadataUtils.processDatabaseProductName("Sybase SQL Server")); Assert.assertEquals("DB2", MetadataUtils.processDatabaseProductName("DB2 Database Server")); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public Future<int[]> batch(final String sql, final Object[][] params) throws SQLException { return executorService.submit(new Callable<int[]>() { public int[] call() throws Exception { return queryRunner.batch(sql, params); } }); } AsyncQueryRunner(QueryRunnerServic... | @Test public void testBatch1() throws Exception { asyncRunner.batch(null, new Object[0][0]); sleep(); verify(runner, times(1)).batch(any(String.class), any(Object[][].class)); }
@Test public void testBatch2() throws Exception { asyncRunner.batch(new InputHandler[0]); sleep(); verify(runner, times(1)).batch(any(InputHan... |
AsyncQueryRunner implements AsyncQueryRunnerService { public <T> Future<T> query(final String sql, final OutputHandler<T> outputHandler, final Object... params) throws SQLException { return executorService.submit(new Callable<T>() { public T call() throws Exception { return queryRunner.query(sql, outputHandler, params)... | @Test public void testQuery1() throws Exception { asyncRunner.query("", new MapOutputHandler(), ""); sleep(); verify(runner, times(1)).query(any(String.class), any(MapOutputHandler.class), any(String.class)); }
@Test public void testQuery2() throws Exception { asyncRunner.query(new BeanInputHandler("", ""), new MapOutp... |
AsyncQueryRunner implements AsyncQueryRunnerService { public Future<Integer> update(final String sql) throws SQLException { return executorService.submit(new Callable<Integer>() { public Integer call() throws Exception { return queryRunner.update(sql); } }); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService... | @Test public void testUpdate1() throws Exception { asyncRunner.update(""); sleep(); verify(runner, times(1)).update(""); }
@Test public void testUpdate2() throws Exception { asyncRunner.update("", ""); sleep(); verify(runner, times(1)).update("", ""); }
@Test public void testUpdate3() throws Exception { asyncRunner.upd... |
MjdbcFactory { public static DataSource createDataSource(Properties poolProperties) throws SQLException { try { return MjdbcPoolBinder.createDataSource(poolProperties); } catch (NoClassDefFoundError ex) { throw new NoClassDefFoundError(ERROR_COULDNT_FIND_POOL_PROVIDER); } } static QueryRunnerService getQueryRunner(Dat... | @Test(expected = NoClassDefFoundError.class) public void testCreateDataSourceProp() throws Exception { MjdbcFactory.createDataSource(new Properties()); }
@Test(expected = NoClassDefFoundError.class) public void testCreateDataSourceUrl1() throws Exception { MjdbcFactory.createDataSource(""); }
@Test(expected = NoClassDe... |
AsyncQueryRunner implements AsyncQueryRunnerService { public Future<QueryParameters> call(final AbstractQueryInputHandler inputHandler) throws SQLException { return executorService.submit(new Callable<QueryParameters>() { public QueryParameters call() throws Exception { return queryRunner.call(inputHandler); } }); } As... | @Test public void testCall1() throws Exception { asyncRunner.call(new QueryInputHandler("", new QueryParameters())); sleep(); verify(runner, times(1)).call(any(AbstractQueryInputHandler.class)); }
@Test public void testCall2() throws Exception { asyncRunner.call(new BeanInputHandler<String>("", ""), "", "", false); sle... |
AsyncQueryRunner implements AsyncQueryRunnerService { public void setTransactionManualMode(boolean manualMode) { this.queryRunner.setTransactionManualMode(manualMode); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params); Future<i... | @Test public void testSetTransactionManualMode() throws Exception { asyncRunner.setTransactionManualMode(true); verify(runner, times(1)).setTransactionManualMode(true); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public boolean isTransactionManualMode() { return this.queryRunner.isTransactionManualMode(); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params); Future<int[]> batch(final In... | @Test public void testIsTransactionManualMode() throws Exception { asyncRunner.isTransactionManualMode(); verify(runner, times(1)).isTransactionManualMode(); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public void setTransactionIsolationLevel(Integer level) { this.queryRunner.setTransactionIsolationLevel(level); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params); Future<int... | @Test public void testSetTransactionIsolationLevel() throws Exception { Integer value = 1; asyncRunner.setTransactionIsolationLevel(value); verify(runner, times(1)).setTransactionIsolationLevel(value); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public Integer getTransactionIsolationLevel() { return this.queryRunner.getTransactionIsolationLevel(); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params); Future<int[]> batc... | @Test public void testGetTransactionIsolationLevel() throws Exception { asyncRunner.getTransactionIsolationLevel(); verify(runner, times(1)).getTransactionIsolationLevel(); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public void commit() throws SQLException { this.queryRunner.commit(); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params); Future<int[]> batch(final InputHandler[] inputHandle... | @Test public void testCommit() throws Exception { asyncRunner.commit(); verify(runner, times(1)).commit(); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public void rollback() throws SQLException { this.queryRunner.rollback(); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params); Future<int[]> batch(final InputHandler[] inputHa... | @Test public void testRollback() throws Exception { asyncRunner.rollback(); verify(runner, times(1)).rollback(); }
@Test public void testRollbackSavepoint() throws Exception { asyncRunner.rollback(null); verify(runner, times(1)).rollback(any(Savepoint.class)); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public Savepoint setSavepoint() throws SQLException { return this.queryRunner.setSavepoint(); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params); Future<int[]> batch(final In... | @Test public void testSetSavepoint() throws Exception { asyncRunner.setSavepoint(); verify(runner, times(1)).setSavepoint(); }
@Test public void testSetSavepointNamed() throws Exception { String name = "SweetSpot"; asyncRunner.setSavepoint(name); verify(runner, times(1)).setSavepoint(name); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public void releaseSavepoint(Savepoint savepoint) throws SQLException { this.queryRunner.releaseSavepoint(savepoint); } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params); Futu... | @Test public void testReleaseSavepoint() throws Exception { asyncRunner.releaseSavepoint(null); verify(runner, times(1)).releaseSavepoint(any(Savepoint.class)); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public AsyncQueryRunnerService overrideOnce(String operation, Object value) { this.queryRunner.overrideOnce(operation, value); return this; } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Ob... | @Test public void testOverrideOnce() throws Exception { asyncRunner.overrideOnce("", ""); verify(runner, times(1)).overrideOnce("", ""); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public AsyncQueryRunnerService override(String operation, Object value) { this.queryRunner.override(operation, value); return this; } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][]... | @Test public void testOverride() throws Exception { asyncRunner.override("", ""); verify(runner, times(1)).override("", ""); } |
AsyncQueryRunner implements AsyncQueryRunnerService { public AsyncQueryRunnerService removeOverride(String operation) { this.queryRunner.removeOverride(operation); return this; } AsyncQueryRunner(QueryRunnerService runner, ExecutorService executorService); Future<int[]> batch(final String sql, final Object[][] params);... | @Test public void testRemoveOverride() throws Exception { asyncRunner.removeOverride(""); verify(runner, times(1)).removeOverride(""); } |
ConnectionProxy implements java.lang.reflect.InvocationHandler { public static Connection newInstance(Connection conn) { return (Connection) java.lang.reflect.Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[]{Connection.class}, new ConnectionProxy(conn)); } ConnectionProxy(Connection conn); static C... | @Test public void testNewInstance() throws Exception { Connection result = null; result = ConnectionProxy.newInstance(conn); Assert.assertEquals(true, Proxy.isProxyClass(result.getClass())); Assert.assertEquals(true, result instanceof Connection); } |
ConnectionProxy implements java.lang.reflect.InvocationHandler { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object result = null; String methodName = method.getName(); if ("close".equals(methodName) == true) { } else { try { result = method.invoke(conn, args); } catch (Invocatio... | @Test public void testInvoke() throws Exception { Connection result = null; result = ConnectionProxy.newInstance(conn); result.isClosed(); result.close(); verify(conn, times(1)).isClosed(); verify(conn, never()).close(); } |
BaseTransactionHandler implements TransactionHandler { public Connection getConnection() throws SQLException { Connection activeConn = null; if (this.getDataSource() != null) { if (this.conn == null) { this.conn = this.getDataSource().getConnection(); } if (this.conn != null) { initConnection(this.conn); } } if (this.c... | @Test public void testIsolationLevelDS() throws SQLException { QueryRunnerService queryRunner = null; queryRunner = MjdbcFactory.getQueryRunner(ds); testIsolationLevel(queryRunner); verify(ds, times(4)).getConnection(); verify(conn, never()).setTransactionIsolation(any(int.class)); queryRunner.setTransactionIsolationLe... |
MidaoUtils { public static void close(Connection conn) throws SQLException { if (conn != null) { conn.close(); } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection conn, Statement stmt,... | @Test public void closeNullConnection() throws Exception { MidaoUtils.close((Connection) null); }
@Test public void closeConnection() throws Exception { Connection mockCon = mock(Connection.class); MidaoUtils.close(mockCon); verify(mockCon).close(); }
@Test public void closeNullResultSet() throws Exception { MidaoUtils... |
MidaoUtils { public static void closeQuietly(Connection conn) { try { close(conn); } catch (SQLException e) { } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection conn, Statement stmt,
... | @Test public void closeQuietlyNullConnection() throws Exception { MidaoUtils.closeQuietly((Connection) null); }
@Test public void closeQuietlyNullResultSet() throws Exception { MidaoUtils.closeQuietly((ResultSet) null); }
@Test public void closeQuietlyNullStatement() throws Exception { MidaoUtils.closeQuietly((Statemen... |
MidaoUtils { public static void commitAndClose(Connection conn) throws SQLException { if (conn != null) { try { conn.commit(); } finally { conn.close(); } } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void c... | @Test public void commitAndClose() throws Exception { Connection mockConnection = mock(Connection.class); MidaoUtils.commitAndClose(mockConnection); verify(mockConnection).commit(); verify(mockConnection).close(); } |
MidaoUtils { public static void commitAndCloseQuietly(Connection conn) { try { commitAndClose(conn); } catch (SQLException e) { } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection conn... | @Test public void commitAndCloseQuietly() throws Exception { Connection mockConnection = mock(Connection.class); MidaoUtils.commitAndClose(mockConnection); verify(mockConnection).commit(); verify(mockConnection).close(); } |
MidaoUtils { public static void rollback(Connection conn) throws SQLException { if (conn != null) { conn.rollback(); } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection conn, Statement... | @Test public void rollbackNull() throws Exception { MidaoUtils.rollback(null); }
@Test public void rollback() throws Exception { Connection mockConnection = mock(Connection.class); MidaoUtils.rollback(mockConnection); verify(mockConnection).rollback(); } |
MidaoUtils { public static void rollbackAndClose(Connection conn) throws SQLException { if (conn != null) { try { conn.rollback(); } finally { conn.close(); } } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static vo... | @Test public void rollbackAndCloseNull() throws Exception { MidaoUtils.rollbackAndClose(null); }
@Test public void rollbackAndClose() throws Exception { Connection mockConnection = mock(Connection.class); MidaoUtils.rollbackAndClose(mockConnection); verify(mockConnection).rollback(); verify(mockConnection).close(); } |
MidaoUtils { public static void rollbackAndCloseQuietly(Connection conn) { try { rollbackAndClose(conn); } catch (SQLException e) { } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection ... | @Test public void rollbackAndCloseQuietlyNull() throws Exception { MidaoUtils.rollbackAndCloseQuietly(null); }
@Test public void rollbackAndCloseQuietly() throws Exception { Connection mockConnection = mock(Connection.class); MidaoUtils.rollbackAndCloseQuietly(mockConnection); verify(mockConnection).rollback(); verify(... |
AssertUtils { public static void assertNotNull(Object value) { if (value == null) { throw new IllegalArgumentException(); } } static void assertNotNull(Object value); static void assertNotNull(Object value, String message); static void assertNotNull(Object value, SQLException exception); static void assertNotTrue(bool... | @Test(expected = Exception.class) public void testAssertNotNull() { AssertUtils.assertNotNull(null); }
@Test public void testAssertNotNullMessage() { try { AssertUtils.assertNotNull(null, exceptionMessage); } catch (Exception ex) { Assert.assertEquals(exceptionMessage, ex.getMessage()); } }
@Test public void testAssert... |
MjdbcUtils { public static void close(Connection conn) throws SQLException { if (conn != null) { conn.close(); } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection conn, Statement stmt,... | @Test public void closeNullConnection() throws Exception { MjdbcUtils.close((Connection) null); }
@Test public void closeConnection() throws Exception { Connection mockCon = mock(Connection.class); MjdbcUtils.close(mockCon); verify(mockCon).close(); }
@Test public void closeNullResultSet() throws Exception { MjdbcUtils... |
CallableStatementHandler extends BaseStatementHandler { @Override public void setStatement(Statement statement, QueryParameters params) throws SQLException { super.setStatement(statement, params); if (statement instanceof CallableStatement) { CallableStatement callStmt = (CallableStatement) statement; String parameterN... | @Test public void testSetStatement() throws Exception { invokeQueries(); verify(callableStatement, times(1)).registerOutParameter(3, MjdbcTypes.OTHER); } |
MjdbcUtils { public static void closeQuietly(Connection conn) { try { close(conn); } catch (SQLException e) { } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection conn, Statement stmt,
... | @Test public void closeQuietlyNullConnection() throws Exception { MjdbcUtils.closeQuietly((Connection) null); }
@Test public void closeQuietlyNullResultSet() throws Exception { MjdbcUtils.closeQuietly((ResultSet) null); }
@Test public void closeQuietlyNullStatement() throws Exception { MjdbcUtils.closeQuietly((Statemen... |
MjdbcUtils { public static void commitAndClose(Connection conn) throws SQLException { if (conn != null) { try { conn.commit(); } finally { conn.close(); } } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void c... | @Test public void commitAndClose() throws Exception { Connection mockConnection = mock(Connection.class); MjdbcUtils.commitAndClose(mockConnection); verify(mockConnection).commit(); verify(mockConnection).close(); } |
MjdbcUtils { public static void commitAndCloseQuietly(Connection conn) { try { commitAndClose(conn); } catch (SQLException e) { } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection conn... | @Test public void commitAndCloseQuietly() throws Exception { Connection mockConnection = mock(Connection.class); MjdbcUtils.commitAndClose(mockConnection); verify(mockConnection).commit(); verify(mockConnection).close(); } |
MjdbcUtils { public static void rollback(Connection conn) throws SQLException { if (conn != null) { conn.rollback(); } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection conn, Statement... | @Test public void rollbackNull() throws Exception { MjdbcUtils.rollback(null); }
@Test public void rollback() throws Exception { Connection mockConnection = mock(Connection.class); MjdbcUtils.rollback(mockConnection); verify(mockConnection).rollback(); } |
MjdbcUtils { public static void rollbackAndClose(Connection conn) throws SQLException { if (conn != null) { try { conn.rollback(); } finally { conn.close(); } } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static vo... | @Test public void rollbackAndCloseNull() throws Exception { MjdbcUtils.rollbackAndClose(null); }
@Test public void rollbackAndClose() throws Exception { Connection mockConnection = mock(Connection.class); MjdbcUtils.rollbackAndClose(mockConnection); verify(mockConnection).rollback(); verify(mockConnection).close(); } |
CallableStatementHandler extends BaseStatementHandler { @Override public Object[] readStatement(Statement statement, QueryParameters params) throws SQLException { Object[] result = new Object[0]; AssertUtils.assertNotNull(params); super.readStatement(statement, params); if (statement instanceof CallableStatement) { Cal... | @Test public void testReadStatement() throws Exception { invokeQueries(); verify(callableStatement, times(1)).getObject(3); } |
MjdbcUtils { public static void rollbackAndCloseQuietly(Connection conn) { try { rollbackAndClose(conn); } catch (SQLException e) { } } static void close(Connection conn); static void close(ResultSet rs); static void close(Statement stmt); static void closeQuietly(Connection conn); static void closeQuietly(Connection ... | @Test public void rollbackAndCloseQuietlyNull() throws Exception { MjdbcUtils.rollbackAndCloseQuietly(null); }
@Test public void rollbackAndCloseQuietly() throws Exception { Connection mockConnection = mock(Connection.class); MjdbcUtils.rollbackAndCloseQuietly(mockConnection); verify(mockConnection).rollback(); verify(... |
BaseInvocationHandler implements java.lang.reflect.InvocationHandler { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object result; String className = method.getDeclaringClass().getSimpleName(); String methodName = method.getName(); String parameters = Arrays.deepToString(args); lo... | @Test public void testInvoke() throws Exception { } |
ProfilerFactory { public static Object newInstance(Object obj) { if (MjdbcLogger.isSLF4jAvailable() == true && MjdbcLogger.isSLF4jImplementationAvailable() == false) { return obj; } else { if (MjdbcConfig.isProfilerEnabled() == true) { return java.lang.reflect.Proxy.newProxyInstance(obj.getClass().getClassLoader(), obj... | @Test public void testNewInstance() throws Exception { List list = null; MjdbcConfig.setProfilerEnabled(true); list = (List) ProfilerFactory.newInstance(new ArrayList()); if (MjdbcLogger.isSLF4jAvailable() == true) { if (MjdbcLogger.isSLF4jImplementationAvailable() == true) { Assert.assertEquals(true, Proxy.isProxyClas... |
MjdbcLogger extends Logger { public static MjdbcLogger getLogger(String name) { MjdbcLogger mjdbcLogger = new MjdbcLogger(name, null); if (isSLF4jAvailable() == true) { try { mjdbcLogger = new MjdbcLogger(name, null); mjdbcLogger.setSlfLogger(MappingUtils.invokeStaticFunction(Class.forName("org.slf4j.LoggerFactory"), "... | @Test public void testGetLoggerString() throws Exception { MjdbcLogger logger = MjdbcLogger.getLogger("log me!"); Assert.assertEquals(true, logger instanceof Logger); Assert.assertEquals("log me!", logger.getName()); }
@Test public void testGetLoggerClass() throws Exception { MjdbcLogger logger = MjdbcLogger.getLogger(... |
MjdbcLogger extends Logger { @Override public void info(String msg) { if (isSLF4jAvailable() == false) { super.info(msg); } else { try { MappingUtils.invokeFunction(slfLogger, "info", new Class[]{String.class}, new Object[]{msg}); } catch (MjdbcException e) { setSLF4jAvailable(false); super.info(msg); } } } private Mj... | @Test public void testInfo() throws Exception { } |
MjdbcLogger extends Logger { @Override public void warning(String msg) { if (isSLF4jAvailable() == false) { super.warning(msg); } else { try { MappingUtils.invokeFunction(slfLogger, "warn", new Class[]{String.class}, new Object[]{msg}); } catch (MjdbcException e) { setSLF4jAvailable(false); super.warning(msg); } } } pr... | @Test public void testWarning() throws Exception { } |
MjdbcLogger extends Logger { @Override public void severe(String msg) { if (isSLF4jAvailable() == false) { super.severe(msg); } else { try { MappingUtils.invokeFunction(slfLogger, "error", new Class[]{String.class}, new Object[]{msg}); } catch (MjdbcException e) { setSLF4jAvailable(false); super.severe(msg); } } } priv... | @Test public void testSevere() throws Exception { } |
MjdbcLogger extends Logger { public static boolean isSLF4jAvailable() { if (SLF4jAvailable == null) { try { Class.forName("org.slf4j.Logger"); setSLF4jAvailable(true); } catch (ClassNotFoundException e) { setSLF4jAvailable(false); } } return SLF4jAvailable; } private MjdbcLogger(String name, String resourceBundleName)... | @Test public void testIsSLF4jAvailable() throws Exception { Assert.assertEquals(false, MjdbcLogger.isSLF4jAvailable()); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.