[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebPageTest.java,1.22,1.23
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-10-31 15:17:52
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv12787/test/com/meterware/httpunit Modified Files: WebPageTest.java Log Message: Improve return from WebForm.submit and WebLink.click Index: WebPageTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebPageTest.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- WebPageTest.java 14 Oct 2002 18:27:45 -0000 1.22 +++ WebPageTest.java 31 Oct 2002 15:17:17 -0000 1.23 @@ -19,22 +19,14 @@ * DEALINGS IN THE SOFTWARE. * *******************************************************************************************************************/ - import com.meterware.pseudoserver.PseudoServlet; import com.meterware.pseudoserver.WebResource; -import java.net.URL; - import junit.framework.Test; -import junit.framework.TestCase; import junit.framework.TestSuite; -import java.util.Dictionary; -import java.util.Vector; - import java.io.*; -import org.w3c.dom.Document; /** @@ -71,7 +63,7 @@ WebConversation wc = new WebConversation(); try { WebRequest request = new GetMethodWebRequest( getHostPath() + "/SimplePage.html" ); - WebResponse simplePage = wc.getResponse( request ); + wc.getResponse( request ); fail( "Did not complain about missing page" ); } catch (HttpNotFoundException e) { } @@ -120,7 +112,7 @@ try { WebConversation wc = new WebConversation(); WebRequest request = new GetMethodWebRequest( "file:" + file.getAbsolutePath() ); - WebResponse simplePage = wc.getResponse( request ); + wc.getResponse( request ); fail( "Should have complained about missing file" ); } catch (java.io.FileNotFoundException e) { } @@ -319,10 +311,8 @@ /** * Test the meta tag content retrieval - * @author <a href="mailto:bx...@bi...">Benoit Xhenseval</a> **/ public void testMetaTag() throws Exception { - String refreshURL = getHostPath() + "/NextPage.html"; String page = "<html><head><title>Sample</title>" + "<meta Http-equiv=\"Expires\" content=\"now\"/>\n" + "<meta name=\"robots\" content=\"index,follow\"/>" + @@ -344,10 +334,8 @@ /** * test the stylesheet retrieval - * @author <a href="mailto:bx...@bi...">Benoit Xhenseval</a> **/ public void testGetExternalStylesheet() throws Exception { - String refreshURL = getHostPath() + "/NextPage.html"; String page = "<html><head><title>Sample</title>" + "<link rev=\"made\" href=\"/Me...@my...\"/>" + "<link type=\"text/css\" rel=\"stylesheet\" href=\"/style.css\"/>" + @@ -362,16 +350,6 @@ assertEquals( "Stylesheet","/style.css",simplePage.getExternalStyleSheet()); } - - private String toUnicode( String string ) { - StringBuffer sb = new StringBuffer( ); - char[] chars = string.toCharArray(); - for (int i = 0; i < chars.length; i++) { - sb.append( "\\u" ); - sb.append( Integer.toHexString( chars[i] ) ); - } - return sb.toString(); - } /** |