jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1529606 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java
Date Sun, 06 Oct 2013 10:10:36 GMT
Author: pmouawad
Date: Sun Oct  6 10:10:35 2013
New Revision: 1529606

URL: http://svn.apache.org/r1529606
Log:
Bug 55632 - Have a new implementation of htmlParser for embedded resources parsing with better
performances
Fixed test failure
Bugzilla Id: 55632

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java?rev=1529606&r1=1529605&r2=1529606&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java
Sun Oct  6 10:10:35 2013
@@ -20,20 +20,26 @@ package org.apache.jmeter.protocol.http.
 
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Collections;
 import java.util.Iterator;
 
 import jodd.lagarto.EmptyTagVisitor;
+import jodd.lagarto.LagartoException;
 import jodd.lagarto.LagartoParser;
 import jodd.lagarto.Tag;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jmeter.protocol.http.util.ConversionUtils;
+import org.apache.jorphan.logging.LoggingManager;
+import org.apache.log.Logger;
 
 /**
  * Parser based on Lagarto
  * @since 2.10
  */
 public class LagartoBasedHtmlParser extends HTMLParser {
+    private static final Logger log = LoggingManager.getLoggerForClass();
+
     /*
      * A dummy class to pass the pointer of URL.
      */
@@ -145,6 +151,12 @@ public class LagartoBasedHtmlParser exte
             JMeterTagVisitor tagVisitor = new JMeterTagVisitor(new URLPointer(baseUrl), coll);
             lagartoParser.parse(tagVisitor);
             return coll.iterator();
+        } catch (LagartoException e) {
+            // TODO is it the best way ? https://issues.apache.org/bugzilla/show_bug.cgi?id=55634
+            if(log.isDebugEnabled()) {
+                log.debug("Error extracting embedded resource URLs from:'"+baseUrl+"', probably
not text content, message:"+e.getMessage());
+            }
+            return Collections.<URL>emptyList().iterator();
         } catch (Exception e) {
             throw new HTMLParseException(e);
         }



Mime
View raw message