mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Add PagedList was part of #96
This commit is contained in:
@@ -8,7 +8,6 @@ import org.junit.Test;
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.EbeanServer;
|
||||
import com.avaje.ebean.Update;
|
||||
import com.avaje.tests.model.basic.EBasic;
|
||||
|
||||
public class TestExplicitInsert extends BaseTestCase {
|
||||
@@ -16,9 +15,6 @@ public class TestExplicitInsert extends BaseTestCase {
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
// GlobalProperties.put("ebean.classes",
|
||||
// ""+LDPerson.class.toString()+","+EBasic.class.toString());
|
||||
|
||||
EBasic b = new EBasic();
|
||||
b.setName("exp insert");
|
||||
b.setDescription("explicit insert");
|
||||
@@ -38,28 +34,9 @@ public class TestExplicitInsert extends BaseTestCase {
|
||||
Assert.assertNotNull(b2.getId());
|
||||
Assert.assertTrue(!b.getId().equals(b2.getId()));
|
||||
|
||||
List<EBasic> list = server.find(EBasic.class).setMaxRows(10).findList();
|
||||
List<EBasic> list = server.find(EBasic.class).where().in("id",b.getId(), b2.getId()).findList();
|
||||
|
||||
Assert.assertTrue(list.size() >= 2);
|
||||
|
||||
int firstRow = 1;
|
||||
List<EBasic> list2 = server.find(EBasic.class).order().asc("id").setFirstRow(firstRow)
|
||||
.setMaxRows(10).findList();
|
||||
|
||||
int expectedCount = list.size() - firstRow;
|
||||
if (expectedCount > 0) {
|
||||
Assert.assertEquals(expectedCount, list2.size());
|
||||
} else {
|
||||
Assert.assertTrue(list2.isEmpty());
|
||||
}
|
||||
|
||||
Update<EBasic> update = Ebean.createUpdate(EBasic.class,
|
||||
"update ebasic set description = 'test'");
|
||||
|
||||
int rows = update.execute();
|
||||
|
||||
Assert.assertTrue(rows > 0);
|
||||
Ebean.externalModification("e_basic", true, false, true);
|
||||
Assert.assertEquals(2, list.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user