Improved: Added support for EntityQuery methods in OFBiz integration tests.

(OFBIZ-11247)

Thanks: Jacques for the review.
This commit is contained in:
Pawan Verma
2020-04-29 15:28:42 +05:30
parent 0f777b7de2
commit 1b3d3bdf4e
@@ -21,10 +21,13 @@ package org.apache.ofbiz.service.testtools;
import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.model.DynamicViewEntity;
import org.apache.ofbiz.entity.testtools.EntityTestCase;
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.service.LocalDispatcher;
import java.util.Set;
public class OFBizTestCase extends EntityTestCase {
protected LocalDispatcher dispatcher = null;
@@ -53,4 +56,20 @@ public class OFBizTestCase extends EntityTestCase {
protected GenericValue getUserLogin() throws GenericEntityException {
return getUserLogin("system");
}
protected EntityQuery from(String entityName) {
return EntityQuery.use(delegator).from(entityName);
}
protected EntityQuery from(DynamicViewEntity dynamicViewEntity) {
return EntityQuery.use(delegator).from(dynamicViewEntity);
}
protected EntityQuery select(String... fields) {
return EntityQuery.use(delegator).select(fields);
}
protected EntityQuery select(Set<String> fields) {
return EntityQuery.use(delegator).select(fields);
}
}