-
Notifications
You must be signed in to change notification settings - Fork 11
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
Sort option in compare resultset? #9
Comments
Hi unforgettable631,
Thanks for using jdbcSlim.
It might work that you add the SORT option to the target properties.
If this doesn't works the sort option must be refactored to be able to be called directly. It is this code:
if(sort ){
// Sort the actual values except the header line
//Create a copy to not change the data of the calling function
List<List<String>> tmp = new ArrayList<List<String>>( actual);
tmp.remove(0);
StringListComparator sortComparator = new StringListComparator(actualSortKeys);
Collections.sort( tmp, sortComparator);
tmp.add(0,actualHeader);
actual = tmp;
}
It is currently embedded in the function compareTableWithSort
In the file: https://github.com/six42/jdbcslim/blob/master/src/main/java/six42/fitnesse/jdbcslim/SheetFixture.java
|
Hi six42, Thanks for your reply. I forgot to mention I tried the sort option in both (source & target) properties but unfortunately it had not the result I was hoping for. Fyi, we're very happy that jdbcSlim exists in the way it's already implemented. We've added some more plugins and other fixtures to use it in our BI-environment and tests are running via Jenkins every code commit (or scheduled at night for some environments). Now the testers are adding content (more tests) for QA. I will look into the SheetFixture code tomorrow and let you now! Thanks so far. |
Thanks for the positive feedback and the details how you use it.
Sounds you are mature in test automation and continuous delivery.
I am happy to add any of your additions to jdbcSlim.
I am sure others could benefit from it as well.
|
We are trying to, but we still have some challenges :). I've done some debugging with a few scenario's and (I'm not sure!) it looks like if |
After some more debugging I think I can pinpoint what is happening. The code for sorting isn't triggered (yet). This is the code which determines to get into
If I provide the table header AND define the sort parameter it will hit the
We use it like the Any suggestions how to approach this? Write some new code? |
Before I'll make something for our project I just want to make sure it isn't covered already in the existing jdbcSlim code :). I read the manual and scanned the sources.
Situation
We're using two different databases (Oracle & Sap Hana). We have a testcase querying both of them and the result has to be compared. Both databases have a different algorithm implemented for order by sorting (one binary sort and the other I forgot). Unfortunately adjusting this implementation is not an option (at the moment).
The problem here is the outcome of the result sheets. Because the ordering differs from each other, it will be marked as differences (while in fact there are no differences in this case).
I would like to see there is no difference, because all 4 rows are present in the resultsheet.
Testpage looks something like:
I know if we could use 'SQLCommand | db | query| outputparameter SORT|' outcome of the sorting is for both results the same.
Workaround could be defining the sql statement better, but do you have any advice in this?
The text was updated successfully, but these errors were encountered: