Skip to content

Commit 7a50ffa

Browse files
committed
Remove the test rule that prints the test name
1 parent aa55317 commit 7a50ffa

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

src/main/java/com/google/testing/junit/testparameterinjector/TestParameterInjector.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@
1414

1515
package com.google.testing.junit.testparameterinjector;
1616

17-
import com.google.common.collect.ImmutableList;
1817
import java.util.List;
19-
import org.junit.rules.TestRule;
20-
import org.junit.runner.Description;
2118
import org.junit.runners.model.InitializationError;
22-
import org.junit.runners.model.Statement;
2319

2420
/**
2521
* A JUnit test runner which knows how to instantiate and run test classes where each test case may
@@ -33,36 +29,8 @@ public TestParameterInjector(Class<?> testClass) throws InitializationError {
3329
super(testClass);
3430
}
3531

36-
@Override
37-
protected List<TestRule> getInnerTestRules() {
38-
return ImmutableList.of(new TestNamePrinterRule());
39-
}
40-
4132
@Override
4233
protected List<TestMethodProcessor> createTestMethodProcessorList() {
4334
return TestMethodProcessors.createNewParameterizedProcessorsWithLegacyFeatures(getTestClass());
4435
}
45-
46-
/** A {@link TestRule} that prints the current test name before and after the test. */
47-
private static final class TestNamePrinterRule implements TestRule {
48-
49-
@Override
50-
public Statement apply(final Statement originalStatement, final Description testDescription) {
51-
return new Statement() {
52-
@Override
53-
public void evaluate() throws Throwable {
54-
String testName =
55-
testDescription.getTestClass().getSimpleName()
56-
+ "."
57-
+ testDescription.getMethodName();
58-
System.out.println("\n\nBeginning test: " + testName);
59-
try {
60-
originalStatement.evaluate();
61-
} finally {
62-
System.out.println("\nEnd of test: " + testName);
63-
}
64-
}
65-
};
66-
}
67-
}
6836
}

0 commit comments

Comments
 (0)