This is an automated email from the ASF dual-hosted git repository.
pawan pushed a commit to branch trunk
in repository
https://gitbox.apache.org/repos/asf/ofbiz-framework.gitThe following commit(s) were added to refs/heads/trunk by this push:
new 1b3d3bd Improved: Added support for EntityQuery methods in OFBiz integration tests. (OFBIZ-11247)
1b3d3bd is described below
commit 1b3d3bdf4e4ebcf3597a2bb97b22c41cbe20cf6c
Author: Pawan Verma <
[hidden email]>
AuthorDate: Wed Apr 29 15:28:42 2020 +0530
Improved: Added support for EntityQuery methods in OFBiz integration tests.
(OFBIZ-11247)
Thanks: Jacques for the review.
---
.../apache/ofbiz/service/testtools/OFBizTestCase.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/testtools/OFBizTestCase.java b/framework/service/src/main/java/org/apache/ofbiz/service/testtools/OFBizTestCase.java
index 4ba8488..257ae47 100644
--- a/framework/service/src/main/java/org/apache/ofbiz/service/testtools/OFBizTestCase.java
+++ b/framework/service/src/main/java/org/apache/ofbiz/service/testtools/OFBizTestCase.java
@@ -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);
+ }
}