File tree Expand file tree Collapse file tree
src/main/java/com/google/testing/junit/testparameterinjector Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515package com .google .testing .junit .testparameterinjector ;
1616
17- import com .google .common .collect .ImmutableList ;
1817import java .util .List ;
19- import org .junit .rules .TestRule ;
20- import org .junit .runner .Description ;
2118import 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 \n Beginning test: " + testName );
59- try {
60- originalStatement .evaluate ();
61- } finally {
62- System .out .println ("\n End of test: " + testName );
63- }
64- }
65- };
66- }
67- }
6836}
You can’t perform that action at this time.
0 commit comments