On 7 October 2011 10:27,  <pmoua...@apache.org> wrote:
> Author: pmouawad
> Date: Fri Oct  7 09:27:54 2011
> New Revision: 1179979
>
> URL: http://svn.apache.org/viewvc?rev=1179979&view=rev
> Log:
> Fixed errors in TestCase (6 test failures):
> - Error in baseURL for relative file names (testfiles not needed I think)

Not sure about that - needs further invetigation.

> - FileInputStream not closed

OK

> - Renamed  HTMLParserTestFile_2.htm to HTMLParserTestFile_2.html

I think that was the wrong fix, as you discovered later when the batch
test failed.
But not work reverting now.

> Added:
>    jakarta/jmeter/trunk/bin/testfiles/HTMLParserTestFile_2.html
>      - copied unchanged from r1179973, 
> jakarta/jmeter/trunk/bin/testfiles/HTMLParserTestFile_2.htm
> Removed:
>    jakarta/jmeter/trunk/bin/testfiles/HTMLParserTestFile_2.htm
> Modified:
>    
> jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
>
> Modified: 
> jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
> URL: 
> http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java?rev=1179979&r1=1179978&r2=1179979&view=diff
> ==============================================================================
> --- 
> jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
>  (original)
> +++ 
> jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
>  Fri Oct  7 09:27:54 2011
> @@ -22,6 +22,7 @@ import java.io.BufferedReader;
>  import java.io.File;
>  import java.io.FileInputStream;
>  import java.io.FileReader;
> +import java.io.InputStream;
>  import java.net.URL;
>  import java.util.ArrayList;
>  import java.util.Collection;
> @@ -32,12 +33,14 @@ import java.util.Properties;
>  import java.util.TreeSet;
>  import java.util.Vector;
>
> +import org.apache.commons.io.IOUtils;
>  import org.apache.jmeter.junit.JMeterTestCase;
>  import org.apache.jmeter.util.JMeterUtils;
>  import org.apache.jorphan.logging.LoggingManager;
>  import org.apache.log.Logger;
>
>  import junit.framework.TestSuite;
> +import junit.textui.TestRunner;
>
>  public class TestHTMLParser extends JMeterTestCase {
>     private static final Logger log = LoggingManager.getLoggerForClass();
> @@ -135,7 +138,7 @@ public class TestHTMLParser extends JMet
>                         "testfiles/HTMLParserTestFrames.all"),
>                 // Relative filenames
>                 new TestData("testfiles/HTMLParserTestFile_2.html",
> -                        "file:testfiles/HTMLParserTestFile_2.html",
> +                        "file:HTMLParserTestFile_2.html",
>                         "testfiles/HTMLParserTestFile_2.all",
>                         "testfiles/HTMLParserTestFile_2.all"),
>                          };
> @@ -252,8 +255,14 @@ public class TestHTMLParser extends JMet
>             log.debug("file   " + file);
>             File f = findTestFile(file);
>             byte[] buffer = new byte[(int) f.length()];
> -            int len = new FileInputStream(f).read(buffer);
> -            assertEquals(len, buffer.length);
> +            InputStream is = null;
> +            try {
> +                is = new FileInputStream(f);
> +                int len = is.read(buffer);
> +                assertEquals(len, buffer.length);
> +            } finally {
> +                IOUtils.closeQuietly(is);
> +            }
>             Iterator<URL> result;
>             if (c == null) {
>                 result = p.getEmbeddedResourceURLs(buffer, new URL(url));
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: notifications-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: notifications-h...@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: dev-h...@jakarta.apache.org

Reply via email to