[testng] 42/355: Fix the parameter related bug

Eugene Zhukov eugene-guest at moszumanska.debian.org
Tue Aug 18 10:19:45 UTC 2015


This is an automated email from the git hooks/post-receive script.

eugene-guest pushed a commit to annotated tag OpenBSD
in repository testng.

commit f69437b51799221cb2aaa3dd7a72ff0914a28dd1
Author: etigwuu <tim.t.wu at ericsson.com>
Date:   Fri Jan 24 14:05:59 2014 +0100

    Fix the parameter related bug
---
 .../java/org/testng/xml/TestNGContentHandler.java  | 37 ++++++++++++++--------
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/src/main/java/org/testng/xml/TestNGContentHandler.java b/src/main/java/org/testng/xml/TestNGContentHandler.java
index af2e338..cfa4654 100755
--- a/src/main/java/org/testng/xml/TestNGContentHandler.java
+++ b/src/main/java/org/testng/xml/TestNGContentHandler.java
@@ -18,11 +18,7 @@ import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Stack;
-import java.util.Properties;
-import java.util.HashMap;
-import java.util.Set;
 
 /**
  * Suite definition parser utility.
@@ -55,7 +51,8 @@ public class TestNGContentHandler extends DefaultHandler {
     SUITE,
     TEST,
     CLASS,
-    INCLUDE
+    INCLUDE,
+    EXCLUDE
   }
   private Stack<Location> m_locations = new Stack<Location>();
 
@@ -578,15 +575,7 @@ public class TestNGContentHandler extends DefaultHandler {
       xmlInclude(true, attributes);
     }
     else if ("exclude".equals(qName)) {
-      if (null != m_currentExcludedMethods) {
-        m_currentExcludedMethods.add(name);
-      }
-      else if (null != m_currentRuns) {
-        m_currentExcludedGroups.add(name);
-      }
-      else if (null != m_currentPackage) {
-        m_currentPackage.getExclude().add(name);
-      }
+      xmlExclude(true, attributes);
     }
     else if ("parameter".equals(qName)) {
       String value = expandValue(attributes.getValue("value"));
@@ -656,6 +645,24 @@ public class TestNGContentHandler extends DefaultHandler {
     }
   }
 
+  private void xmlExclude(boolean start, Attributes attributes) {
+    if (start) {
+      m_locations.push(Location.EXCLUDE);
+      String name = attributes.getValue("name");
+      if (null != m_currentExcludedMethods) {
+        m_currentExcludedMethods.add(name);
+      }
+      else if (null != m_currentRuns) {
+        m_currentExcludedGroups.add(name);
+      }
+      else if (null != m_currentPackage) {
+        m_currentPackage.getExclude().add(name);
+      }
+    } else {
+      popLocation(Location.EXCLUDE);
+    }
+  }
+
   private void pushLocation(Location l) {
     m_locations.push(l);
   }
@@ -724,6 +731,8 @@ public class TestNGContentHandler extends DefaultHandler {
     }
     else if ("include".equals(qName)) {
       xmlInclude(false, null);
+    } else if ("exclude".equals(qName)){
+      xmlExclude(false, null);
     }
   }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/testng.git



More information about the pkg-java-commits mailing list