On Sun, Apr 29, 2012 at 4:33 AM, C0deAttack <
c0deatt...@gmail.com> wrote:
>
>
> On Saturday, April 28, 2012 10:11:14 PM UTC+1, Aslak Hellesøy wrote:
>>
>>
>>
>> On Apr 28, 2012, at 12:27, C0deAttack wrote:
>>
>> I've given up on this. I went and had a look in the code and the Features
>> are not loaded as resources through a classloader from what I can tell, so
>> that's why I believe it has not worked.
>>
>>
>> Actually, they are. Via ClasspathResourceLoader
>>
>> Aslak
>>
>
> I hate to say "are you sure?" since this is your project, but are you sure?
Touché. The CLI runner uses the file system (fs) to load resources,
the JUnit runner uses the classpath (cp). When I made this decision a
while back I was thinking that the CLI runner would primarily be used
by non-java backends (clojure, jruby, jython etc) that are less likely
to rely on the cp for loading features. Likewise, people using the
JUnit runner are more likely to be using the java backend, and would
need the cp loader.
I now realise it's not that simple. The decision whether to use the fs
or cp should be made by the backend (java, groovy, jruby, clojure etc)
and not byt the runner (junit or CLI).
In some cases a backend might want both. This is the case for Groovy
which might want to load glue code from the fs (.groovy sources) or
from the cp (compiled groovy .class files).
I have created a new ticket for this where you can contribute your
thoughts on this:
https://github.com/cucumber/cucumber-jvm/issues/312
Aslak
> This is the line from the run() method invoked in the cucumber.cli.Main
> class:
>
> Runtime runtime = new Runtime(new FileResourceLoader(), classLoader,
> runtimeOptions);
>
> Unless I've got this wrong and misunderstood something that
> FileResourceLoader doesn't try to load anything via the Classpath?
>
> Regards,
> C0de.
>