assertj-swing icon indicating copy to clipboard operation
assertj-swing copied to clipboard

Fest slows down while testing with swingx jxtreetable

Open croesch opened this issue 11 years ago • 0 comments

Issue by Sethuraman from Thursday Jun 13, 2013 at 17:25 GMT Originally opened as https://github.com/alexruiz/fest-swing-1.x/issues/20


I am not sure how to explain this. But I'll try.. Fest slows down to crawl while working with JXTreeTable of swingx. It doesn't slow down initially. It works fine for a while, but after a while when the same actions are repeated it slows down badly.

Here's a video of it slowing down.

http://screencast.com/t/liNttCw2In0w

At times 0.39s to 0.40 a set of operations are performed. These are done when there is one row in the JXTreeTable.

At time 0.49 to end of recording the same operation is repeated but there are now 3 rows in the table, it takes very long for the mouse to click.

I have attached a screenshot taken at the time when fest slows down, which attempts to explain it more

screenshot_13_06_13_10_39_pm

This is the code that does the work:

Step 1) Selecting a node from the tree is done as below:

 JTreeFixture folioTreeFixture = importShareholders.panel("treePanel").tree("folioTree");

        folioTreeFixture.separator("~");
        folioTreeFixture.selectPath(new StringWrapper("Shareholders", true)+"~"+
             (ShareType.isEquity(shareType) ? new StringWrapper("Equity Folios", true) : new StringWrapper("Preference Folios", true))+"~"+
                new FolioTreeRep(folio.getName(),folioNo, shareType).toString());

Step 2) Searching and selecting a row from the JXTreeTable

int selectRow=-1;
        JTableFixture table=importShareholders.table("historyTable");
        for(int i=0;i<table.rowCount();i++){
            String certificateNumber = table.cell(TableCell.row(i).column(ShareholderHistoryTable.columnIndex(ShareholderHistoryTable.CERT_NO))).value();
            String remarks=table.cell(TableCell.row(i).column(ShareholderHistoryTable.columnIndex(ShareholderHistoryTable.REMARKS))).value();
            if(StringUtils.isEmpty(remarks) && StringUtils.isNotEmpty(certificateNumber) && Integer.parseInt(certificateNumber)==certNo){
                selectRow=i;
                break;
            }
        }
        if(selectRow==-1){
            fail("Couldn't find certificate number to transfer");
        }
        return selectRow;

Step 3) Showing the pop up menu and clicking the row

table.showPopupMenuAt(TableCell.row(selectRow).column(0)).menuItem("btnTransfer").click();

I am not sure why its slowing down. Please let me know if there is any more info I can help with. Would be grateful for some help in solving the problem

croesch avatar Feb 05 '14 23:02 croesch