Re: Unit tests seeing test application context files in their dependencies

2008-06-17 Thread James Rutherford
On Tue, Jun 17, 2008 at 12:00:51PM +, 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
> >  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  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]



Re: Deployable archive including libs

2008-06-16 Thread James Rutherford
On Mon, Jun 16, 2008 at 12:06:14PM +, sourcex wrote:
> Thanks for the support - unfortunately my WAR archive is fine, but the JAR
> isn't bundled with its libraries. It's  declared as
> jar

You need jar-with-dependencies. See:

http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html

cheers,

Jim

> and the dependent libraries are not included
> there. My JSE project is actually the Hibernate DB part, which has 10
> required libs (jdbc, hibernate, asm, db driver etc) and they are not in my
> archive after 'mvn package'. If it's not possible to put them in, I could
> merge the projects in one project with WAR archive only, but it's too
> coupled this way.
> 
> I'll try to add my jse project as a dependency in the web one though, thanks
> again.
> 
> 
> --
> View this message in context: 
> http://www.nabble.com/Deployable-archive-including-libs-tp17859844p17863130.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
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]