jsalvata    2004/02/05 16:05:54

  Modified:    bin/testfiles HTMLParserTestCase.all HTMLParserTestCase.set
               src/protocol/http/org/apache/jmeter/protocol/http/parser
                        HTMLParser.java
  Log:
  Added a comment on a potential performance problem...
  ... and trimmed 10 seconds off test execution time.
  
  Revision  Changes    Path
  1.3       +14 -14    jakarta-jmeter/bin/testfiles/HTMLParserTestCase.all
  
  Index: HTMLParserTestCase.all
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/bin/testfiles/HTMLParserTestCase.all,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HTMLParserTestCase.all    14 Jan 2004 22:05:49 -0000      1.2
  +++ HTMLParserTestCase.all    6 Feb 2004 00:05:54 -0000       1.3
  @@ -1,14 +1,14 @@
  -http://myhost/mydir/images/image-a.gif
  -http://myhost/mydir/images/image-b.gif
  -http://myhost/mydir/images/image-b.gif
  -http://myhost/mydir/images/image-c.gif
  -http://myhost/mydir/images/image-d.gif
  -http://myhost/mydir/images/image-e.gif
  -http://myhost/mydir/images/image-f.gif
  -http://myhost/mydir/images/image-a2.gif
  -http://myhost/mydir/images/image-b2.gif
  -http://myhost/mydir/images/image-c2.gif
  -http://myhost/mydir/images/image-d2.gif
  -http://myhost/mydir/images/image-d2.gif
  -http://myhost/mydir/images/image-e2.gif
  -http://myhost/mydir/images/image-f2.gif
  +http://localhost/mydir/images/image-a.gif
  +http://localhost/mydir/images/image-b.gif
  +http://localhost/mydir/images/image-b.gif
  +http://localhost/mydir/images/image-c.gif
  +http://localhost/mydir/images/image-d.gif
  +http://localhost/mydir/images/image-e.gif
  +http://localhost/mydir/images/image-f.gif
  +http://localhost/mydir/images/image-a2.gif
  +http://localhost/mydir/images/image-b2.gif
  +http://localhost/mydir/images/image-c2.gif
  +http://localhost/mydir/images/image-d2.gif
  +http://localhost/mydir/images/image-d2.gif
  +http://localhost/mydir/images/image-e2.gif
  +http://localhost/mydir/images/image-f2.gif
  
  
  
  1.3       +12 -12    jakarta-jmeter/bin/testfiles/HTMLParserTestCase.set
  
  Index: HTMLParserTestCase.set
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/bin/testfiles/HTMLParserTestCase.set,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HTMLParserTestCase.set    14 Jan 2004 22:05:49 -0000      1.2
  +++ HTMLParserTestCase.set    6 Feb 2004 00:05:54 -0000       1.3
  @@ -1,12 +1,12 @@
  -http://myhost/mydir/images/image-a.gif
  -http://myhost/mydir/images/image-b.gif
  -http://myhost/mydir/images/image-c.gif
  -http://myhost/mydir/images/image-d.gif
  -http://myhost/mydir/images/image-e.gif
  -http://myhost/mydir/images/image-f.gif
  -http://myhost/mydir/images/image-a2.gif
  -http://myhost/mydir/images/image-b2.gif
  -http://myhost/mydir/images/image-c2.gif
  -http://myhost/mydir/images/image-d2.gif
  -http://myhost/mydir/images/image-e2.gif
  -http://myhost/mydir/images/image-f2.gif
  +http://localhost/mydir/images/image-a.gif
  +http://localhost/mydir/images/image-b.gif
  +http://localhost/mydir/images/image-c.gif
  +http://localhost/mydir/images/image-d.gif
  +http://localhost/mydir/images/image-e.gif
  +http://localhost/mydir/images/image-f.gif
  +http://localhost/mydir/images/image-a2.gif
  +http://localhost/mydir/images/image-b2.gif
  +http://localhost/mydir/images/image-c2.gif
  +http://localhost/mydir/images/image-d2.gif
  +http://localhost/mydir/images/image-e2.gif
  +http://localhost/mydir/images/image-f2.gif
  
  
  
  1.17      +14 -4     
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/HTMLParser.java
  
  Index: HTMLParser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/HTMLParser.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- HTMLParser.java   8 Jan 2004 13:54:16 -0000       1.16
  +++ HTMLParser.java   6 Feb 2004 00:05:54 -0000       1.17
  @@ -182,6 +182,16 @@
                        }
                
                        return getEmbeddedResourceURLs(html, baseUrl,col);
  +            
  +            // An additional note on using HashSets to store URLs: I just
  +            // discovered that obtaining the hashCode of a java.net.URL implies
  +            // a domain-name resolution process. This means significant delays
  +            // can occur, even more so if the domain name is not resolvable.
  +            // Whether this can be a problem in practical situations I can't tell, 
but
  +            // thought I'd keep a note just in case...
  +            // BTW, note that using a Vector and removing duplicates via scan
  +            // would not help, since URL.equals requires name resolution too.
  +            // TODO: maybe change the API to return URL Strings instead of 
java.net.URLs?
           }
           
           // See whether we can use LinkedHashSet or not:
  @@ -294,13 +304,13 @@
           private static final TestData[] TESTS = new TestData[]{
                new TestData(
                             "testfiles/HTMLParserTestCase.html",
  -                                  "http://myhost/mydir/myfile.html";,
  +                                  "http://localhost/mydir/myfile.html";,
                                     "testfiles/HTMLParserTestCase.set",
                                      "testfiles/HTMLParserTestCase.all"
                             ),
                        new TestData(
                                     "testfiles/HTMLParserTestCaseWithBaseHRef.html",
  -                                              "http://myhost/mydir/myfile.html";,
  +                                              "http://localhost/mydir/myfile.html";,
                                                 "testfiles/HTMLParserTestCase.set",
                                                  "testfiles/HTMLParserTestCase.all"
                                                 ),
  @@ -318,7 +328,7 @@
                                                 ),
               new TestData(
                            "testfiles/HTMLParserTestCaseWithComments.html",
  -                         "http://myhost/mydir/myfile.html";,
  +                         "http://localhost/mydir/myfile.html";,
                            "testfiles/HTMLParserTestCase.set",
                            "testfiles/HTMLParserTestCase.all"
                            ),
  
  
  

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

Reply via email to