New issue 41 by tomas.varaneckas: Support for rollback-only transactions
for unit testing
http://code.google.com/p/warp-persist/issues/detail?id=41
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.
Attachments:
rollbackonly.diff 31.4 KB
warp-persist-2.0-20101013.jar 503 KB
warp-persist-2.0-20101013-src.jar 100 KB
Hi, thanks for the contribution. Warp-persist has now been superseded by
Guice-persist. Any chance you can contribute it there?
Sure, I'll take a look at it and post a new patch there in a while.
Here's the patch for Guice-persist:
http://code.google.com/p/google-guice/issues/detail?id=551