Author: pmouawad
Date: Sun Mar 27 17:01:00 2016
New Revision: 1736773
URL: http://svn.apache.org/viewvc?rev=1736773&view=rev
Log:
Bug 59140 - Parallel Download : Add CSS Parsing to extract links from CSS files
Bugzilla Id: 59140
Added:
jmeter/trunk/licenses/bin/ph-commons-6.2.4.txt (with props)
jmeter/trunk/licenses/bin/ph-css-4.1.0.txt (with props)
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/CssParser.java
(with props)
Modified:
jmeter/trunk/bin/jmeter.properties
jmeter/trunk/build.properties
jmeter/trunk/build.xml
jmeter/trunk/eclipse.classpath
jmeter/trunk/lib/ (props changed)
jmeter/trunk/lib/aareadme.txt
jmeter/trunk/res/maven/ApacheJMeter_parent.pom
jmeter/trunk/xdocs/changes.xml
Modified: jmeter/trunk/bin/jmeter.properties
URL:
http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1736773&r1=1736772&r2=1736773&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Sun Mar 27 17:01:00 2016
@@ -703,9 +703,12 @@ upgrade_properties=/bin/upgrade.properti
#---------------------------------------------------------------------------
# Space-separated list of parser groups
-HTTPResponse.parsers=htmlParser wmlParser
+HTTPResponse.parsers=htmlParser wmlParser cssParser
# for each parser, there should be a parser.types and a parser.className
property
+# CSS Parser based on ph-css
+cssParser.className=org.apache.jmeter.protocol.http.parser.CssParser
+cssParser.types=text/css
#---------------------------------------------------------------------------
# HTML Parser configuration
#---------------------------------------------------------------------------
Modified: jmeter/trunk/build.properties
URL:
http://svn.apache.org/viewvc/jmeter/trunk/build.properties?rev=1736773&r1=1736772&r2=1736773&view=diff
==============================================================================
--- jmeter/trunk/build.properties (original)
+++ jmeter/trunk/build.properties Sun Mar 27 17:01:00 2016
@@ -264,6 +264,16 @@ mongo-java-driver.jar = mongo-java
mongo-java-driver.loc =
${maven2.repo}/org/mongodb/mongo-java-driver/${mongo-java-driver.version}
mongo-java-driver.md5 = 90647a53231eb75715fda30759ff4ff7
+ph-css.version = 4.1.0
+ph-css.jar = ph-css-${ph-css.version}.jar
+ph-css.loc =
${maven2.repo}/com/helger/ph-css/${ph-css.version}
+ph-css.md5 = c8913e7877b389c08e85269587217914
+
+ph-commons.version = 6.2.4
+ph-commons.jar = ph-commons-${ph-commons.version}.jar
+ph-commons.loc =
${maven2.repo}/com/helger/ph-commons/${ph-commons.version}
+ph-commons.md5 = 344fc45ad36dd7f8ddc98141afad0cfe
+
rsyntaxtextarea.version = 2.5.8
rsyntaxtextarea.jar = rsyntaxtextarea-${rsyntaxtextarea.version}.jar
rsyntaxtextarea.loc =
${maven2.repo}/com/fifesoft/rsyntaxtextarea/${rsyntaxtextarea.version}
Modified: jmeter/trunk/build.xml
URL:
http://svn.apache.org/viewvc/jmeter/trunk/build.xml?rev=1736773&r1=1736772&r2=1736773&view=diff
==============================================================================
--- jmeter/trunk/build.xml (original)
+++ jmeter/trunk/build.xml Sun Mar 27 17:01:00 2016
@@ -401,6 +401,8 @@
<include name="${lib.dir}/${junit.jar}"/>
<include name="${lib.dir}/${logkit.jar}"/>
<include name="${lib.dir}/${mongo-java-driver.jar}"/>
+ <include name="${lib.dir}/${ph-css.jar}"/>
+ <include name="${lib.dir}/${ph-commons.jar}"/>
<include name="${lib.dir}/${rsyntaxtextarea.jar}"/>
<include name="${lib.dir}/${serializer.jar}"/>
<include name="${lib.dir}/${slf4j-api.jar}"/>
@@ -474,6 +476,8 @@
<pathelement location="${lib.dir}/${junit.jar}"/>
<pathelement location="${lib.dir}/${logkit.jar}"/>
<pathelement location="${lib.dir}/${mongo-java-driver.jar}"/>
+ <pathelement location="${lib.dir}/${ph-css.jar}"/>
+ <pathelement location="${lib.dir}/${ph-commons.jar}"/>
<pathelement location="${lib.dir}/${rsyntaxtextarea.jar}"/>
<pathelement location="${lib.dir}/${serializer.jar}"/>
<pathelement location="${lib.dir}/${slf4j-api.jar}"/>
@@ -2894,6 +2898,8 @@ run JMeter unless all the JMeter jars ar
<process_jarfile jarname="junit"/>
<process_jarfile jarname="logkit"/>
<process_jarfile jarname="mongo-java-driver"/>
+ <process_jarfile jarname="ph-css" />
+ <process_jarfile jarname="ph-commons" />
<process_jarfile jarname="rsyntaxtextarea"/>
<process_jarfile jarname="serializer"/>
<process_jarfile jarname="slf4j-api"/>
Modified: jmeter/trunk/eclipse.classpath
URL:
http://svn.apache.org/viewvc/jmeter/trunk/eclipse.classpath?rev=1736773&r1=1736772&r2=1736773&view=diff
==============================================================================
--- jmeter/trunk/eclipse.classpath (original)
+++ jmeter/trunk/eclipse.classpath Sun Mar 27 17:01:00 2016
@@ -83,6 +83,8 @@
<classpathentry kind="lib" path="lib/logkit-2.0.jar"/>
<classpathentry kind="lib" path="lib/mail-1.5.0-b01.jar"/>
<classpathentry kind="lib" path="lib/mongo-java-driver-2.11.3.jar"/>
+ <classpathentry kind="lib" path="lib/ph-css-4.1.0.jar"/>
+ <classpathentry kind="lib" path="lib/ph-commons-6.2.4.jar"/>
<classpathentry kind="lib" path="lib/oro-2.0.8.jar"/>
<classpathentry kind="lib" path="lib/rhino-1.7.7.1.jar"/>
<classpathentry kind="lib" path="lib/rsyntaxtextarea-2.5.8.jar"/>
Propchange: jmeter/trunk/lib/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Mar 27 17:01:00 2016
@@ -43,6 +43,8 @@ junit-4.12.jar
logkit-2.0.jar
mail-1.5.0-b01.jar
mongo-java-driver-2.11.3.jar
+ph-css-4.1.0.jar
+ph-commons-6.2.4.jar
rsyntaxtextarea-2.5.8.jar
oro-2.0.8.jar
rhino-1.7.7.1.jar
Modified: jmeter/trunk/lib/aareadme.txt
URL:
http://svn.apache.org/viewvc/jmeter/trunk/lib/aareadme.txt?rev=1736773&r1=1736772&r2=1736773&view=diff
==============================================================================
--- jmeter/trunk/lib/aareadme.txt (original)
+++ jmeter/trunk/lib/aareadme.txt Sun Mar 27 17:01:00 2016
@@ -163,6 +163,16 @@ jsoup-1.8.3
http://www.jsoup.org/
- CSS/JQuery like extractor
+ph-css-4.1.0
+--------
+https://github.com/phax/ph-css
+- CssParser
+
+ph-commons-6.2.4
+--------
+https://github.com/phax/ph-commons
+- CssParser
+
rhino-1.7.7.1
--------
http://www.mozilla.org/rhino/download.html
Added: jmeter/trunk/licenses/bin/ph-commons-6.2.4.txt
URL:
http://svn.apache.org/viewvc/jmeter/trunk/licenses/bin/ph-commons-6.2.4.txt?rev=1736773&view=auto
==============================================================================
--- jmeter/trunk/licenses/bin/ph-commons-6.2.4.txt (added)
+++ jmeter/trunk/licenses/bin/ph-commons-6.2.4.txt Sun Mar 27 17:01:00 2016
@@ -0,0 +1,176 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
Propchange: jmeter/trunk/licenses/bin/ph-commons-6.2.4.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jmeter/trunk/licenses/bin/ph-css-4.1.0.txt
URL:
http://svn.apache.org/viewvc/jmeter/trunk/licenses/bin/ph-css-4.1.0.txt?rev=1736773&view=auto
==============================================================================
--- jmeter/trunk/licenses/bin/ph-css-4.1.0.txt (added)
+++ jmeter/trunk/licenses/bin/ph-css-4.1.0.txt Sun Mar 27 17:01:00 2016
@@ -0,0 +1,176 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
Propchange: jmeter/trunk/licenses/bin/ph-css-4.1.0.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: jmeter/trunk/res/maven/ApacheJMeter_parent.pom
URL:
http://svn.apache.org/viewvc/jmeter/trunk/res/maven/ApacheJMeter_parent.pom?rev=1736773&r1=1736772&r2=1736773&view=diff
==============================================================================
--- jmeter/trunk/res/maven/ApacheJMeter_parent.pom (original)
+++ jmeter/trunk/res/maven/ApacheJMeter_parent.pom Sun Mar 27 17:01:00 2016
@@ -93,6 +93,8 @@ under the License.
<junit.version>4.12</junit.version>
<logkit.version>2.0</logkit.version>
<mongo-java-driver.version>2.11.3</mongo-java-driver.version>
+ <ph-css.version>4.1.0</ph-css.version>
+ <ph-commons.version>6.2.4</ph-commons.version>
<rsyntaxtextarea.version>2.5.8</rsyntaxtextarea.version>
<slf4j-api.version>1.7.13</slf4j-api.version>
<jtidy.version>r938</jtidy.version>
@@ -365,6 +367,16 @@ under the License.
<version>${mongo-java-driver.version}</version>
</dependency>
<dependency>
+ <groupId>com.helger</groupId>
+ <artifactId>ph-css</artifactId>
+ <version>${ph-css.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.helger</groupId>
+ <artifactId>ph-commons</artifactId>
+ <version>${ph-commons.version}</version>
+ </dependency>
+ <dependency>
<groupId>com.fifesoft</groupId>
<artifactId>rsyntaxtextarea</artifactId>
<version>${rsyntaxtextarea.version}</version>
Added:
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/CssParser.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/CssParser.java?rev=1736773&view=auto
==============================================================================
---
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/CssParser.java
(added)
+++
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/CssParser.java
Sun Mar 27 17:01:00 2016
@@ -0,0 +1,137 @@
+/*
+ * 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.URL;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jorphan.logging.LoggingManager;
+import org.apache.log.Logger;
+
+import com.helger.css.ECSSVersion;
+import com.helger.css.decl.CSSDeclaration;
+import com.helger.css.decl.CSSExpressionMemberTermURI;
+import com.helger.css.decl.CSSImportRule;
+import com.helger.css.decl.CascadingStyleSheet;
+import com.helger.css.decl.ICSSTopLevelRule;
+import com.helger.css.decl.visit.CSSVisitor;
+import com.helger.css.decl.visit.DefaultCSSUrlVisitor;
+import com.helger.css.handler.LoggingCSSParseExceptionCallback;
+import com.helger.css.parser.ParseException;
+import com.helger.css.reader.CSSReader;
+import com.helger.css.reader.errorhandler.LoggingCSSParseErrorHandler;
+
+/**
+ * CSS Parser used to extract from CSS files external urls
+ * @since 3.0
+ */
+public class CssParser implements LinkExtractorParser {
+ private static final boolean IGNORE_UNRECOVERABLE_PARSING_ERROR =
JMeterUtils.getPropDefault("httpsampler.ignore_failed_embedded_resource",
false); //$NON-NLS-1$
+ private static final Logger LOG = LoggingManager.getLoggerForClass();
+
+ /**
+ *
+ */
+ public CssParser() {
+ }
+
+ /**
+ *
+ * @see
+ *
org.apache.jmeter.protocol.http.parser.LinkExtractorParser#getEmbeddedResourceURLs
+ * (java.lang.String, byte[], java.net.URL,
+ * org.apache.jmeter.protocol.http.parser.URLCollection, java.lang.String)
+ */
+ @Override
+ public Iterator<URL> getEmbeddedResourceURLs(String userAgent, byte[] data,
+ final URL baseUrl, String encoding) throws
LinkExtractorParseException {
+ try {
+ String cssContent = new String(data, encoding);
+ final CascadingStyleSheet aCSS = CSSReader.readFromString(
+ cssContent,
+ Charset.forName(encoding),
+ ECSSVersion.CSS30,
+ new LoggingCSSParseErrorHandler(),
+ new LoggingCSSParseExceptionCallback(){
+
+ /**
+ *
+ */
+ private static final long serialVersionUID =
-9111232037888068394L;
+
+ /**
+ * @see
com.helger.css.handler.LoggingCSSParseExceptionCallback#onException(com.helger.css.parser.ParseException)
+ */
+ @Override
+ public void onException(ParseException ex) {
+ if(IGNORE_UNRECOVERABLE_PARSING_ERROR) {
+ LOG.warn("Failed to parse CSS: " + baseUrl +
", " + LoggingCSSParseErrorHandler.createLoggingStringParseError (ex));
+ } else {
+ throw new IllegalStateException("Failed to
parse CSS: " + baseUrl + ", " +
LoggingCSSParseErrorHandler.createLoggingStringParseError (ex));
+ }
+ }
+
+ }
+ );
+ final List<URLString> list = new ArrayList<URLString>();
+ final URLCollection urlCollection = new URLCollection(list);
+ if(aCSS != null) {
+ CSSVisitor.visitCSSUrl(aCSS, new DefaultCSSUrlVisitor() {
+ @Override
+ public void onImport(final CSSImportRule importRule) {
+ urlCollection.addURL(importRule.getLocationString(),
+ baseUrl);
+ }
+ // Call for URLs outside of URLs
+ @Override
+ public void onUrlDeclaration(
+ final ICSSTopLevelRule aTopLevelRule,
+ final CSSDeclaration aDeclaration,
+ final CSSExpressionMemberTermURI aURITerm) {
+ urlCollection.addURL(aURITerm.getURIString(),
+ baseUrl);
+ }
+ });
+ } else {
+ LOG.warn("Failed parsing url:"+baseUrl+", got null
CascadingStyleSheet");
+ }
+ if(LOG.isDebugEnabled()) {
+ StringBuilder builder = new StringBuilder();
+ for (Iterator iterator = urlCollection.iterator();
iterator.hasNext();) {
+ URL urlString = (URL) iterator.next();
+ builder.append(urlString).append(",");
+ }
+ LOG.debug("Parsed:"+baseUrl+", got:"+builder.toString());
+ }
+ return urlCollection.iterator();
+ } catch (Exception e) {
+ throw new LinkExtractorParseException(e);
+ }
+ }
+
+ @Override
+ public boolean isReusable() {
+ return true;
+ }
+
+}
Propchange:
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/CssParser.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: jmeter/trunk/xdocs/changes.xml
URL:
http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1736773&r1=1736772&r2=1736773&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Mar 27 17:01:00 2016
@@ -81,6 +81,7 @@ Summary
<ch_title>Parallel Downloads is now realistic and scales much
better:</ch_title>
<p>
<ul>
+<li>Parsing of CSS imported (CSS) or embedded resources (images)</li>
<li>Lazy initialization of SSL context : For 15 Threads 138% more sampling in
5 minutes. Gain increases as number of threads increases</li>
<li>Rework of Connections management for Parallel Download : for 15 Threads
135% more sampling in 5 minutes.</li>
<li>Reuse of ThreadPool</li>
@@ -234,6 +235,7 @@ Deprecated Libraries dropped or replaced
<li><bug>59033</bug>Parallel Download : Rework Parser classes hierarchy to
allow pluging parsers for different mime types</li>
<li><bug>52073</bug>Embedded Resources Parallel download : Improve
performances by avoiding shutdown of ThreadPoolExecutor at each sample.
Contributed by Benoit Wiart (benoit dot wiart at gmail.com)</li>
<li><bug>59190</bug>HTTP(S) Test Script Recorder : Suggested excludes
should ignore case. Contributed by Antonio Gomes Rodrigues (ra0077 at
gmail.com)</li>
+ <li><bug>59140</bug>Parallel Download : Add CSS Parsing to extract links
from CSS files</li>
</ul>
<h3>Other samplers</h3>