Skip to content

Commit

Permalink
to continue
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Dec 9, 2013
1 parent afe2bc2 commit f788f9e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public Connection connect(String url, java.util.Properties info) throws SQLExcep
throw new SQLException("invalid or unknown driver url: " + url);
}
if (log.isJdbcLoggingEnabled()) {
ConnectionSpy cspy = new ConnectionSpy(c, System.currentTimeMillis() - tstart, this.log);
ConnectionSpy cspy = new ConnectionSpy(c, System.currentTimeMillis() - tstart, log);
RdbmsSpecifics r = null;
String dclass = d.getClass().getName();
if (dclass != null && dclass.length() > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.never;

import org.h2.jdbcx.JdbcDataSource;

import org.mockito.stubbing.Answer;

import java.io.BufferedReader;
Expand Down Expand Up @@ -691,6 +694,23 @@ public void checkDebug() throws IOException {
CheckLoggingFunctionalites.readLogFile(-1).contains("DEBUGMESSAGE"));


}

/**
* Regression test for
* <a href='http://code.google.com/p/log4jdbc-log4j2/issues/detail?id=9'>
* issue #9</a>.
* @throws ClassNotFoundException
* @throws SQLException
*/
@Test
public void testEmptyResultSet() throws ClassNotFoundException, SQLException {
Class.forName("org.h2.Driver");
JdbcDataSource realSource = new JdbcDataSource();
realSource.setURL("jdbc:h2:mem:db1");
DataSource source = new DataSourceSpy(realSource);
Connection con = source.getConnection();

}

/**
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@
<version>1.9.5</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.173</version>
<scope>test</scope>
</dependency>

</dependencies>

Expand Down

0 comments on commit f788f9e

Please sign in to comment.