Is there any way I can apply a Criteria/Criterion object to a sample data value in a unit test to verify that I have constructed it correctly?
I'm building a SmartGWT (2.5) UI for an application that uses its own filter string grammar on the server. I'm translating these filter strings into Criteria/Criterion objects in the client and setting them on a ListGrid. When the ListGrid calls to its DataSource, I intercept the Criteria in transformRequest() and translate it back to our grammar to send to the server.
But when the ListGrid has downloaded the full data set and switches to client-side filtering, I don't always get the result I expect because I have constructed the Criteria object incorrectly.
I want to build unit tests that construct Criteria objects and then evaluate them against individual test values to make sure they match the ones we expect.
Is there a way to do this without constructing a full data-driven ListGrid?
James
I'm building a SmartGWT (2.5) UI for an application that uses its own filter string grammar on the server. I'm translating these filter strings into Criteria/Criterion objects in the client and setting them on a ListGrid. When the ListGrid calls to its DataSource, I intercept the Criteria in transformRequest() and translate it back to our grammar to send to the server.
But when the ListGrid has downloaded the full data set and switches to client-side filtering, I don't always get the result I expect because I have constructed the Criteria object incorrectly.
I want to build unit tests that construct Criteria objects and then evaluate them against individual test values to make sure they match the ones we expect.
Is there a way to do this without constructing a full data-driven ListGrid?
James
Comment