mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
initial add of EbeanORM server based on v2.8.1
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.avaje.tests.transaction;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.TxRunnable;
|
||||
|
||||
public class TestNested extends TestCase {
|
||||
|
||||
|
||||
public void test() {
|
||||
|
||||
try {
|
||||
Ebean.execute(new TxRunnable() {
|
||||
public void run() {
|
||||
|
||||
willFail();
|
||||
}
|
||||
});
|
||||
} catch (RuntimeException e){
|
||||
Assert.assertEquals(e.getMessage(), "test rollback");
|
||||
}
|
||||
}
|
||||
|
||||
private void willFail() {
|
||||
Ebean.execute(new TxRunnable() {
|
||||
public void run() {
|
||||
|
||||
String msg = "test rollback";
|
||||
throw new RuntimeException(msg);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user