From 13315f3e8b3c9fc8fb12bc1ec5dcce6604c0dba6 Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Mon, 16 Nov 2009 08:50:41 +0000
Subject: [PATCH] [LMS-1268] fixed system tests

SVN: 13397
---
 .../client/testframework/RemoteConsole.java   | 21 ++++++++++---------
 .../URLMethodWithParametersTest.java          |  4 +++-
 2 files changed, 14 insertions(+), 11 deletions(-)
 rename openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/{basic => }/URLMethodWithParametersTest.java (89%)

diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/RemoteConsole.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/RemoteConsole.java
index d0685690eb5..9c8ff78edca 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/RemoteConsole.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/RemoteConsole.java
@@ -145,17 +145,18 @@ public class RemoteConsole
                 final Object result)
         {
             detectCallback(callback);
-            if (entryIndex < commands.size())
+            // Sometimes there are no callbacks activated between execution of two commands.
+            // We invoke them one after another in a while loop.
+            while (areAllCallbacksFinished() && entryIndex < commands.size())
             {
                 ITestCommand cmd = commands.get(entryIndex);
-                // Sometimes there are no callbacks activated between execution of two commands.
-                // We invoke them one after another in a while loop.
-                while (cmd.isValidOnSucess(result) && areAllCallbacksFinished())
+                if (cmd.isValidOnSucess(result))
                 {
-                    while (areAllCallbacksFinished())
-                    {
-                        executeCommand();
-                    }
+                    executeCommand();
+                } else
+                {
+                    // expected failure
+                    return;
                 }
             }
         }
@@ -168,8 +169,8 @@ public class RemoteConsole
             if (entryIndex < commands.size())
             {
                 ITestCommand cmd = commands.get(entryIndex);
-                // It doesn't need to be the last callbacks that fails,
-                // and it should rather be the last command.
+                // It doesn't need to be the last callback that fails,
+                // but command that expects failure should be the last one.
                 if (cmd.isValidOnFailure(callback, failureMessage, throwable))
                 {
                     executeCommand();
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/URLMethodWithParametersTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/URLMethodWithParametersTest.java
similarity index 89%
rename from openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/URLMethodWithParametersTest.java
rename to openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/URLMethodWithParametersTest.java
index 64dc7d83ffa..8b161707e42 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/URLMethodWithParametersTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/URLMethodWithParametersTest.java
@@ -14,11 +14,13 @@
  * limitations under the License.
  */
 
-package ch.systemsx.cisd.openbis.generic.shared.basic;
+package ch.systemsx.cisd.openbis.generic.shared;
 
 import org.testng.AssertJUnit;
 import org.testng.annotations.Test;
 
+import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters;
+
 /**
  * 
  *
-- 
GitLab