#1238 - Refactor MetaInfoManager - collect query plan stats, fix collection of stats on UpdateQuery

This commit is contained in:
Rob Bygrave
2018-01-19 01:07:37 +13:00
parent b9ae76d465
commit 07cdf64ece
27 changed files with 355 additions and 108 deletions
@@ -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);
}