Пример #1
0
 public Runtime(List<String> packageNamesOrScriptPaths) {
   backends =
       Resources.instantiateSubclasses(
           Backend.class,
           "cucumber.runtime",
           new Class[] {List.class},
           new Object[] {packageNamesOrScriptPaths});
 }
 @Override
 public void buildWorld(List<String> gluePaths, World world) {
   this.world = world;
   for (String gluePath : gluePaths) {
     Resources.scan(
         gluePath.replace('.', '/'),
         ".groovy",
         new Consumer() {
           public void consume(Resource resource) {
             shell.evaluate(resource.getString(), resource.getPath());
           }
         });
   }
 }
Пример #3
0
 @Override
 public void buildWorld(List<String> gluePaths, World world) {
   this.world = world;
   jruby.put("$world", new Object());
   for (String gluePath : gluePaths) {
     Resources.scan(
         gluePath.replace('.', '/'),
         ".rb",
         new Consumer() {
           public void consume(Resource resource) {
             jruby.runScriptlet(resource.getReader(), resource.getPath());
           }
         });
   }
 }
Пример #4
0
 public JavaBackend(String packagePrefix) {
   this.objectFactory =
       Resources.instantiateExactlyOneSubclass(ObjectFactory.class, "cucumber.runtime");
   new ClasspathMethodScanner().scan(this, packagePrefix);
 }
Пример #5
0
 public Runtime(String packageName) {
   backends = Resources.instantiateSubclasses(Backend.class, "cucumber.runtime", packageName);
 }