mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1238 - Refactor MetaInfoManager - collect query plan stats, fix collection of stats on UpdateQuery
This commit is contained in:
@@ -10,8 +10,24 @@ public class BasicProfileLocationTest {
|
||||
public void obtain() {
|
||||
|
||||
DProfileLocation loc = new DProfileLocation(12);
|
||||
String obtain = loc.obtain();
|
||||
|
||||
assertThat(obtain).endsWith(":12)");
|
||||
assertThat(loc.obtain()).endsWith(":12)");
|
||||
assertThat(loc.shortDescription()).isEqualTo("NativeMethodAccessorImpl.invoke0(Native Method:12)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void basic_trimPackage() {
|
||||
|
||||
BasicProfileLocation loc = new BasicProfileLocation("com.foo.Bar.all");
|
||||
assertThat(loc.obtain()).isEqualTo("com.foo.Bar.all");
|
||||
assertThat(loc.shortDescription()).isEqualTo("Bar.all");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void basic_trimSinglePackage() {
|
||||
|
||||
BasicProfileLocation loc = new BasicProfileLocation("foo.Bar.all");
|
||||
assertThat(loc.obtain()).isEqualTo("foo.Bar.all");
|
||||
assertThat(loc.shortDescription()).isEqualTo("Bar.all");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class DefaultOrmQueryTest extends BaseTestCase {
|
||||
assertThat(q1.getWhereExpressions()).isNotNull();
|
||||
assertThat(q1.getId()).isNull();
|
||||
|
||||
q1.checkIdEqualTo();
|
||||
assertThat(q1.isFindById()).isTrue();
|
||||
|
||||
assertThat(q1.getId()).isEqualTo(42);
|
||||
assertThat(q1.getWhereExpressions()).isNull();
|
||||
@@ -41,7 +41,16 @@ public class DefaultOrmQueryTest extends BaseTestCase {
|
||||
|
||||
DefaultOrmQuery<Order> q1 = (DefaultOrmQuery<Order>) Ebean.find(Order.class).where().idEq(42).query();
|
||||
assertThat(q1.getId()).isEqualTo(42);
|
||||
q1.checkIdEqualTo();
|
||||
assertThat(q1.isFindById()).isTrue();
|
||||
assertThat(q1.getId()).isEqualTo(42);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkForId_when_setId_ok() {
|
||||
|
||||
DefaultOrmQuery<Order> q1 = (DefaultOrmQuery<Order>) Ebean.find(Order.class).setId(42);
|
||||
assertThat(q1.getId()).isEqualTo(42);
|
||||
assertThat(q1.isFindById()).isTrue();
|
||||
assertThat(q1.getId()).isEqualTo(42);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user