phamow / fest

Automatically exported from code.google.com/p/fest
0 stars 0 forks source link

Table model index validated against number of table column model #232

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a table with two columns, labeled "1" and "2"
2. remove column "1" from the column model by calling
table.getColumnModel().removeColumn(table.getColumnModel().getColumn(0))
3. call
tableFixture.cell(TableCellByColumnName.row(0).column("2")).enterValue("foo")

What is the expected output? What do you see instead?

I expect the value in the cell to be set to "foo."  Instead, I get an
exception like this:

java.lang.IndexOutOfBoundsException: column '5' should be between '0' and '4'
        at
org.fest.swing.driver.JTableCellValidator.validateIndex(JTableCellValidator.java
:83)
        at
org.fest.swing.driver.JTableCellValidator.validateColumn(JTableCellValidator.jav
a:78)
        at
org.fest.swing.driver.JTableCellValidator.validateBounds(JTableCellValidator.jav
a:58)
        at org.fest.swing.driver.JTableDriver.validate(JTableDriver.java:512)
        at
org.fest.swing.driver.JTableDriver.requireEditableEqualTo(JTableDriver.java:435)
        at
org.fest.swing.driver.JTableDriver.requireEditable(JTableDriver.java:419)
        at
org.fest.swing.driver.JTableDriver.enterValueInCell(JTableDriver.java:405)
        at
org.fest.swing.fixture.JTableCellFixture.enterValue(JTableCellFixture.java:253)

What version of the product are you using? On what operating system?

FEST-Swing 1.0b2.1

Please provide any additional information below.

JTableColumnByIdentifierQuery returns the table model index of the column,
but JTableCellValidator.validateIndex(..) compares that to the number of
columns in the table's column model, which might be different.

Original issue reported on code.google.com by geis....@gmail.com on 7 Nov 2008 at 8:27

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Set the module as a label, instead of being part of the title.

Original comment by Alex.Rui...@gmail.com on 1 Dec 2008 at 5:13

GoogleCodeExporter commented 9 years ago
JTableFixture now correctly finds the index of a column given its identifier.

Original comment by Alex.Rui...@gmail.com on 1 Dec 2008 at 7:32