Incomplete
Details
Details
Assignee
Murilo Habermann Torquato
Murilo Habermann TorquatoReporter
Pedro Pozzi Ferreira
Pedro Pozzi FerreiraOriginal estimate
Time tracking
No time logged5h remaining
Affects versions
Priority
Created November 21, 2018 at 6:15 PM
Updated September 4, 2020 at 8:52 PM
Resolved July 30, 2020 at 4:30 PM
Hi Community!
By default, the Update Fixture of the FitNesse iDempiere suite does not accept variables on the Where Clause. Because of that, is a little hard to make dynamic tests, that requires an specific ID to be updated.
To fix that, I've changed the UpdateRecords.java, inside de FitNesseFixture package to make it evaluate the variables.
Before:
whereclause = whereclause.append(" AND AD_Client_ID=").append(Env.getAD_Client_ID(ctx)); String sql = "SELECT * FROM " + tableName + " WHERE "+ whereclause;
As it seems, it only gets the where clause from the Fixture Table and appends it into the sql string. To solve it, I added the following lines:
whereclause = new StringBuilder(Env.parseContext(ctx, windowNo, Util.lowerContextTableColumn(whereclause.toString()), false, false)); whereclause.append(" AND AD_Client_ID=").append(Env.getAD_Client_ID(ctx)); String sql = "SELECT * FROM " + tableName + " WHERE "+ whereclause;
And now the Update Fixture understands variables and include their real values into the sql parameters.
The delete fixture was exactly the same. So I added the same code above in the DeleteRecord.java as well.
You'll find the prints and the patch file anexed here.
Hope that I've helped.
Pedro.