FitNesse Update Fixture now understands and evaluate variables on where clause

Description

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.

Environment

Ubuntu 16.10
Mate Desktop Environment
Kernel Linux 4.8.0-39-generic x86_64

Eclipse 2018-09
Oracle JDK 10

Attachments

5
  • 21 Nov 2018, 06:14 PM
  • 21 Nov 2018, 06:14 PM
  • 21 Nov 2018, 06:14 PM
  • 21 Nov 2018, 06:14 PM
  • 21 Nov 2018, 06:14 PM

Activity

Show:

Carlos Ruiz July 30, 2020 at 4:30 PM

Closing as Potential-Idea.

I'll leave it to for review, as he's the maintainer of the fitnesse as repository.

Please reopen if is worthy to integrate.

Incomplete

Details

Assignee

Reporter

Original 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