I found these variable setting in the documentation online.
# We want to executive the unit test as separate JVM process
maven.junit.fork = yes
# We want to set up a specific directory for the JVM to run in
## maven.junit.fork = ${basedir}/src/resources
maven.junit.fork = src/resources
Put them in a project.properties, and then I changed at least one
unit test to use classloader.
InputStream is = this.getClass().getResourceAsStream( CONFIG_FILE );
System.out.println("is = "+is); // is = null ?!
IConfigLoader configLoader = new XMLConfigLoader();
Unfortunately the config file is never read. So I am very confused
because I am moving from Ant build file. How do specify that
src/resource should be part of the classpath that executes when
maven runs the unit tests?
--
Peter Pilgrim :: J2EE Software Development
Operations/IT - Credit Suisse First Boston,
Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497
> -----Original Message-----
> From: Pilgrim, Peter [mailto:[EMAIL PROTECTED]
> Sent: 10 October 2005 14:40
> To: 'Maven Users List'
> Subject: RE: Running the test plugin
>
>
>
>
> > -----Original Message-----
> > From: David Rabinowitz [mailto:[EMAIL PROTECTED]
> ==////==
> >
> > Hi,
> >
> >
> > I would put the configuration files for the test inside
> src/test/java
> > (or src/test/conf if you want to be strict), and then they will be
> > copied to test-classes and will be in the classpath. In order
> > to perform
> > the container initialization you can access them using
> > getClass().getResourcesAsStream(...)
> >
> Is there no way way you can do new FileInputStream( "config1.xml" )
> under Maven ?
>
> >
> > David
> >
>
> What if you have scores of unit tests? It would be silly to have
> to reedit all the codebase just to make this change.
>
> >
> > Pilgrim, Peter wrote:
> >
> > >Hi
> > >
> > >I am running the test plugin with ``maven test'' and I am
> > getting a problem.
> > >I have unit test that open configuration files. e.g. to set
> > up IoC container
> > >or specific mock connections to database or other J2EE resources.
> > >
> > >How can tell maven run the unit test from a specific folder?
> > >How can I specify the location of the resources?
> > >
> > >Is there a better way to get maven to dump more specific
> > debug on goal.
> > >I want to run ``maven -X'' but only want to see verbose
> > output when it
> > >is about to run ``TestMixin.java'' for example.
> > >
> > >TIA
> > >
> ==////==
>
> --
> Peter Pilgrim :: J2EE Software Development
> Operations/IT - Credit Suisse First Boston,
> Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
> Tel: +44-(0)207-883-4497
>
> ==============================================================
> ================
> Please access the attached hyperlink for an important
> electronic communications disclaimer:
>
> http://www.csfb.com/legal_terms/disclaimer_external_email.shtml
>
> ==============================================================
> ================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
==============================================================================
Please access the attached hyperlink for an important electronic communications
disclaimer:
http://www.csfb.com/legal_terms/disclaimer_external_email.shtml
==============================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]