Related to issue 38888: Failing SS Build
authorMartin Taal <martin.taal@openbravo.com>
Sun, 02 Dec 2018 13:09:14 +0100
changeset 7935 f843643722ea
parent 7934 be4fe54c2e0f
child 7936 785a6c8eb9d8
Related to issue 38888: Failing SS Build
Remove the explicit request to process import entries, is not clear if this request will work in multi-server environments,
will reach the right server. Better to just set the period of the import entry manager to a shorter time.
src-test/org/openbravo/test/mobile/retail/mobilecore/database/MobileCoreDatabaseHelper.java
src-test/org/openbravo/test/mobile/retail/mobilecore/javascript/MobileCoreAPI.java
src-test/org/openbravo/test/mobile/retail/mobilecore/javascript/SynchronizationMonitor.java
src-test/org/openbravo/test/mobile/retail/multiserver/selenium/terminals/WebPOSStore1TerminalHelper.java
src-test/org/openbravo/test/mobile/retail/pack/database/WebPOSDatabaseHelper.java
--- a/src-test/org/openbravo/test/mobile/retail/mobilecore/database/MobileCoreDatabaseHelper.java	Sun Dec 02 11:40:44 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/mobilecore/database/MobileCoreDatabaseHelper.java	Sun Dec 02 13:09:14 2018 +0100
@@ -30,7 +30,6 @@
 
 import org.openbravo.test.mobile.core.utils.AllowedErrorsHelper;
 import org.openbravo.test.mobile.core.utils.TestLogger;
-import org.openbravo.test.mobile.retail.mobilecore.javascript.MobileCoreAPI;
 import org.openbravo.test.mobile.retail.pack.database.ServerType;
 
 public class MobileCoreDatabaseHelper {
@@ -73,8 +72,6 @@
       return;
     }
 
-    MobileCoreAPI.requestProcessImportEntries(server);
-
     TestLogger.getLogger().debug("Verifying that the import table records are processed");
     new DatabaseHelperSelect() {
       @Override
--- a/src-test/org/openbravo/test/mobile/retail/mobilecore/javascript/MobileCoreAPI.java	Sun Dec 02 11:40:44 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/mobilecore/javascript/MobileCoreAPI.java	Sun Dec 02 13:09:14 2018 +0100
@@ -305,23 +305,6 @@
     SeleniumHelper.executeScript(unHook);
   }
 
-  public static void requestProcessImportEntries(ServerType serverType) {
-    // only do this check for store or store2
-    if (!serverType.equals(ServerType.STORE1) && !serverType.equals(ServerType.STORE2)) {
-      return;
-    }
-
-    String requestJS = "new enyo.Ajax({method: 'GET', handleAs: 'text', "
-        + "url: '../../org.openbravo.client.kernel?processId=C1A39F72074A4FAC8F354CF7CA1BF704"
-        + "&reportId=null&windowId=null"
-        + "&_action=org.openbravo.service.importprocess.ProcessImportEntriesProcessActionHandler"
-        + "&authenticationClient=' + OB.UTIL.localStorage.getItem('authenticationClient') + "
-        + "'&authenticationToken=' + OB.UTIL.localStorage.getItem('authenticationToken')}).go()";
-    SeleniumHelper.executeScript(requestJS);
-    // now give the system some time to process
-    OBUtils.pause(2000);
-  }
-
   public static void localStorageClear() {
     TestLogger.getLogger().info("Clearing the localStorage");
     SeleniumHelper.executeScript("OB.UTIL.localStorage.clear()");
--- a/src-test/org/openbravo/test/mobile/retail/mobilecore/javascript/SynchronizationMonitor.java	Sun Dec 02 11:40:44 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/mobilecore/javascript/SynchronizationMonitor.java	Sun Dec 02 13:09:14 2018 +0100
@@ -155,10 +155,6 @@
         final ArrayList<Boolean> areEntriesProcessed = new ArrayList<Boolean>();
         areEntriesProcessed.add(false);
 
-        if (currentIteration > 2) {
-          MobileCoreAPI.requestProcessImportEntries(server);
-        }
-
         new DatabaseHelperSelect() {
           @Override
           protected void yieldResultSet(final ResultSet rs) throws SQLException {
--- a/src-test/org/openbravo/test/mobile/retail/multiserver/selenium/terminals/WebPOSStore1TerminalHelper.java	Sun Dec 02 11:40:44 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/multiserver/selenium/terminals/WebPOSStore1TerminalHelper.java	Sun Dec 02 13:09:14 2018 +0100
@@ -51,8 +51,8 @@
 
   @After
   public void after() {
-    MobileCoreAPI.requestProcessImportEntries(getServerType());
     SynchronizationMonitor.waitUntilImportEntriesHaveBeenProcessed(getServerType());
+    SynchronizationMonitor.waitUntilImportEntriesHaveBeenProcessed(ServerType.CENTRAL);
     super.after();
   }
 
--- a/src-test/org/openbravo/test/mobile/retail/pack/database/WebPOSDatabaseHelper.java	Sun Dec 02 11:40:44 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/pack/database/WebPOSDatabaseHelper.java	Sun Dec 02 13:09:14 2018 +0100
@@ -51,7 +51,6 @@
 import org.openbravo.test.mobile.retail.mobilecore.database.DatabaseHelperStatement;
 import org.openbravo.test.mobile.retail.mobilecore.database.MobileCoreDatabaseHelper;
 import org.openbravo.test.mobile.retail.mobilecore.javascript.BackboneHelper;
-import org.openbravo.test.mobile.retail.mobilecore.javascript.MobileCoreAPI;
 import org.openbravo.test.mobile.retail.mobilecore.selenium.terminals.MobileCoreTerminalHelper;
 import org.openbravo.test.mobile.retail.pack.database.WebPOSDatabaseConstants.VBS_PAYMENTMETHOD;
 import org.openbravo.test.mobile.retail.pack.database.rows.CashupRow;
@@ -225,9 +224,8 @@
   public static int countProcessedImportEntries(ServerType server) {
     int cnt = 0;
     while (countImportEntries("Initial", server) > 0) {
-      OBUtils.pause(1000);
+      OBUtils.pause(5000);
       cnt++;
-      MobileCoreAPI.requestProcessImportEntries(server);
       if (cnt > 10) {
         throw new IllegalStateException(
             "Waiting too long for initial import entries to get processed");