I forgot to add.  The source codes below has log4j statements.  Again, pls let me know 
if log4j statements are ok, if not I'll remove them before posting next time.

Also the source codes below has jUnit tests in them.  If you have configured your 
org.apache.jmeter.junit.AllTests to work and you use the new ClassFinder (which I 
posted today or previously).  The tests will automatically be picked up and tested.  
All of them (for the source codes below) should pass.

Should any of the tests fail, you can choose to run the Test for the class itself by 
running java on the Test for the class.  Example, for UrlConfigFull.java, when you 
compile, you'll get both UrlConfigFull.class and UrlConfigFull$Test.class.  The latter 
is the Test for the former.  In Unix, run the UrlConfigFull$Test.class by -'java 
UrlConfigFull\$Test'.  NOTE : the \$ is to escape the $.  In Windows, u can try - 
'java "UrlConfigFull$Test"' (dunno whether it'll work).

Doing this will automatically execute the main of the Test class which configures 
log4j and you'll see log statements on your console.  Compare this log statements with 
the source code and you can actually see how the code works and why the test class 
fail.

I really recommend ppl to run the unit tests each time they recompile the sources (run 
the unit tests on those codes I've posted here to ensure that they work).  Also add 
new unit tests when they extend the classes or modify them.

If for any reason, you can't get AllTests to work for you let me know.

bye
-----Original Message-----
From: "neth6 atozasia.com" <[EMAIL PROTECTED]>
Date: Sat, 21 Jul 2001 23:35:11 +0800
To: [EMAIL PROTECTED]
Subject: Re: dynamicity, uploading, cache, images (awfully long!!!)


> Before I begin, pls feel free to email me or the list if you have any problems.  
>Will try my best to assist.
> 
> Ok, I'm gonna post the extension to HTTPSampler and UrlConfig here.  They are 
>intended to download and sample a web page with all images & applets.  The tags which 
>I look for are <img...>, <input type="image"...> and <!-- applets -->.  They are 
>called HTTPSamplerFull and UrlConfigFull.  Sorry but I can't think of what else to 
>call them.
> 
> To speed up my development, I used jTidy as a HTML parser.  I wasn't aware of 
>jMeter's own html parser and moreover jMeter's html parser was in early stages of 
>development when I started on this.  I will change it to use jMeter's html parser 
>when it's ready.
> 
> If you feel it's worthwhile to proceed, pls download jTidy from " <A 
>HREF="http://lempinen.net/sami/jtidy/"."; TARGET="_new"><FONT 
>COLOR="BLUE">http://lempinen.net/sami/jtidy/";.</FONT></A>
> 
> The steps below will help you to get a ConfigElement called "UrlSample Full" on your 
>jmeter gui.  Configure 'UrlSample Full' as you would for 'Url Sample'.
> 
> If the steps below are not displayed in proper format by your mail client/browser, 
>I've attached a document "changes.txt" below which u can detach to read instead.
> 
> The required files are also attached below
> 
> --- Start ---
> 
> IMPORTANT : All things within square brackets "<...>" are suppose to be substituted 
>with appropriate values in your environment
> IMPORTANT : You need jTidy - an open source Html Parser for this to work. I used 
>jTidy to speed up my work but the ultimately jmeter might have its own parser.  
>Please download jTidy from  sourceforge
> WARNING : For some reason or another ClassFinder.class can't seem to
> understand that for user (e.g. goro) the directory /home/goro/jmeter/
> is the same as ~/jmeter/.  Please set CLASSPATH using the full extension and not 
>using ~ for the time being.
> Another grouse about ClassFinder.class is that it seems to think that 
>/home/goro/jmeter/ and /home/goro/jmeter (without the ending slash)
> is different.  I've modified to ClassFinder.java to rectify this error but I'm not 
>sure if the one u have is up to date.  To be safe,
> use directories without the ending slash.  BE VERY CAREFUL though when using 
>auto-completeion with bash shell (hitting 'tab' key) 'cos that          automatically 
>appends a ending slash
> 
> 0. edit 
>    <jakarta-jmeter>/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
>    a. change 'private String readResponse(HttpUrlConnection conn) ...'
>       to 'protected ...'
>       i.e. change readResponse method from private to protected 'cos
>       the extension HTTPSamplerFull.java also need to use this method
> 0.5 copy the new HttpTestSample.java to
>    <jakarta-jmeter>/src/org/apache/jmeter/protocol/http/control/
> 1. build jmeter using ant
> 2. chmod a+x <jakarta-jmeter>/bin/jmeter
> 3. edit <jakarta-jmeter>/bin/jmeter.properties
>    a. change the search_paths to
>       search_paths=.;<jakarta-jmeter>/bin/classes;<jakarta-jmeter>/ext
> IMPORTANT : The rational behind using <jakarta-jmeter>/bin/classes instead
>             of ApacheJMeter.jar is to enable me to make changes to classes
>             and then just copy them to the appropriate directories in
>             <jakarta-jmeter>/bin/classes without having to recompile and
>             then jar them everytime into ApacheJMeter.
> IMPORTANT : Don't put ending slash for directories (see WARNING above).
> 4. set your classpath to include (see WARNING above). Also note that the 
>    original CLASSPATH is set at the end (just in case)
>    <jakarta-jmeter>/bin/classes:<jakarta-jmeter>/ext:$CLASSPATH
>    AND
>    <jtidy>/Tidy.jar
> 5. also make the following directory trees
>    <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/sampler/
>    <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/config/
> NOTE : It was suggested I write the HTTP Sampler which automatically download
>        images and applets as an extension which can be dumped in 
>        <jakarta-jmeter>/ext/.  Thus, forgive the eponymous package name.  This 
>        effort will also help determine how to incorporate future extensions 
>        easily by just writing sampler, config element classes without having to
>        tinker with the rest of jmeter codes like what I had to go through. Also
>        if the codes gets incorporated into jmeter then I'll change the package
>        name.
> 6. copy UrlConfigFull.java to 
>    <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/config/
> 7. copy HTTPSamplerFull.java to
>    <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/sampler/
> 8. compile both of them using
>    javac <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/config/UrlConfigFull.java
>    javac 
><jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/config/HTTPSamplerFull.java
> 
> --- End ---
> 
> -----Original Message-----
> From: Mike Stover <[EMAIL PROTECTED]>
> Date: Thu, 19 Jul 2001 08:25:00 +0000
> To: "Raphael PIERONI" <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED]
> Subject: Re: dynamicity, uploading, cache, images
> 
> 
> > 
> > > but as i need the total weigth of the page including images, i cannot let
> > > another object than the sampler do the task of downloading images, or at
> > > least have the weigth in return
> > 
> > Oh, good point.  There is someone out there who has finished creating an 
> > HTTPSampler version that parses the results and grabs all images in the page. 
> >  Maybe, if you could get a copy of that, you could add your caching in to 
> > that sampler (or sub-class it).  
> > 
> > >
> > > thanks Raphael
> > >
> > > > -Mike
> > 
> > -- 
> > Mike Stover
> > [EMAIL PROTECTED]
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> -- 
> 
> __________________________________________________
> Get FREE 50 MB email @  <A HREF="http://www.AtoZasia.com"; TARGET="_new"><FONT 
>COLOR="BLUE">http://www.AtoZasia.com</FONT></A>
> 
> 
> 
> Powered by Outblaze
> 

-- 

__________________________________________________
Get FREE 50 MB email @ http://www.AtoZasia.com



Powered by Outblaze

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to