Package net.bugreaper.modules.db
Class CustomDb
Class for interacting with custom DB (that not supported by default)
more info
For one instance run recommended: CustomDb db = CustomDb.getInstance()
- Get all data for allure on failed not supported
- Get data all data by conditions not supported
- Get data all data from table not supported
- Specific conditions(JSON_*, REGEX) not supported (only basic conditions)
Contains methods for:
asserts with await, change data (create, update, clean)more info
JdbcExecutor-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertCountInTableBuilder(String tableName, String conditions, Object[][] conditionsArray, String expectedCount, int awaitMs) static CustomDbReturns the singleton instance ofCustomDbwith config builderCustomDb().protected String[]getTableColumns(String tableName) Get array with table column listprotected voidrecordExistsBuilder(String tableName, String conditions, Object[][] conditionsArray, int awaitMs) protected voidseeInDbByCondMethod(String tableName, String conditions) protected voidshowDataFromTableMethod(String tableName) Methods inherited from class net.bugreaper.modules.db.jdbc.JdbcExecutor
deleteFromTable, deleteFromTable, deleteFromTable, getConfigSummary, insertIntoTable, insertIntoTable, insertIntoTable, renameTable, rollbackTable, runScript, runScriptFromFile, seeRecordExistsInTable, seeRecordExistsInTable, seeRecordExistsInTableCustom, seeRowsCountInTableExactly, seeRowsCountInTableExactly, seeRowsCountInTableExactly, seeRowsCountInTableExactlyCustom, seeTableDoesNotEmpty, seeTableIsEmpty, self, setAwaitMs, setTemplatesDirectory, showDataByCondition, showDataFromTable, truncateTable, truncateTables, updateTable, updateTable, updateTable, withAwaitMs
-
Field Details
-
jdbc
-
getColumnsQuery
-
url
-
username
-
password
-
SELECT_ALL
- See Also:
-
COUNT
- See Also:
-
-
Constructor Details
-
CustomDb
Creates a new Custom database helper instance with the specified connection parameters.- Parameters:
dbUrl- the JDBC connection URL for the Custom databaseusername- the username used to authenticate with the databasepasswd- the password used to authenticate with the database- Throws:
IllegalArgumentException- if any of the required parameters are null or empty
-
CustomDb
public CustomDb()Constructs custom database (that not yet supported) client configuration.Loads configuration values from a YAML file.
Example:CustomDb db = new CustomDb();custom-db: # reserved type url: jdbc:mysql://localhost:3308 username: mysql_user password: mysql_pass await: 600 (optional)
more infoJdbcExecutor(String dbType, String getColumnsQuery)
-
-
Method Details
-
getInstance
Returns the singleton instance ofCustomDbwith config builderCustomDb().This implementation is thread-safe using method-level synchronization.
- Returns:
- the singleton instance of
CustomDb
-
assertCountInTableBuilder
-
recordExistsBuilder
-
showDataFromTableMethod
-
seeInDbByCondMethod
-
getTableColumns
Get array with table column list- Parameters:
tableName- table name- Returns:
- Strings... with columns names
-