← 输入框|github.com|刷新
Skip to content

Run four tests that were missing @Test - #1094

Merged
rmaucher merged 1 commit into
apache:mainfrom
sharanggupta:run-dead-tests
Oct 19, 2026
Merged

rmaucher merged 1 commit into
apache:mainfrom
sharanggupta:run-dead-tests

Conversation

@sharanggupta

Copy link
Copy Markdown
Contributor

Four test methods have no @Test, so they never run. With @Test added, each failed until fixed:

  • TestBeanNameELResolver.testGetCommonPropertyType01 and 02: their Javadoc says "Confirm it returns String.class", but they asserted null. BeanNameELResolver.getCommonPropertyType always returns String.class, so they now assert that.
  • TestSSLValve.testSslCipherUserKeySizeHeaderBadFormat: d73f69e ("Valve now logs non-integer header values") removed its @Test(expected = NumberFormatException.class) without adding @Test. Run as it was, it failed with a NullPointerException in TesterLogValidationFilter. The logger still had the filter from testSslClientCertBadFormat, which looks for a throwable, and the new warning has none. The test now adds its own filter, as the other tests in the class do, and checks that the warning is logged. TesterLogValidationFilter also no longer fails on a record without a throwable when it looks for one; it treats the record as not matching.
  • TestMemoryUserDatabase.testReloadUserDatabase: it called open() inside the try-with-resources block, before the writer was closed, so the file was still empty and parsing failed with "Premature end of file". It also overwrote the file of the database that the other tests share. It now uses its own temporary file and database, like testDataEscaping, and reloads after the writer is closed.

ant test passes for the three classes, and ant validate passes.

TestBeanNameELResolver.testGetCommonPropertyType01/02 now expect
String.class, which getCommonPropertyType always returns.
TestSSLValve.testSslCipherUserKeySizeHeaderBadFormat lost its annotation
when the valve started logging invalid key sizes; it now uses its own log
filter and checks the warning. TesterLogValidationFilter no longer fails
on a record without a throwable. TestMemoryUserDatabase.testReloadUserDatabase
now reloads after the file is written, using its own file and database.
@rmaucher
rmaucher merged commit 8539171 into apache:main Oct 19, 2026
10 of 11 checks passed
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.

2 participants