Skip to content

Commit 1b722c1

Browse files
committed
Fix ambiguous method signatures; update documentation
1 parent 44d7150 commit 1b722c1

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ The objects passed to your service provider implementation are members of a hier
2020

2121
* `LifecycleHooks.getParentOf(Object runner)`
2222
Get the parent runner that owns the specified child runner.
23-
* `LifecycleHooks.getTestClassFor(Object target)`
24-
Get the test class object that wraps the specified instance.
23+
* `LifecycleHooks.getParentOf(FrameworkMethod method)`
24+
Get the parent runner that owns the specified method.
25+
* `LifecycleHooks.getRunnerForTarget(Object target)`
26+
Get the parent runner owns the specified instance.
2527
* `LifecycleHooks.getRunnerFor(TestClass testClass)`
2628
Get the parent runner associated with the specified test class object.
2729
* `LifecycleHooks.getTestClassWith(Object method)`
@@ -72,8 +74,8 @@ public class ExploringWatcher implements TestClassWatcher2, MethodWatcher {
7274
public void beforeInvocation(Object target, FrameworkMethod method, Object... params) {
7375
// get the 'atomic test' for this method
7476
AtomicTest atomicTest = RunReflectiveCall.getAtomicTestFor(method);
75-
// get the test class of the runner that owns this method
76-
TestClass testClass = LifecycleHooks.getTestClassFor(target);
77+
// get the runner that owns this target
78+
Object runner = LifecycleHooks.getRunnerForTarget(target);
7779
...
7880
}
7981

src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public static Object intercept(@This final Object runner,
232232
* @param target instance of JUnit test class
233233
* @return {@link org.junit.runners.BlockJUnit4ClassRunner BlockJUnit4ClassRunner} for specified instance
234234
*/
235-
static Object getRunnerFor(Object target) {
235+
static Object getRunnerForTarget(Object target) {
236236
return TARGET_TO_RUNNER.get(target);
237237
}
238238
}
@@ -243,8 +243,8 @@ static Object getRunnerFor(Object target) {
243243
* @param target instance of JUnit test class
244244
* @return {@link org.junit.runners.BlockJUnit4ClassRunner BlockJUnit4ClassRunner} for specified instance
245245
*/
246-
public static Object getRunnerFor(Object target) {
247-
return CreateTest.getRunnerFor(target);
246+
public static Object getRunnerForTarget(Object target) {
247+
return CreateTest.getRunnerForTarget(target);
248248
}
249249

250250
/**
@@ -306,7 +306,7 @@ public static boolean hasConfiguration(TestClass testClass) {
306306
* @return {@link Description} object for the indicated child
307307
*/
308308
public static Description describeChild(Object target, Object child) {
309-
Object runner = getRunnerFor(target);
309+
Object runner = getRunnerForTarget(target);
310310
return invoke(runner, "describeChild", child);
311311
}
312312

0 commit comments

Comments
 (0)