use of com.querydsl.core.testutil.Benchmark in project querydsl by querydsl.
the class QueryPerformanceTest method serialization.
@Test
public void serialization() throws Exception {
QCompanies companies = QCompanies.companies;
final QueryMetadata md = new DefaultQueryMetadata();
md.addJoin(JoinType.DEFAULT, companies);
md.addWhere(companies.id.eq(1L));
md.setProjection(companies.name);
Runner.run("ser1", new Benchmark() {
@Override
public void run(int times) throws Exception {
for (int i = 0; i < times; i++) {
SQLSerializer serializer = new SQLSerializer(conf);
serializer.serialize(md, false);
serializer.getConstants();
serializer.getConstantPaths();
assertNotNull(serializer.toString());
}
}
});
}
Aggregations