-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove case sensitive support for column names #1
Comments
Looking at the code, I realised that all column-related information were being stored in a "column-to-value" Map. So I added class ColumnKeyMap class that extends LinkedHashMap<String,Value> and provide the following features:
By using this structure to store column-related information, the rest of the code doesn't need to worry about the case of, or to deal with, null/empty column name. At the moment, the structured is being used by the classes: CustomTableMetadata (to store generators by column name), Row (to store values by column name) and TableMetaDataBuilder (to store Column metadata and generators by column name). |
Following DBUnit-Dokumentation DBUnit can be case sensitive. So I don't think that it's a good idea to remove it. |
DBUnit applies case sensitivity exclusively to table names. This issue is about removing case sensitivity on column names, as it can lead to bugs. If you look at AbstractTableMetaData class, which is the base for all ITableMetaData provided by DBUnit at the moment, the method
This means that DBUnit assumes column names are case insensitive and there's no feature, at the moment, to support case sensitivity for column names. |
For example, if you add the following test to the suite of your version of this library, it will break there:
reference_column_case_sensitive.xml
Result:
|
Yes you are right. It should be removed in DataSetRowChanger, which was my fault. Furthermore it would be a good idea to improve the JavaDoc. |
DBUnit itself assumes column names are case insensitive, so there's no need for DataSetBuilder to support it.
Also if DataSetBuilder builds DataSets that are case sensitive these will break when used with valid case insensitive DataSets built with other DBUnit factories.
For instance, how would DataSetBuilder behave if it's using case sensitive String policy for column names and it needs to add the following valid IDataSet?
The text was updated successfully, but these errors were encountered: