|
1 | 1 | package org.labkey.test.tests.component; |
2 | 2 |
|
3 | 3 | import org.apache.commons.lang3.StringUtils; |
| 4 | +import org.apache.commons.lang3.mutable.MutableInt; |
4 | 5 | import org.json.JSONObject; |
5 | 6 | import org.junit.BeforeClass; |
6 | 7 | import org.junit.Ignore; |
@@ -314,8 +315,8 @@ public void testDragFillSingleRow() |
314 | 315 | // Get the various row heights before adding a value to the multiLine field. |
315 | 316 | WebElement gridRow = Locator.tag("tr").findElements(testGrid).get(1); |
316 | 317 | int rowHeightBefore = gridRow.getSize().height; |
317 | | - var totalHeightBefore = new Object(){int size = 0; }; |
318 | | - Locator.tag("tr").findElements(testGrid).forEach(gr -> totalHeightBefore.size = totalHeightBefore.size + gr.getSize().height); |
| 318 | + var totalHeightBefore = new MutableInt(0); |
| 319 | + Locator.tag("tr").findElements(testGrid).forEach(gr -> totalHeightBefore.add(gr.getSize().height)); |
319 | 320 | WebElement topLeft = testGrid.setCellValue(0, FILL_STRING, stringValue); |
320 | 321 |
|
321 | 322 | testGrid.setCellValue(0, FILL_INT, intValue); |
@@ -351,12 +352,12 @@ public void testDragFillSingleRow() |
351 | 352 | testGrid.getColumnData(FILL_DATE)); |
352 | 353 |
|
353 | 354 | // Check that pasting increased the size of all the rows. |
354 | | - var totalHeightAfter = new Object(){int size = 0; }; |
355 | | - Locator.tag("tr").findElements(testGrid).forEach(gr -> totalHeightAfter.size = totalHeightAfter.size + gr.getSize().height); |
| 355 | + var totalHeightAfter = new MutableInt(0); |
| 356 | + Locator.tag("tr").findElements(testGrid).forEach(gr -> totalHeightAfter.add(gr.getSize().height)); |
356 | 357 |
|
357 | 358 | checker().withScreenshot() |
358 | 359 | .verifyTrue("The total height of all the rows should have increases after the paste.", |
359 | | - totalHeightBefore.size + (3 * rowHeightBefore) >= totalHeightAfter.size); |
| 360 | + totalHeightBefore.intValue() + (3 * rowHeightBefore) >= totalHeightAfter.intValue()); |
360 | 361 | } |
361 | 362 |
|
362 | 363 | @Test |
|
0 commit comments