[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebImageTest.java,1.1,1.2
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-08-22 16:19:57
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv21232/test/com/meterware/httpunit Modified Files: WebImageTest.java Log Message: Added WebImage.getAltText, WebResponse.getImageWithAltText Index: WebImageTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebImageTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WebImageTest.java 15 Jul 2002 14:30:32 -0000 1.1 +++ WebImageTest.java 22 Aug 2002 16:19:54 -0000 1.2 @@ -52,13 +52,17 @@ "<html><head><title>A Sample Page</title></head>\n" + "<body><img src='sample.jpg'>\n" + "<IMG SRC='another.png'>" + - " and <img src='onemore.gif'>\n" + + " and <img src='onemore.gif' alt='one'>\n" + "</body></html>\n" ); WebConversation wc = new WebConversation(); WebRequest request = new GetMethodWebRequest( getHostPath() + "/SimplePage.html" ); WebResponse simplePage = wc.getResponse( request ); assertEquals( "Number of images", 3, simplePage.getImages().length ); assertEquals( "First image source", "sample.jpg", simplePage.getImages()[0].getSource() ); + + WebImage image = simplePage.getImageWithAltText( "one" ); + assertNotNull( "No image found", image ); + assertEquals( "Selected image source", "onemore.gif", image.getSource() ); } |