Skip to content

Commit

Permalink
Performance tests improvement - use EmulatedDB
Browse files Browse the repository at this point in the history
Signed-off-by: Radek Felcman <[email protected]>
  • Loading branch information
rfelcman committed May 7, 2024
1 parent f194e68 commit b11eb1c
Show file tree
Hide file tree
Showing 7 changed files with 969 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
public class EmulatedConnection implements Connection {
protected Map<String, List<DatabaseRecord>> rows;
protected Connection connection;
protected DatabaseMetaData databaseMetaData;

public EmulatedConnection() {
this.rows = new HashMap<>();
Expand Down Expand Up @@ -327,10 +328,10 @@ public boolean isClosed() throws SQLException {
*/
@Override
public DatabaseMetaData getMetaData() throws SQLException {
if (connection != null) {
return connection.getMetaData();
if (this.databaseMetaData == null) {
this.databaseMetaData = new EmulatedDatabaseMetaData();
}
return null;
return this.databaseMetaData;
}

/**
Expand Down
Loading

0 comments on commit b11eb1c

Please sign in to comment.