In Vaadin as you may know overrided generateCell method is only called when Table needs to build its visible content. So When I write a JUnit Test for this class i couldnt trigger the generateCell method and test it. How can I test this any ideas? Or do I have to use a GUI test tool forthis (which I dont want to because it has quite expensive license)
public class AttributeColumnGenerator implements Table.ColumnGenerator {
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
//lots of code here to be tested
}
}
From my understanding of the question, I don’t think you need to have a GUI test tool here.
There’s my idea for simple testing :
generateCellwith an columnId and itemId.Here’s a snippet of my idea
First my
ColumnGeneratorwho only create a Label with the value of the cell.}
And the test method
Maybe it’s not the best solution, but it’s works.
Hope it’s help!
Regards.