This is an automated email from the ASF dual-hosted git repository. garydgregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git
commit afb65e415ad8fdca5ee16b16c42cbee9ad0a767d Author: Gary Gregory <[email protected]> AuthorDate: Thu Jul 23 14:31:29 2026 -0400 Sort members --- .../commons/beanutils2/sql/DynaResultSetTest.java | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/test/java/org/apache/commons/beanutils2/sql/DynaResultSetTest.java b/src/test/java/org/apache/commons/beanutils2/sql/DynaResultSetTest.java index 73d07a3b..b9183277 100644 --- a/src/test/java/org/apache/commons/beanutils2/sql/DynaResultSetTest.java +++ b/src/test/java/org/apache/commons/beanutils2/sql/DynaResultSetTest.java @@ -99,26 +99,6 @@ class DynaResultSetTest { assertEquals("org.apache.commons.beanutils2.sql.ResultSetDynaClass", dynaClass.getName(), "DynaClass name"); } - /** - * With the default {@code lowerCase} option the property name differs from the real column name, and the read path resolves it through - * {@code getColumnName}. Verify that {@code set} resolves it the same way, so the update targets the real column name and not the lower-cased property - * name. - */ - @Test - void testSetUsesColumnName() throws Exception { - final AtomicReference<String> updatedColumn = new AtomicReference<>(); - final ResultSet resultSet = TestResultSet.createProxy(new TestResultSet() { - @Override - public void updateObject(final String columnName, final Object value) throws SQLException { - updatedColumn.set(columnName); - } - }); - final ResultSetDynaClass rsdc = new ResultSetDynaClass(resultSet); - final DynaBean row = rsdc.iterator().next(); - row.set("stringproperty", "new value"); - assertEquals("stringProperty", updatedColumn.get(), "update targets the real column name"); - } - @Test void testIteratorCount() { @@ -211,4 +191,24 @@ class DynaResultSetTest { assertThrows(UnsupportedOperationException.class, () -> dynaClass.newInstance()); } + /** + * With the default {@code lowerCase} option the property name differs from the real column name, and the read path resolves it through + * {@code getColumnName}. Verify that {@code set} resolves it the same way, so the update targets the real column name and not the lower-cased property + * name. + */ + @Test + void testSetUsesColumnName() throws Exception { + final AtomicReference<String> updatedColumn = new AtomicReference<>(); + final ResultSet resultSet = TestResultSet.createProxy(new TestResultSet() { + @Override + public void updateObject(final String columnName, final Object value) throws SQLException { + updatedColumn.set(columnName); + } + }); + final ResultSetDynaClass rsdc = new ResultSetDynaClass(resultSet); + final DynaBean row = rsdc.iterator().next(); + row.set("stringproperty", "new value"); + assertEquals("stringProperty", updatedColumn.get(), "update targets the real column name"); + } + }
