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:
@@ -2,10 +2,10 @@ package com.avaje.tests.query;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.EbeanServer;
|
||||
import com.avaje.ebean.FetchConfig;
|
||||
@@ -14,31 +14,29 @@ import com.avaje.ebean.QueryResultVisitor;
|
||||
import com.avaje.tests.model.basic.Customer;
|
||||
import com.avaje.tests.model.basic.ResetBasicData;
|
||||
|
||||
public class TestQueryFindVisit extends TestCase {
|
||||
public class TestQueryFindVisit extends BaseTestCase {
|
||||
|
||||
public void test() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
EbeanServer server = Ebean.getServer(null);
|
||||
|
||||
Query<Customer> query = server.find(Customer.class)
|
||||
.setAutofetch(false)
|
||||
.fetch("contacts",new FetchConfig().query(2))
|
||||
.where().gt("id", 0)
|
||||
.orderBy("id")
|
||||
.setMaxRows(2);
|
||||
|
||||
final AtomicInteger counter = new AtomicInteger(0);
|
||||
|
||||
query.findVisit(new QueryResultVisitor<Customer>() {
|
||||
|
||||
public boolean accept(Customer bean) {
|
||||
counter.incrementAndGet();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Assert.assertEquals(2, counter.get());
|
||||
}
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
EbeanServer server = Ebean.getServer(null);
|
||||
|
||||
Query<Customer> query = server.find(Customer.class).setAutofetch(false)
|
||||
.fetch("contacts", new FetchConfig().query(2)).where().gt("id", 0).orderBy("id")
|
||||
.setMaxRows(2);
|
||||
|
||||
final AtomicInteger counter = new AtomicInteger(0);
|
||||
|
||||
query.findVisit(new QueryResultVisitor<Customer>() {
|
||||
|
||||
public boolean accept(Customer bean) {
|
||||
counter.incrementAndGet();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Assert.assertEquals(2, counter.get());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user