You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Phillip Rhodes <sp...@rhoderunner.com> on 2007/04/19 20:35:57 UTC

is there a way to nuke a repo from junit?


I have a bunch of junit tests that are adding things to a mysql-backed junit repository.  I would like to nuke everything on the start of my junit test (mysql tables and file system).

Appreciate the tips!

Phillip

p.s.
A little progress report, I have thumbnails being generated and stored in jackrabbit whenever an image is added to jackrabbit.  I am very pleased thus far.  



Re: is there a way to nuke a repo from junit?

Posted by Alexandru Popescu ☀ <th...@gmail.com>.
On 4/19/07, Phillip Rhodes <sp...@rhoderunner.com> wrote:
>
>
> I have a bunch of junit tests that are adding things to a mysql-backed junit repository.  I would like to nuke everything on the start of my junit test (mysql tables and file system).
>
> Appreciate the tips!
>

My advice would be to look into TestNG (http://testng.org) which
provides much better lifecycle fixtures (5 different levels). It will
allow you to clearly separate your setup code, group different parts
of your tests together through the usage of groups, use tests
dependency for assuring data integrity but also keep you from
duplicating the code, etc.

bests,

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator

> Phillip
>
> p.s.
> A little progress report, I have thumbnails being generated and stored in jackrabbit whenever an image is added to jackrabbit.  I am very pleased thus far.
>
>
>

RE: is there a way to nuke a repo from junit?

Posted by Sudhan <s....@gmail.com>.
Hi Shaun,

My scenario is somewhat similar and am using Maven 2 and continuum for
nightly builds.  I am also using jackrabbit through RMI and configured
spring to tie-up different stuffs.

Now my problem is when i do a build on Continuum, i do not want to have my
repository always available. Is there a way where I can get a instance of
virtual repository and may be clean it up after the test cases are finished.

thanks,

Sudhan


Shaun Barriball wrote:
> 
> Hi Phillip,
> Are you using a build scripting environment like ANT or (even better)
> Maven
> 2.
> We have a test suite which includes a JackRabbit repository.xml that
> creates
> a temporary repository in target/repository directory (relative to the
> build
> directory).
> When using Maven if you do a "mvn clean" it deletes that directory and
> therefore you have a complete setUp, run, tearDown environment for JSR 170
> tests.
> Hope this helps,
> Shaun. 
> 
> -----Original Message-----
> From: Phillip Rhodes [mailto:spamsucks@rhoderunner.com] 
> Sent: 19 April 2007 19:36
> To: users@jackrabbit.apache.org
> Subject: is there a way to nuke a repo from junit?
> 
> 
> 
> I have a bunch of junit tests that are adding things to a mysql-backed
> junit
> repository.  I would like to nuke everything on the start of my junit test
> (mysql tables and file system).
> 
> Appreciate the tips!
> 
> Phillip
> 
> p.s.
> A little progress report, I have thumbnails being generated and stored in
> jackrabbit whenever an image is added to jackrabbit.  I am very pleased
> thus
> far.  
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/is-there-a-way-to-nuke-a-repo-from-junit--tf3608991.html#a10111036
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


RE: is there a way to nuke a repo from junit?

Posted by Shaun Barriball <sb...@yahoo.co.uk>.
Hi Phillip,
Are you using a build scripting environment like ANT or (even better) Maven
2.
We have a test suite which includes a JackRabbit repository.xml that creates
a temporary repository in target/repository directory (relative to the build
directory).
When using Maven if you do a "mvn clean" it deletes that directory and
therefore you have a complete setUp, run, tearDown environment for JSR 170
tests.
Hope this helps,
Shaun. 

-----Original Message-----
From: Phillip Rhodes [mailto:spamsucks@rhoderunner.com] 
Sent: 19 April 2007 19:36
To: users@jackrabbit.apache.org
Subject: is there a way to nuke a repo from junit?



I have a bunch of junit tests that are adding things to a mysql-backed junit
repository.  I would like to nuke everything on the start of my junit test
(mysql tables and file system).

Appreciate the tips!

Phillip

p.s.
A little progress report, I have thumbnails being generated and stored in
jackrabbit whenever an image is added to jackrabbit.  I am very pleased thus
far.