You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Michael Morris <mi...@optimad.com> on 2002/10/14 15:19:58 UTC

HTTP URL Re-writing Modifier in the nonGUI

Hi all,

I have written a test using the nightly build from 9/10/02. I use the HTTP
URL Re-writing Modifier in the test twice here is my tree.

- Test Plan
 	- Thread Group	
 		- loop Controller
 			- login
 			- Http req 1 
			- Http req 2
 			- Simple controller
 				- Http req 3 
 				- Http req 4 
 				- Http req 
				- HTTP URL Re-writing Modifier 
 		- loop Controller
			- Http req 6
 			- Simple controller
 				- Http req 7
				- HTTP URL Re-writing Modifier 

This tests works fine when I run it in the GUI but when I try to run it from
the command line, I only get the following response:
	Http req 1
	Http req 2
	Http req 6

It seems that the all the request-siblings of the HTTP URL Re-writing
Modifier  are ignored.

Is there a simple fix for this.

Michael
 
 				 
			



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: HTTP URL Re-writing Modifier in the nonGUI [PATCH]

Posted by Mike Stover <ms...@apache.org>.
Yes, this is a bug, and you've got the right reason.  I suspect this kind of thing is 
happening elsewhere, making non-gui runs not work right.  

I've made a fix, but differently from the way you did it.  Instead, I just have the 
component do lazy initialization of the regex patterns when modifyEntry is called.

-Mike

On 14 Oct 2002 at 21:55, Michal Kostrzewa wrote:

> Hello
> 
> > This tests works fine when I run it in the GUI but when I try to run it
> > from the command line, I only get the following response:
> > 	Http req 1
> > 	Http req 2
> > 	Http req 6
> >
> > It seems that the all the request-siblings of the HTTP URL Re-writing
> > Modifier  are ignored.
> 
> I think you've found a bug! So I'm sending you the patch :)
> 
> The reason of this bug is, that method setArgumentName of class 
> org.apache.jmeter.protocol.http.modifier.URLRewritingModifier, which 
> initializes regular expressions, is called only from gui. 
> (URLRewritingModifierGUI). When loading test without gui, only setParameter 
> method is called and in result, case1, case2, case3 variables are 
> uninitialized (and you can see NullPointer errors in log).
> 
> To Michael Stover: Am I correct? I've implemented patch overriding setProperty 
> of URLRewritingModifier, and initializing casexxx variables when appropriate, 
> instead of doing this in setArgumentName. Is it "politically correct"? :)
> 
> To Michael Morris: It should work :) apply the patch to 
> src/protocol/http/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java 
> please do:
> 
> cd src/protocol/http/org/apache/jmeter/protocol/http/modifier/
> patch URLRewritingModifier.java < URLRewritingModifier.java.patch
> 
> and rebuild jmeter. Please note, i'm using the latest CVS version (but you 
> have fresh snapshot, I think you can try with that). Please tell me your 
> success (or failure) story.
> 
> To Michael Stover again :) It may be that my patch contains some formatting 
> caused by my IDE. Sorry about this....
> 
> hope that helps and best regards
> Michal Kostrzewa
> 
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: HTTP URL Re-writing Modifier in the nonGUI [PATCH]

Posted by Michal Kostrzewa <M....@pentacomp.com.pl>.
Hello

> This tests works fine when I run it in the GUI but when I try to run it
> from the command line, I only get the following response:
> 	Http req 1
> 	Http req 2
> 	Http req 6
>
> It seems that the all the request-siblings of the HTTP URL Re-writing
> Modifier  are ignored.

I think you've found a bug! So I'm sending you the patch :)

The reason of this bug is, that method setArgumentName of class 
org.apache.jmeter.protocol.http.modifier.URLRewritingModifier, which 
initializes regular expressions, is called only from gui. 
(URLRewritingModifierGUI). When loading test without gui, only setParameter 
method is called and in result, case1, case2, case3 variables are 
uninitialized (and you can see NullPointer errors in log).

To Michael Stover: Am I correct? I've implemented patch overriding setProperty 
of URLRewritingModifier, and initializing casexxx variables when appropriate, 
instead of doing this in setArgumentName. Is it "politically correct"? :)

To Michael Morris: It should work :) apply the patch to 
src/protocol/http/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java 
please do:

cd src/protocol/http/org/apache/jmeter/protocol/http/modifier/
patch URLRewritingModifier.java < URLRewritingModifier.java.patch

and rebuild jmeter. Please note, i'm using the latest CVS version (but you 
have fresh snapshot, I think you can try with that). Please tell me your 
success (or failure) story.

To Michael Stover again :) It may be that my patch contains some formatting 
caused by my IDE. Sorry about this....

hope that helps and best regards
Michal Kostrzewa