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

Assertion fails with ArrayIndexOutOfBoundsException when too many columns are expected #44

Closed
kaklakariada opened this issue Jul 11, 2023 · 0 comments · Fixed by #47
Closed
Assignees
Labels
bug Unwanted / harmful behavior

Comments

@kaklakariada
Copy link
Contributor

When an assertion expects more columns than the result set contains, it fails with the following exception:

java.lang.AssertionError: Unable to read actual result set value in row 1, column 6: java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5
        at com.exasol.matcher.ResultSetStructureMatcher.matchValuesInRow(ResultSetStructureMatcher.java:266)
        at com.exasol.matcher.ResultSetStructureMatcher.matchRowsInOrder(ResultSetStructureMatcher.java:143)
        at com.exasol.matcher.ResultSetStructureMatcher.matchesSafely(ResultSetStructureMatcher.java:132)
        at com.exasol.matcher.ResultSetStructureMatcher.matchesSafely(ResultSetStructureMatcher.java:19)
        at org.hamcrest.TypeSafeMatcher.matches(TypeSafeMatcher.java:65)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
        at com.exasol.AbstractLuaVirtualSchemaIT.assertQueryWithUser(AbstractLuaVirtualSchemaIT.java:146)
....
Caused by: java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5
        at com.exasol.jdbc.EXAResultSet.ex(EXAResultSet.java:160)
        at com.exasol.jdbc.EXAResultSet.getObject(EXAResultSet.java:1109)
        at com.exasol.matcher.ResultSetStructureMatcher.readCellValue(ResultSetStructureMatcher.java:272)
        at com.exasol.matcher.ResultSetStructureMatcher.matchValuesInRow(ResultSetStructureMatcher.java:256)
        ... 80 more
@kaklakariada kaklakariada added the bug Unwanted / harmful behavior label Jul 11, 2023
@redcatbear redcatbear self-assigned this Oct 27, 2023
redcatbear added a commit that referenced this issue Oct 27, 2023
redcatbear added a commit that referenced this issue Oct 27, 2023
redcatbear added a commit that referenced this issue Oct 27, 2023
…nt. (#47)

* #44: Improved reporting of situation where more columns are expected than present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
2 participants