This use isn't pervasive. It is in a Spring bootstrapper. To find some
global config files I use a Spring ClassPathResource to get to them. In
eclipse, I can just add a ClassFolder to LinkToAFolderInTheFileSystem. In
JUnit this is fine. But when I go to the AppServer context, I don't have the
GlobalClassPath Link to something in the file system thing available. I move
the config files around to deploy in the web-app and I need to adjust the
classPathReference accordingly.
If you have another thought here, I am all ears.
Your solution for JUnit detection should work fine. Thanks.
jeff
>> How can I tell if I am running in a JUNIT context? I have some code that
>> needs to behave differently if it is running in an appserver.
[quoted text clipped - 15 lines]
>
> Arne
Mark Space - 05 Sep 2007 05:30 GMT
> This use isn't pervasive. It is in a Spring bootstrapper. To find some
> global config files I use a Spring ClassPathResource to get to them. In
[quoted text clipped - 3 lines]
> the config files around to deploy in the web-app and I need to adjust the
> classPathReference accordingly.
Pass in whatever context you need to do your work in an
environment-independent manner?
For testing, just pass in null instead of a regular context. Then
instead of testing for JUint being on the stack someplace, just test for
the context object being null.