Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NP in containsCell in TableViews #67

Merged
merged 1 commit into from
Feb 17, 2014
Merged

Conversation

rladstaetter
Copy link
Contributor

This pull request addresses a nullpointer if you use containsCell("...") and there is no match in the table.

TableView.fxml:

<TableView fx:id="entryTableView" prefHeight="199.0" prefWidth="290.0">
              <columns>
                <TableColumn prefWidth="140.0" text="Entry" fx:id="entryColumn" />
                <TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="55.0" text="Default" fx:id="defaultColumn" />
                <TableColumn prefWidth="75.0" text="Navigation">
                  <columns>
                    <TableColumn prefWidth="50.0" text="UP" fx:id="upColumn" />
                    <TableColumn prefWidth="50.0" text="DOWN" fx:id="downColumn" />
                    <TableColumn prefWidth="50.0" style="" text="DEL." fx:id="removeColumn" />
                  </columns>
                </TableColumn>
              </columns>
            </TableView>

Test code:

  verifyThat(GuiTest.find("#entryTableView"), containsCell("item0"))

Stacktrace:

java.lang.NullPointerException
    at org.loadui.testfx.controls.TableViews.containsCell(TableViews.java:83)
    at org.loadui.testfx.controls.TableViews$TableContainsMatcher.matches(TableViews.java:184)
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12)
    at org.loadui.testfx.Assertions.verifyThat(Assertions.java:32)
    at org.loadui.testfx.Assertions.verifyThat(Assertions.java:25)
    at ....

This pull request addresses a nullpointer if you use containsCell("...") and there is no match in the table.

TableView.fxml:

<TableView fx:id="entryTableView" prefHeight="199.0" prefWidth="290.0">
              <columns>
                <TableColumn prefWidth="140.0" text="Entry" fx:id="entryColumn" />
                <TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="55.0" text="Default" fx:id="defaultColumn" />
                <TableColumn prefWidth="75.0" text="Navigation">
                  <columns>
                    <TableColumn prefWidth="50.0" text="UP" fx:id="upColumn" />
                    <TableColumn prefWidth="50.0" text="DOWN" fx:id="downColumn" />
                    <TableColumn prefWidth="50.0" style="" text="DEL." fx:id="removeColumn" />
                  </columns>
                </TableColumn>
              </columns>
            </TableView>

Test code:

  verifyThat(GuiTest.find("#entryTableView"), containsCell("item0"))

Stacktrace:

java.lang.NullPointerException
	at org.loadui.testfx.controls.TableViews.containsCell(TableViews.java:83)
	at org.loadui.testfx.controls.TableViews$TableContainsMatcher.matches(TableViews.java:184)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12)
	at org.loadui.testfx.Assertions.verifyThat(Assertions.java:32)
	at org.loadui.testfx.Assertions.verifyThat(Assertions.java:25)
	at ....
minisu pushed a commit that referenced this pull request Feb 17, 2014
Fix NP in containsCell in TableViews
@minisu minisu merged commit 11edfc7 into TestFX:master Feb 17, 2014
@minisu
Copy link
Member

minisu commented Feb 17, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants