Exemple #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());
           }
         });
   }
 }
 @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());
           }
         });
   }
 }
 public JavaBackend(String packagePrefix) {
   this.objectFactory =
       Resources.instantiateExactlyOneSubclass(ObjectFactory.class, "cucumber.runtime");
   new ClasspathMethodScanner().scan(this, packagePrefix);
 }
 public Runtime(String packageName) {
   backends = Resources.instantiateSubclasses(Backend.class, "cucumber.runtime", packageName);
 }