I give them a seperate name. In fact, in a unit test, you do not want to 
load your full "production" context as this may have a big performance 
impact (especially when using Hibernate). The best thing to do is 1) avoid 
loading application contexts where possible by using mock implementations 
for your dependencies 2) When you want to run integration tests, load a 
subset of your "production" context that configures the piece of logic that 
you want to test top-down 3) Have maybe one integration test that loads your 
"production" context as a whole to make sure that there are no errors in 
your configuration. Key message: avoid the use of application context for 
unit testing and default to mock objects. 

Cheers,
Thomas

On 8/18/05, Carlos Sanchez <[EMAIL PROTECTED]> wrote:
> 
> The test ones need to be in the classpath before the main ones. IIRC
> that's by default or maybe in the project.xml build section
> 
> On 8/18/05, Marcelo Alcantara <[EMAIL PROTECTED]> wrote:
> > Hi Carlos,
> >
> > But how do the test ones override the main ones?? Having the same
> > names?? Can you give me more hints about it?? This is just what I
> > need.
> >
> > I will download the oness from home as I cannot go out with maven from
> > the company proxy.
> >
> > Thanks a lot man.
> >
> > Marcelo
> >
> > On 8/18/05, Carlos Sanchez <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > My approach is using classpath application contexts so the ones in
> > > src/test/resources override the ones in src/main/resources.
> > >
> > > You can check it out at http://oness.sourceforge.net
> > >
> > > On 8/18/05, Marcelo Alcantara <[EMAIL PROTECTED]> wrote:
> > > > Friends,
> > > >
> > > > I am using spring in a J2EE project that is being build with maven.
> > > >
> > > > Somebody here have a good picture on how organizing different spring
> > > > applicationContext.xml s for main and test??
> > > >
> > > > To be more clear, in a production environment, my ejb will need to 
> get
> > > > one applicationcontext.xml. In test environment it would need to
> > > > obtain another applicationcontext.
> > > >
> > > > I am sure I am not the first one to have this doubt.
> > > >
> > > >
> > > > Thanks in advance.
> > > > --
> > > > Marcelo Alcantara
> > > > Senior Developer/Architect
> > > > --------------------------------------------------------
> > > > [EMAIL PROTECTED]
> > > > +55 11 81968823
> > > >
> > > > 
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Marcelo Alcantara
> > Senior Developer/Architect
> > --------------------------------------------------------
> > [EMAIL PROTECTED]
> > +55 11 81968823
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to