use of org.eclipse.scout.rt.shared.services.lookup.LookupCall in project scout.rt by eclipse.
the class StatementProcessorTest method testLookupCall.
@Test
public void testLookupCall() throws Exception {
LookupCall call = new LookupCall() {
private static final long serialVersionUID = 1L;
};
//
AbstractSqlService sqlService = new AbstractSqlService() {
};
BeanInstanceUtil.initializeBeanInstance(sqlService);
StatementProcessor sp = new StatementProcessor(sqlService, "SELECT P.PERSON_NR,P.NAME" + " FROM PERSON P " + " WHERE P.PERSON_NR=:key " + " AND P.NAME like '%'||:text||'%'", new Object[] { call });
sp.simulate();
String sqlPlainTextDump = sp.createSqlDump(false, true);
assertFalse(sqlPlainTextDump.contains("UNPARSED"));
}
use of org.eclipse.scout.rt.shared.services.lookup.LookupCall in project scout.rt by eclipse.
the class BatchNormalizerTest method testCacheable.
/**
* <ul>
* <li>Calls: not null</li>
* <li>Keys: not null</li>
* <li>Cacheable: only some</li>
* </ul>
*/
@SuppressWarnings("unchecked")
@Test
public void testCacheable() throws Exception {
BatchLookupCall batchCall = new BatchLookupCall();
for (int i = 0; i < 1000; i++) {
boolean cacheable = (i % 2 == 0);
LookupCall call = (cacheable ? new FruitLookupCall() : new FruitLookupCallNonCacheable());
long key = (i / 100) + 1;
call.setKey(key);
batchCall.addLookupCall((LookupCall) call);
}
testInternal(batchCall, 10 + 500, 10 + 500, 0, 1000);
}
Aggregations