Related to issue 38888: Failing SS Build
authorMartin Taal <martin.taal@openbravo.com>
Tue, 04 Dec 2018 13:26:32 +0100
changeset 7949 42706a78882d
parent 7948 7699203f30f6
child 7950 63182924d21e
Related to issue 38888: Failing SS Build
Now do the query on the right server
src-test/org/openbravo/test/mobile/retail/multiserver/MultiserverUtils.java
--- a/src-test/org/openbravo/test/mobile/retail/multiserver/MultiserverUtils.java	Tue Dec 04 10:17:36 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/multiserver/MultiserverUtils.java	Tue Dec 04 13:26:32 2018 +0100
@@ -194,15 +194,15 @@
   }
 
   public static void removeAllBatchesInError(ServerType server) {
-    removeBatchesInError(server);
-    removeBatchesInError(ServerType.CENTRAL);
+    removeBatchesInError(server, ServerType.CENTRAL);
+    removeBatchesInError(ServerType.CENTRAL, server);
   }
 
-  public static void removeBatchesInError(final ServerType server) {
-    final String serverKey = getServerKey(server);
+  public static void removeBatchesInError(final ServerType fromServer, final ServerType toServer) {
+    final String serverKey = getServerKey(toServer);
     final String sql = "select node_id AS count from sym_outgoing_batch where node_id = '"
         + serverKey + "' and status='ER'";
-    TestLogger.getLogger().info("Removing batch in error on " + server + " " + sql);
+    TestLogger.getLogger().info("Removing batch in error on " + toServer + " " + sql);
 
     new DatabaseHelperQuery() {
       @Override
@@ -219,11 +219,11 @@
           } catch (JSONException e) {
             throw new RuntimeException(e);
           }
-          doKernelActionRequest(server,
+          doKernelActionRequest(fromServer,
               "org.openbravo.replication.symmetricds.process.IgnoreWholeBatch", json.toString());
         }
       }
-    }.execute(sql, server);
+    }.execute(sql, fromServer);
   }
 
   public static void doKernelActionRequest(ServerType server, String action, String content) {