Migrate Column tests to JUnit 5 so they actually run - #273
Merged
Conversation
ColumnTest, CURColumnTest and AzureColumnTest were written against JUnit 4 (org.junit.Test / org.junit.Assert.*), but pom.xml only declares junit-jupiter-api/engine/params with no junit-vintage-engine. Surefire silently skipped all three: they reported "Tests run: 0" and never appeared in the full run. Swap the imports to org.junit.jupiter.api.Test and org.junit.jupiter.api.Assertions.*, and drop the now-redundant public modifiers on the classes and test methods. No assertion bodies needed changing: none of the files used the JUnit 4 assertEquals(String message, ...) form whose message argument moves to last in Jupiter, and the two calls that looked at risk bind correctly anyway - assertEquals(3.14159, getDouble(r1), 1e-9) to assertEquals(double, double, double) and assertEquals(-1, resolveIndex(...)) to assertEquals(int, int), since resolveIndex returns int. All ten recovered tests passed on the first run, so nothing had drifted while they were dormant. Also delete CURColumnTest, which was a strict subset of ColumnTest: identical three methods, both constructing CURColumn, with ColumnTest adding testResolveIndexOptionalCachesMisses on top. mvn -o test: 356 -> 363 tests, all green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ColumnTest,CURColumnTestandAzureColumnTestwere written against JUnit 4 (org.junit.Test/org.junit.Assert.*), butpom.xmlonly declaresjunit-jupiter-api/engine/params— there is nojunit-vintage-engine. Surefire was silently skipping all three:mvn test -Dtest=ColumnTestreportedTests run: 0, and they never showed up in the full run either.This migrates them to JUnit 5:
org.junit.Test→org.junit.jupiter.api.Testorg.junit.Assert.*→org.junit.jupiter.api.Assertions.*publicmodifiers on the classes and test methodsIt also deletes
CURColumnTest, which was a strict subset ofColumnTest— identical three methods, both constructingCURColumn, withColumnTestaddingtestResolveIndexOptionalCachesMisseson top.Result
mvn -o test: 356 → 363 tests, all green.ColumnTest4,AzureColumnTest3 (the +3 from the deletedCURColumnTestwere pure duplicates)Notes for reviewers
No assertion bodies needed changing, which is the part most likely to bite in a JUnit 4 → 5 migration:
assertEquals(String message, ...)form, whose message argument moves to last in Jupiter. Nothing to reorder.assertEquals(3.14159, col.getDouble(r1), 1e-9)→assertEquals(double, double, double delta), andassertEquals(-1, col.resolveIndex(missing, true))→assertEquals(int, int), sinceColumn.resolveIndexreturnsint. Neither silently picks up a message overload.The diff is otherwise purely mechanical — four import/modifier changes per file.