mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
FIX: Clean up before running tests - otherwise tests will fail if a previous test did not clean up well. (This fixes test failures in Eclipse where tests are executed in different order than in maven) (#1089)
This commit is contained in:
committed by
Rob Bygrave
parent
ff496ad2d3
commit
a5bcd49ecb
@@ -6,6 +6,7 @@ import org.tests.inherit.ChildA;
|
||||
import org.tests.inherit.ChildB;
|
||||
import org.tests.inherit.Data;
|
||||
import org.tests.inherit.Parent;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -16,6 +17,14 @@ import static org.junit.Assert.assertNotNull;
|
||||
|
||||
public class ParentQueryTest extends BaseTestCase {
|
||||
|
||||
@Before
|
||||
public void clearDb() {
|
||||
Ebean.deleteAll(Ebean.find(Data.class).findList());
|
||||
//@rob: this does not work as it does not clear the ManyToMany relations.
|
||||
//Ebean.find(Data.class).delete();
|
||||
Ebean.find(Parent.class).delete();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void QueryParentCollectionFetch() {
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.tests.inherit.Data;
|
||||
import org.tests.inherit.EUncle;
|
||||
import org.tests.inherit.Parent;
|
||||
import org.tests.inherit.ParentAggregate;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -20,6 +21,14 @@ import static org.junit.Assert.*;
|
||||
|
||||
public class ParentRawSqlTest extends BaseTestCase {
|
||||
|
||||
@Before
|
||||
public void clearDb() {
|
||||
Ebean.deleteAll(Ebean.find(Data.class).findList());
|
||||
//@rob: this does not work as it does not clear the ManyToMany relations.
|
||||
//Ebean.find(Data.class).delete();
|
||||
Ebean.find(Parent.class).delete();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void RawSqlParentLoad() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user