activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: Fixup the code around building the test combinations to better account for a combo option that has no actual values, in this case we just throw that combo out and let the class default be the value used in the test. Before the order of itera
Date Fri, 08 Aug 2014 14:21:35 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 7c2735d0f -> e5ab933d2


Fixup  the code around building the test combinations to better account
for a combo option that has no actual values, in this case we just throw
that combo out and let the class default be the value used in the test.
Before the order of iteration drove the combo build which caused early
exit from the loop if the last enties in the list were empty combo
options. 

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/e5ab933d
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/e5ab933d
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/e5ab933d

Branch: refs/heads/trunk
Commit: e5ab933d2d741d6c9a16ac5756abc4bba680e791
Parents: 7c2735d
Author: Timothy Bish <tabish121@gmail.com>
Authored: Fri Aug 8 10:21:19 2014 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Fri Aug 8 10:21:19 2014 -0400

----------------------------------------------------------------------
 .../apache/activemq/CombinationTestSupport.java | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/e5ab933d/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java
index fefab25..a11505c 100755
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java
@@ -206,15 +206,19 @@ public abstract class CombinationTestSupport extends AutoFailTestSupport
{
             LinkedList<ComboOption> l = new LinkedList<ComboOption>(optionsLeft);
             ComboOption comboOption = l.removeLast();
             int i = 0;
-            for (Iterator<Object> iter = comboOption.values.iterator(); iter.hasNext();)
{
-                Object value = iter.next();
-                if (i != 0) {
-                    map = new HashMap<String, Object>(map);
-                    expandedCombos.add(map);
-                }
-                map.put(comboOption.attribute, value);
+            if (comboOption.values.isEmpty() && !l.isEmpty()) {
                 expandCombinations(l, expandedCombos);
-                i++;
+            } else {
+                for (Iterator<Object> iter = comboOption.values.iterator(); iter.hasNext();)
{
+                    Object value = iter.next();
+                    if (i != 0) {
+                        map = new HashMap<String, Object>(map);
+                        expandedCombos.add(map);
+                    }
+                    map.put(comboOption.attribute, value);
+                    expandCombinations(l, expandedCombos);
+                    i++;
+                }
             }
         }
     }


Mime
View raw message