You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2004/10/07 19:44:40 UTC
cvs commit: jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier URLRewritingModifier.java
sebb 2004/10/07 10:44:40
Modified: src/core/org/apache/jmeter/resources messages.properties
xdocs/usermanual component_reference.xml
src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui
URLRewritingModifierGui.java
src/core/org/apache/jmeter/util JMeterVersion.java
src/protocol/http/org/apache/jmeter/protocol/http/modifier
URLRewritingModifier.java
Log:
Allow modification to stop at "?" - see
http://www.mail-archive.com/jmeter-dev@jakarta.apache.org/msg08241.html
Revision Changes Path
1.127 +2 -1 jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties
Index: messages.properties
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -r1.126 -r1.127
--- messages.properties 6 Oct 2004 14:43:55 -0000 1.126
+++ messages.properties 7 Oct 2004 17:44:39 -0000 1.127
@@ -329,6 +329,7 @@
path=Path\:
path_extension_choice=Path Extension (use ";" as separator)
path_extension_dont_use_equals=Do not use equals in path extension (Intershop Enfinity compatibility)
+path_extension_dont_use_questionmark=Do not use questionmark in path extension (Intershop Enfinity compatibility)
patterns_to_exclude=Patterns to Exclude
patterns_to_include=Patterns to Include
pkcs12_desc=PKCS 12 Key (*.p12)
@@ -604,4 +605,4 @@
retobj=Return object
deref=Dereference aliases
ldapext_testing_title= LDAPExt Request (ALPHA)
-ldap_argument_list=LDAPArgument List
\ No newline at end of file
+ldap_argument_list=LDAPArgument List
1.96 +2 -1 jakarta-jmeter/xdocs/usermanual/component_reference.xml
Index: component_reference.xml
===================================================================
RCS file: /home/cvs/jakarta-jmeter/xdocs/usermanual/component_reference.xml,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- component_reference.xml 6 Oct 2004 14:43:54 -0000 1.95
+++ component_reference.xml 7 Oct 2004 17:44:40 -0000 1.96
@@ -1822,6 +1822,7 @@
<property name="Path Extension" required="No">Some web apps rewrite URLs by appending
a semi-colon plus the session id parameter. Check this box if that is so.</property>
<property name="Do not use equals in path extension" required="No">Some web apps rewrite URLs without using an "=" sign between the parameter name and value (such as Intershop Enfinity).</property>
+ <property name="Do not use questionmark in path extension" required="No">Prevents the query string to end up in the path extension (such as Intershop Enfinity).</property>
</properties>
</component>
1.13 +12 -2 jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/URLRewritingModifierGui.java
Index: URLRewritingModifierGui.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/URLRewritingModifierGui.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- URLRewritingModifierGui.java 5 Mar 2004 01:38:17 -0000 1.12
+++ URLRewritingModifierGui.java 7 Oct 2004 17:44:40 -0000 1.13
@@ -37,6 +37,7 @@
JLabeledTextField argumentName;
JCheckBox pathExt;
JCheckBox pathExtNoEquals;
+ JCheckBox pathExtNoQuestionmark;
public String getLabelResource()
{
@@ -72,6 +73,11 @@
JMeterUtils.getResString("path_extension_dont_use_equals"));
mainPanel.add(pathExtNoEquals);
+ pathExtNoQuestionmark =
+ new JCheckBox(
+ JMeterUtils.getResString("path_extension_dont_use_questionmark"));
+ mainPanel.add(pathExtNoQuestionmark);
+
add(mainPanel, BorderLayout.CENTER);
}
@@ -98,6 +104,8 @@
pathExt.isSelected());
((URLRewritingModifier) modifier).setPathExtensionNoEquals(
pathExtNoEquals.isSelected());
+ ((URLRewritingModifier) modifier).setPathExtensionNoQuestionmark(
+ pathExtNoQuestionmark.isSelected());
}
public void configure(TestElement el)
@@ -106,6 +114,8 @@
pathExt.setSelected(((URLRewritingModifier) el).isPathExtension());
pathExtNoEquals.setSelected(
((URLRewritingModifier) el).isPathExtensionNoEquals());
+ pathExtNoQuestionmark.setSelected(
+ ((URLRewritingModifier) el).isPathExtensionNoQuestionmark());
super.configure(el);
}
1.28 +1 -1 jakarta-jmeter/src/core/org/apache/jmeter/util/JMeterVersion.java
Index: JMeterVersion.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/util/JMeterVersion.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- JMeterVersion.java 6 Oct 2004 14:43:52 -0000 1.27
+++ JMeterVersion.java 7 Oct 2004 17:44:40 -0000 1.28
@@ -39,7 +39,7 @@
* pattern: VERSION = <quote>.*<quote>
*
*/
- static final String VERSION = "2.1.20041006";
+ static final String VERSION = "2.1.20041007";
static final String COPYRIGHT = "Copyright (c) 1998-2004 The Apache Software Foundation";
1.32 +50 -9 jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java
Index: URLRewritingModifier.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- URLRewritingModifier.java 3 Jul 2004 02:32:49 -0000 1.31
+++ URLRewritingModifier.java 7 Oct 2004 17:44:40 -0000 1.32
@@ -49,12 +49,18 @@
implements Serializable, PreProcessor
{
- private Pattern pathExtensionEqualsRegexp, parameterRegexp, pathExtensionNoEqualsRegexp;
+ private Pattern pathExtensionEqualsQuestionmarkRegexp;
+ private Pattern pathExtensionEqualsNoQuestionmarkRegexp;
+ private Pattern parameterRegexp;
+ private Pattern pathExtensionNoEqualsQuestionmarkRegexp;
+ private Pattern pathExtensionNoEqualsNoQuestionmarkRegexp;
//transient Perl5Compiler compiler = new Perl5Compiler();
private final static String ARGUMENT_NAME = "argument_name";
private final static String PATH_EXTENSION = "path_extension";
private final static String PATH_EXTENSION_NO_EQUALS =
"path_extension_no_equals";
+ private final static String PATH_EXTENSION_NO_QUESTIONMARK =
+ "path_extension_no_questionmark";
public void process()
{
@@ -69,17 +75,33 @@
String text = new String(responseText.getResponseData());
Perl5Matcher matcher = JMeterUtils.getMatcher();
String value = "";
- if (isPathExtension() && isPathExtensionNoEquals())
+ if (isPathExtension() && isPathExtensionNoEquals() && isPathExtensionNoQuestionmark())
{
- if (matcher.contains(text, pathExtensionNoEqualsRegexp))
+ if (matcher.contains(text, pathExtensionNoEqualsNoQuestionmarkRegexp))
{
MatchResult result = matcher.getMatch();
value = result.group(1);
}
}
- else if (isPathExtension()) // && ! isPathExtensionNoEquals
+ else if (isPathExtension() && isPathExtensionNoEquals()) // && ! isPathExtensionNoQuestionmark
{
- if (matcher.contains(text, pathExtensionEqualsRegexp))
+ if (matcher.contains(text, pathExtensionNoEqualsQuestionmarkRegexp))
+ {
+ MatchResult result = matcher.getMatch();
+ value = result.group(1);
+ }
+ }
+ else if (isPathExtension() && isPathExtensionNoQuestionmark()) // && ! isPathExtensionNoEquals
+ {
+ if (matcher.contains(text, pathExtensionEqualsNoQuestionmarkRegexp))
+ {
+ MatchResult result = matcher.getMatch();
+ value = result.group(1);
+ }
+ }
+ else if (isPathExtension()) // && ! isPathExtensionNoEquals && ! isPathExtensionNoQuestionmark
+ {
+ if (matcher.contains(text, pathExtensionEqualsQuestionmarkRegexp))
{
MatchResult result = matcher.getMatch();
value = result.group(1);
@@ -128,16 +150,26 @@
}
private void initRegex(String argName)
{
- pathExtensionEqualsRegexp =
+ pathExtensionEqualsQuestionmarkRegexp =
JMeterUtils.getPatternCache().getPattern(
";"+argName + "=([^\"'>&\\s;]*)[&\\s\"'>;]?$?",
Perl5Compiler.MULTILINE_MASK | Perl5Compiler.READ_ONLY_MASK);
- pathExtensionNoEqualsRegexp =
+ pathExtensionEqualsNoQuestionmarkRegexp =
+ JMeterUtils.getPatternCache().getPattern(
+ ";"+argName + "=([^\"'>&\\s;?]*)[&\\s\"'>;?]?$?",
+ Perl5Compiler.MULTILINE_MASK | Perl5Compiler.READ_ONLY_MASK);
+
+ pathExtensionNoEqualsQuestionmarkRegexp =
JMeterUtils.getPatternCache().getPattern(
";"+argName + "([^\"'>&\\s;]*)[&\\s\"'>;]?$?",
Perl5Compiler.MULTILINE_MASK | Perl5Compiler.READ_ONLY_MASK);
+ pathExtensionNoEqualsNoQuestionmarkRegexp =
+ JMeterUtils.getPatternCache().getPattern(
+ ";"+argName + "([^\"'>&\\s;?]*)[&\\s\"'>;?]?$?",
+ Perl5Compiler.MULTILINE_MASK | Perl5Compiler.READ_ONLY_MASK);
+
parameterRegexp =
JMeterUtils.getPatternCache().getPattern(
"[;\\?&]"+argName + "=([^\"'>&\\s;]*)[&\\s\"'>;]?$?"
@@ -174,6 +206,11 @@
setProperty(
new BooleanProperty(PATH_EXTENSION_NO_EQUALS, pathExtNoEquals));
}
+ public void setPathExtensionNoQuestionmark(boolean pathExtNoQuestionmark)
+ {
+ setProperty(
+ new BooleanProperty(PATH_EXTENSION_NO_QUESTIONMARK, pathExtNoQuestionmark));
+ }
public boolean isPathExtension()
{
return getPropertyAsBoolean(PATH_EXTENSION);
@@ -181,6 +218,10 @@
public boolean isPathExtensionNoEquals()
{
return getPropertyAsBoolean(PATH_EXTENSION_NO_EQUALS);
+ }
+ public boolean isPathExtensionNoQuestionmark()
+ {
+ return getPropertyAsBoolean(PATH_EXTENSION_NO_QUESTIONMARK);
}
// TODO: add test cases for new jakarta commons http client
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org