Description: Disable the JoddExtractor since jodd isn't in Debian yet
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/src/components/org/apache/jmeter/extractor/JoddExtractor.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.jmeter.extractor;
-
-import java.util.List;
-
-import jodd.lagarto.dom.LagartoDOMBuilder;
-import jodd.lagarto.dom.Node;
-import jodd.lagarto.dom.NodeSelector;
-
-import org.apache.jmeter.threads.JMeterContextService;
-import org.apache.jorphan.util.JOrphanUtils;
-
-/**
- * Jodd-Lagerto based CSS/JQuery extractor
- * see http://jodd.org/doc/csselly/
- * @since 2.9
- */
-public class JoddExtractor implements Extractor {
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = -7235814605293262972L;
-
-    private static final String CACHE_KEY_PREFIX = JoddExtractor.class.getName()+"_PARSED_BODY";
-
-    /**
-     * 
-     */
-    public JoddExtractor() {
-        super();
-    }
-
-    /**
-     * @see org.apache.jmeter.extractor.Extractor#extract(String, String, int, String, List, int, String)
-     */
-    @Override
-    public int extract(String expression, String attribute, int matchNumber,
-            String inputString, List<String> result, int found,
-            String cacheKey) {
-        NodeSelector nodeSelector = null;
-        if (cacheKey != null) {
-            nodeSelector = (NodeSelector) 
-                    JMeterContextService.getContext().getSamplerContext().get(CACHE_KEY_PREFIX+cacheKey);
-            if(nodeSelector==null) {
-                LagartoDOMBuilder domBuilder = new LagartoDOMBuilder();
-                jodd.lagarto.dom.Document doc = domBuilder.parse(inputString);
-                nodeSelector = new NodeSelector(doc);
-                JMeterContextService.getContext().getSamplerContext().put(CACHE_KEY_PREFIX+cacheKey, nodeSelector);
-            }
-        } else {
-            LagartoDOMBuilder domBuilder = new LagartoDOMBuilder();
-            jodd.lagarto.dom.Document doc = domBuilder.parse(inputString);
-            nodeSelector = new NodeSelector(doc);
-        }
-        List<Node> elements = nodeSelector.select(expression);
-        int size = elements.size();
-        for (int i = 0; i < size; i++) {
-            Node element = elements.get(i);
-            if (matchNumber <=0 || found != matchNumber) {
-                result.add(extractValue(attribute, element));
-                found++;
-            } else {
-                break;
-            }
-        }
-        
-        return found;
-    }
-    
-    
-    private String extractValue(String attribute, Node element) {
-        if (!JOrphanUtils.isBlank(attribute)) {
-            return element.getAttribute(attribute);
-        } else {
-            return element.getTextContent().trim();
-        }
-    }
-}
--- a/src/components/org/apache/jmeter/extractor/HtmlExtractor.java
+++ b/src/components/org/apache/jmeter/extractor/HtmlExtractor.java
@@ -44,7 +44,7 @@
     public static final String EXTRACTOR_JODD = "JODD"; //$NON-NLS-1$
 
     public static String[] getImplementations(){
-        return new String[]{EXTRACTOR_JSOUP,EXTRACTOR_JODD};
+        return new String[]{EXTRACTOR_JSOUP};
     }
 
     public static final String DEFAULT_EXTRACTOR = ""; // $NON-NLS-1$
@@ -213,8 +213,8 @@
         boolean useDefaultExtractor = DEFAULT_EXTRACTOR.equals(impl);
         if (useDefaultExtractor || EXTRACTOR_JSOUP.equals(impl)) {
             return new JSoupExtractor();
-        } else if (EXTRACTOR_JODD.equals(impl)) {
-            return new JoddExtractor();
+        //} else if (EXTRACTOR_JODD.equals(impl)) {
+        //    return new JoddExtractor();
         } else {
             throw new IllegalArgumentException("Extractor implementation:"+ impl+" is unknown");
         }
