Note that there are some explanatory texts on larger screens.

plurals
  1. POFest slows down while testing with swingx jxtreetable
    text
    copied!<p>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.</p> <p>I have raised a bug for this in github. Please tell me if this is something that I am doing wrong instead. I am not able to reproduce the problem when I tried to create an SSCCE.</p> <p>Anyway, here's a video of it slowing down.</p> <p><a href="http://screencast.com/t/liNttCw2In0w" rel="nofollow noreferrer">http://screencast.com/t/liNttCw2In0w</a></p> <p>At times 0.39s to 0.40 a set of operations are performed. These are done when there is one row in the JXTreeTable.</p> <p>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.</p> <p>I have attached a screenshot taken at the time when fest slows down, which attempts to explain it more</p> <p><img src="https://i.stack.imgur.com/pb99k.png" alt="enter image description here"></p> <p>This is the code that does the work:</p> <p>Step 1) Selecting a node from the tree is done as below:</p> <p>JTreeFixture folioTreeFixture = importShareholders.panel("treePanel").tree("folioTree");</p> <pre><code> 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()); </code></pre> <p>Step 2) Searching and selecting a row from the JXTreeTable</p> <pre><code>int selectRow=-1; JTableFixture table=importShareholders.table("historyTable"); for(int i=0;i&lt;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) &amp;&amp; StringUtils.isNotEmpty(certificateNumber) &amp;&amp; Integer.parseInt(certificateNumber)==certNo){ selectRow=i; break; } } if(selectRow==-1){ fail("Couldn't find certificate number to transfer"); } </code></pre> <p>Step 3) Showing the pop up menu and clicking the row</p> <pre><code>table.showPopupMenuAt(TableCell.row(selectRow).column(0)).menuItem("btnTransfer").click(); </code></pre> <p>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</p> <p>I have profiled the application and I dont find anything untoward happening. I dont have a lot of experience profiling applications. I would be grateful if someone could have a second look at this. I profiled it with yourkit and have uploaded the snapshot dump here:</p> <p><a href="https://www.dropbox.com/s/dh976v01q9c3sgj/ImportShareholderData.shouldTransferAndSplit-2013-06-14-shutdown.snapshot.zip" rel="nofollow noreferrer">https://www.dropbox.com/s/dh976v01q9c3sgj/ImportShareholderData.shouldTransferAndSplit-2013-06-14-shutdown.snapshot.zip</a></p> <p>Any help will be greatly appreciated.. </p> <p><strong>EDIT:</strong></p> <p><strong>I think I forgot to mention the same thing works when I do it manually. It only slows down with fest. That leads me to believe that there is an issue with fest maybe?</strong> </p> <p>Sorry about that. </p> <p><strong>EDIT 2:</strong> As request by Marcin (sorry for the delay Marcin).. Here's the code when the first row is getting split</p> <pre><code>public List&lt;Integer&gt; splitRowEqually(ShareType shareType, String date, int folioNo, int certNo, int... certnos) throws NoSuchFieldException, TorqueException { //select a tree node selectFolioInTree(shareType, folioNo); Pause.pause(new Condition("Wait until tab is created") { @Override public boolean test() { return importShareholders.tabbedPane().tabTitles().length&gt;0; } }); //select a row on the table to split int row=selectRowWithCertNunber(certNo); List&lt;Integer&gt; rowsIndexes=new ArrayList&lt;Integer&gt;(); JTableFixture table = importShareholders.table(); //show popup menu on that row and select split table.showPopupMenuAt(row(row).column(columnIndex(TRANS_TYPE))).menuItem("btnSplit").click(); DialogFixture splitDialog=FinderUtilities.getDialogWithTitle("Split Share Certificate"); splitDialog.textBox("tfDateOfSplit").setText(date); int noOfShares= Integer.parseInt(table.cell(row(row).column(columnIndex(NO_OF_SHARES))).value()); int distFrom= Integer.parseInt(table.cell(row(row).column(columnIndex(DIST_NO_FROM))).value()); int distTo= Integer.parseInt(table.cell(row(row).column(columnIndex(DIST_NO_TO))).value()); //split the row into the number of times decided by the certnos array int noOfSharesInEachSplit=noOfShares/certnos.length; for(int i=0;i&lt;certnos.length;i++){ int distToInSplit = distFrom + noOfSharesInEachSplit-1; enterSplitRowDetails(splitDialog, certnos[i], distFrom, distToInSplit&lt;=distTo ? distToInSplit : distTo); distFrom=distToInSplit+1; rowsIndexes.add(row++); } splitDialog.button("btnSplit").click(); return rowsIndexes; } //selects a node from the left hand side tree public void selectFolioInTree(final ShareType shareType,final int folioNo) throws TorqueException { JTreeFixture folioTreeFixture = importShareholders.panel("treePanel").tree("folioTree"); folioTreeFixture.separator("~"); // I use these wrapper classes - StringWrapper and FolioTreeRep, so that I can get a html // string for the tree node like &lt;html&gt;&lt;b&gt;Shareholder&lt;/b&gt;&lt;/html&gt; String treePath = new StringWrapper("Shareholders", true) + "~" + (ShareType.isEquity(shareType) ? new StringWrapper("Equity Folios", true) : new StringWrapper("Preference Folios", true)) + "~" + new FolioTreeRep(mapOfFolioNames.get(folioNo), folioNo, shareType).toString(); folioTreeFixture.clickPath(treePath); } //search the table for a row that contains the cert no provided in the Certificate Number column. private int selectRowWithCertNunber(int certNo) throws NoSuchFieldException { int selectRow=-1; JTableFixture table=importShareholders.table("historyTable"); for(int i=0;i&lt;table.rowCount();i++){ String certificateNumber = table.cell(row(i).column(columnIndex(CERT_NO))).value(); String remarks=table.cell(row(i).column(columnIndex(REMARKS))).value(); if(StringUtils.isEmpty(remarks) &amp;&amp; StringUtils.isNotEmpty(certificateNumber) &amp;&amp; Integer.parseInt(certificateNumber)==certNo){ selectRow=i; break; } } if(selectRow==-1){ fail("Couldn't find certificate number to transfer"); } return selectRow; } // enter details on the table in the SplitDialog private void enterSplitRowDetails(DialogFixture splitDialog, int cert, int distFrom, int distTo) { splitDialog.button("btnAdd").click(); int row = splitDialog.table().rowCount(); splitDialog.table().enterValue(row(row - 1).column(0), String.valueOf(cert)); splitDialog.table().enterValue(row(row - 1).column(1), String.valueOf(distFrom)); splitDialog.table().enterValue(row(row - 1).column(2), String.valueOf(distTo)); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload