I did get the classloader version of the constructor called, but my
class still can't find file.properties.  The Steps class doesn't
actually call ClassLoader.getSystemResource itself.  It delegates to a
utility class that has static methods.  I had my Scenario class pass
the classloader that it received upon construction to this utility
class.

file.properties is in the directory ${project_root}/test/resources/client.

I added that directory to my scenario classpath.  Nothing I've done is working.

On Wed, Dec 30, 2009 at 7:10 PM, Christopher Gardner
<[email protected]> wrote:
> For grins, I added a constructor that takes a classloader and then set
> scenarioRunner classloaderinjected="true".  Based on my print
> statement, the default constructor is always called.
>
> On Wed, Dec 30, 2009 at 6:53 PM, Christopher Gardner
> <[email protected]> wrote:
>> I'm running jbehave in ant and eclipse.  I have a Steps class that
>> calls ClassLoader.getSystemResource("file.properties").  Using
>> Eclipe's JUnit runner works well.  The file is found, and the
>> properties loaded.  When I try to run in ant, however, file.properties
>> can't be found, and I get a NullPointerException.  My ant line looks
>> like this:
>>
>>   <scenarioRunner scenarioIncludes="**/*.java"
>> testSourceDirectory="${test.behavior.dir}"
>>      scope="test"
>> scenarioexcludes="**/*Steps.java,**/base/**/*.java,**/model/**/*.java"
>>  />
>>
>> This worked great in ant until I added the
>> ClassLoader.getSystemResource call.  I have no constructor in any of
>> my Scenario classes that accept class loaders as parameters.  Any
>> suggestions?
>>
>> Thanks.
>>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to