--- a/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java
+++ b/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java
@@ -1,172 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.jmeter.protocol.http.parser;
-
-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.
-     */
-    private static class URLPointer {
-        private URLPointer(URL newUrl) {
-            url = newUrl;
-        }
-        private URL url;
-    }
-    
-    private static final class JMeterTagVisitor extends EmptyTagVisitor {
-
-        private URLCollection urls;
-        private URLPointer baseUrl;
-
-        /**
-         * @param baseUrl 
-         * @param urls 
-         */
-        public JMeterTagVisitor(final URLPointer baseUrl, URLCollection urls) {
-            this.urls = urls;
-            this.baseUrl = baseUrl;
-        }
-
-        private final void extractAttribute(Tag tag, String attributeName) {
-            String url = tag.getAttributeValue(attributeName, false);
-            if (!StringUtils.isEmpty(url)) {
-                urls.addURL(url, baseUrl.url);
-            }
-        }
-        /*
-         * (non-Javadoc)
-         * 
-         * @see jodd.lagarto.EmptyTagVisitor#script(jodd.lagarto.Tag,
-         * java.lang.CharSequence)
-         */
-        @Override
-        public void script(Tag tag, CharSequence body) {
-            extractAttribute(tag, ATT_SRC);
-        }
-
-        /*
-         * (non-Javadoc)
-         * 
-         * @see jodd.lagarto.EmptyTagVisitor#tag(jodd.lagarto.Tag)
-         */
-        @Override
-        public void tag(Tag tag) {
-
-            String tagName = tag.getName().toLowerCase();
-            if (tagName.equals(TAG_BODY)) {
-                extractAttribute(tag, ATT_BACKGROUND);
-            } else if (tagName.equals(TAG_BASE)) {
-                String baseref = tag.getAttributeValue(ATT_HREF, false);
-                try {
-                    if (!StringUtils.isEmpty(baseref))// Bugzilla 30713
-                    {
-                        baseUrl.url = ConversionUtils.makeRelativeURL(baseUrl.url, baseref);
-                    }
-                } catch (MalformedURLException e1) {
-                    throw new RuntimeException(e1);
-                }
-            } else if (tagName.equals(TAG_IMAGE)) {
-                extractAttribute(tag, ATT_SRC);
-            } else if (tagName.equals(TAG_APPLET)) {
-                extractAttribute(tag, ATT_CODE);
-            } else if (tagName.equals(TAG_OBJECT)) {
-                extractAttribute(tag, ATT_CODEBASE);                
-                extractAttribute(tag, ATT_DATA);                 
-            } else if (tagName.equals(TAG_INPUT)) {
-                // we check the input tag type for image
-                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.getAttributeValue(ATT_TYPE, false))) {
-                    // then we need to download the binary
-                    extractAttribute(tag, ATT_SRC);
-                }
-            } else if (tagName.equals(TAG_SCRIPT)) {
-                extractAttribute(tag, ATT_SRC);
-                // Bug 51750
-            } else if (tagName.equals(TAG_FRAME) || tagName.equals(TAG_IFRAME)) {
-                extractAttribute(tag, ATT_SRC);
-            } else if (tagName.equals(TAG_EMBED)) {
-                extractAttribute(tag, ATT_SRC);
-            } else if (tagName.equals(TAG_BGSOUND)){
-                extractAttribute(tag, ATT_SRC);
-            } else if (tagName.equals(TAG_LINK)) {
-                // Putting the string first means it works even if the attribute is null
-                if (STYLESHEET.equalsIgnoreCase(tag.getAttributeValue(ATT_REL, false))) {
-                    extractAttribute(tag, ATT_HREF);
-                }
-            } else {
-                extractAttribute(tag, ATT_BACKGROUND);
-            }
-
-
-            // Now look for URLs in the STYLE attribute
-            String styleTagStr = tag.getAttributeValue(ATT_STYLE, false);
-            if(styleTagStr != null) {
-                HtmlParsingUtils.extractStyleURLs(baseUrl.url, urls, styleTagStr);
-            }
-        }
-    }
-
-    @Override
-    public Iterator<URL> getEmbeddedResourceURLs(byte[] html, URL baseUrl,
-            URLCollection coll, String encoding) throws HTMLParseException {
-        try {
-            String contents = new String(html,encoding); 
-            LagartoParser lagartoParser = new LagartoParser(contents);
-            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);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jmeter.protocol.http.parser.HTMLParser#isReusable()
-     */
-    @Override
-    protected boolean isReusable() {
-        return true;
-    }
-}
