mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Remove unused ServerConfig debugSql options, Update Tests to use agentloader
This commit is contained in:
@@ -3,37 +3,36 @@ package com.avaje.tests.query;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.Query;
|
||||
import com.avaje.tests.model.basic.Order;
|
||||
import com.avaje.tests.model.basic.ResetBasicData;
|
||||
|
||||
public class TestRowCount extends TestCase {
|
||||
public class TestRowCount extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Query<Order> query = Ebean.find(Order.class).fetch("details").where().gt("id", 1)
|
||||
.gt("details.id", 1).order("id desc");
|
||||
|
||||
int rc = query.findRowCount();
|
||||
System.out.println("rc:" + rc);
|
||||
|
||||
List<Object> ids = query.findIds();
|
||||
System.out.println("ids:" + ids);
|
||||
|
||||
List<Order> list = query.findList();
|
||||
System.out.println(list);
|
||||
|
||||
Assert.assertEquals("same rc to ids.size() ", rc, ids.size());
|
||||
Assert.assertEquals("same rc to list.size()", rc, list.size());
|
||||
}
|
||||
|
||||
public void test(){
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Query<Order> query = Ebean.find(Order.class)
|
||||
.fetch("details")
|
||||
.where().gt("id", 1)
|
||||
.gt("details.id", 1)
|
||||
.order("id desc");
|
||||
|
||||
|
||||
int rc = query.findRowCount();
|
||||
System.out.println("rc:"+rc);
|
||||
|
||||
List<Object> ids = query.findIds();
|
||||
System.out.println("ids:"+ids);
|
||||
|
||||
List<Order> list = query.findList();
|
||||
System.out.println(list);
|
||||
|
||||
Assert.assertEquals("same rc to ids.size() ", rc, ids.size());
|
||||
Assert.assertEquals("same rc to list.size()", rc, list.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user