[ofbiz-plugins] branch trunk updated: Improved: Used utility provided by OFBizTestCase class for userLogin instead of fetching from DB test cases also removed unused fetching of userLogin in some cases (OFBIZ-11618)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-plugins] branch trunk updated: Improved: Used utility provided by OFBizTestCase class for userLogin instead of fetching from DB test cases also removed unused fetching of userLogin in some cases (OFBIZ-11618)

Pawan Verma-2
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-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f572e74  Improved: Used utility provided by OFBizTestCase class for userLogin instead of fetching from DB test cases also removed unused fetching of userLogin in some cases (OFBIZ-11618)
f572e74 is described below

commit f572e74e7e07324b4945166c3988e24f57b6cc72
Author: Pawan Verma <[hidden email]>
AuthorDate: Thu Apr 30 22:01:29 2020 +0530

    Improved: Used utility provided by OFBizTestCase class for userLogin instead of fetching from DB test cases also removed unused fetching of userLogin in some cases
    (OFBIZ-11618)
---
 .../src/main/java/org/apache/ofbiz/content/test/LuceneTests.java  | 8 +-------
 solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java      | 6 ------
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java b/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java
index 58182d8..40aa62b 100644
--- a/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java
+++ b/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java
@@ -43,7 +43,6 @@ import org.apache.ofbiz.service.testtools.OFBizTestCase;
 
 public class LuceneTests extends OFBizTestCase {
 
-    protected GenericValue userLogin = null;
     public final static String MODULE = LuceneTests.class.getName();
 
     public LuceneTests(String name) {
@@ -51,18 +50,13 @@ public class LuceneTests extends OFBizTestCase {
     }
 
     @Override
-    protected void setUp() throws Exception {
-        userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", "system").queryOne();
-    }
-
-    @Override
     protected void tearDown() throws Exception {
     }
 
     public void testSearchTermHand() throws Exception {
         Map<String, Object> ctx = new HashMap<>();
         ctx.put("contentId", "LuceneCONTENT");
-        ctx.put("userLogin", userLogin);
+        ctx.put("userLogin", getUserLogin("system"));
         Map<String, Object> resp = dispatcher.runSync("indexContentTree", ctx);
         if (ServiceUtil.isError(resp)) {
             String errorMessage = ServiceUtil.getErrorMessage(resp);
diff --git a/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java b/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java
index 2c09743..440e337 100644
--- a/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java
+++ b/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java
@@ -32,7 +32,6 @@ import org.apache.ofbiz.service.testtools.OFBizTestCase;
 
 public class SolrTests extends OFBizTestCase {
 
-    protected GenericValue userLogin = null;
     private Map<String, Object> context;
     private Map<String, Object> response;
     private String validTestProductId = "GZ-1006";
@@ -44,11 +43,6 @@ public class SolrTests extends OFBizTestCase {
     }
 
     @Override
-    protected void setUp() throws Exception {
-        userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", "system").queryOne();
-    }
-
-    @Override
     protected void tearDown() throws Exception {
     }