On Tue, Jun 17, 2008 at 12:00:51PM +0000, Kristian Rink wrote:
> Am Tue, 17 Jun 2008 03:39:19 -0700 (PDT)
> schrieb Papapara Tudu <[EMAIL PROTECTED]>:
> 
> > The test application context in the dependency is located in the
> > /src/test/resources folder in its project
> > (in the project I'm writing the tests for, my app context is in
> > /src/test/resources also).
> 
> I see... Used to do this only while having the context configuration
> somewhere in src/main/resources.
> 
> 
> > The actual error I'm getting when I use the
> > <import resource="classpath:DependencyTestContext.xml" /> line is:
> >
> > org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> > Configuration problem: Failed to import bean definitions from URL
> > location [classpath:DependencyTestContext.xml]
> 
> Off-hands I am not sure whether the _test_ classpath of an artifact the
> project depends upon is available to that project. Looking at how
> things work for test classes (src/test/java , which aren't part of the
> deployed artifact), I'd take a guess that this might be your problem...
> This would explain this behaviour as, this way, things below src/test
> won't be available to you when depending upon the (binary) artifact (in
> your repository). Don't really know how to get along this, anyhow.
> Anyone else? :)

The approach I've used is to have (eg) DependencyContext.xml for the
live service under src/main/resources/ and one for tests (with the same
name) under src/test/resources/. This way, the <import...> statement
(which is presumably in a file under src/main/resources/) should pick up
the correct resource for both situations because of the way the
classpath is constructed.

cheers,

Jim

-- 
James Rutherford          |  Hewlett-Packard Limited registered Office:
Research Engineer         |  Cain Road,
HP Labs                   |  Bracknell,
Bristol, UK               |  Berks
+44 117 312 7066          |  RG12 1HN.
[EMAIL PROTECTED]   |  Registered No: 690597 England

The contents of this message and any attachments to it are confidential
and may be legally privileged. If you have received this message in
error, you should delete it from your system immediately and advise the
sender. To any recipient of this message within HP, unless otherwise
stated you should consider this message and attachments as "HP
CONFIDENTIAL".

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to