wangscript / warp-persist

Automatically exported from code.google.com/p/warp-persist
0 stars 0 forks source link

Support for rollback-only transactions for unit testing #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently there is no support for rollback only transactions, so unit tests are 
committing data to db. The provided patch makes warp-persist Transactional 
annotation get a new property:

@Test
@Transactional(rollbackOnly=true)
public void testSomething() throws Exception {
 //do database manipulation
}

After method is executed, changes will be rolled back.
P.S. The patch introduced some additional source formatting due to my IDE 
settings, sorry for that.

Original issue reported on code.google.com by tomas.va...@gmail.com on 13 Oct 2010 at 9:57

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, thanks for the contribution. Warp-persist has now been superseded by 
Guice-persist. Any chance you can contribute it there?

Original comment by dha...@gmail.com on 13 Oct 2010 at 11:05

GoogleCodeExporter commented 9 years ago
Sure, I'll take a look at it and post a new patch there in a while.

Original comment by tomas.va...@gmail.com on 13 Oct 2010 at 11:08

GoogleCodeExporter commented 9 years ago
Here's the patch for Guice-persist:
http://code.google.com/p/google-guice/issues/detail?id=551

Original comment by tomas.va...@gmail.com on 13 Oct 2010 at 11:28