Skip to content

Commit

Permalink
Include parameters in logged test name
Browse files Browse the repository at this point in the history
Include method parameters in the test name used in
LogTestDurationListener.  This fixes the listener when there are
multiple tests in the same class with the same name, but different
numbers of parameters.

Also updated the same named tests to have different names because it is
better for tests to use distinct names.

Fixes: #20807
  • Loading branch information
rschlussel committed Mar 22, 2024
1 parent c4a8f0e commit 7e37ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Object[][] keySupplier()
}

@Test
public void testAddMapStatisticsNoValues()
public void testAddEmptyMapStatistics()
{
MapColumnStatisticsBuilder builder = new MapColumnStatisticsBuilder(true);
ColumnStatistics columnStatistics = builder.buildColumnStatistics();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@ private static String getName(ITestClass testClass)

private static String getName(IInvokedMethod method)
{
return format("%s::%s", method.getTestMethod().getTestClass().getName(), method.getTestMethod().getMethodName());
return format("%s::%s(%s)", method.getTestMethod().getTestClass().getName(), method.getTestMethod().getMethodName(), method.getTestMethod().getConstructorOrMethod().stringifyParameterTypes());
}
}

0 comments on commit 7e37ed6

Please sign in to comment.