-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathPlayBackend.java
33 lines (28 loc) · 927 Bytes
/
PlayBackend.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package play.cucumber;
import java.lang.reflect.Method;
import java.util.List;
import play.Play;
import cucumber.runtime.io.ResourceLoader;
import cucumber.runtime.Glue;
import cucumber.runtime.Utils;
import cucumber.runtime.java.JavaBackend;
public class PlayBackend extends JavaBackend {
public PlayBackend(ResourceLoader resourceLoader) {
super(resourceLoader);
}
@Override
public void loadGlue(Glue glue, List<String> gluePaths) {
super.loadGlue(glue, gluePaths);
for (Class<?> glueCodeClass : Play.classloader.getAllClasses()) {
while (glueCodeClass != Object.class
&& !glueCodeClass.isInterface()
&& !Utils.isInstantiable(glueCodeClass)) {
// those can't be instantiated without container class present.
glueCodeClass = glueCodeClass.getSuperclass();
}
for (Method method : glueCodeClass.getMethods()) {
loadGlue(glue, method, glueCodeClass);
}
}
}
}