From: <no...@us...> - 2003-09-09 20:16:15
|
Log Message: ----------- Added test for bug 802285 but left it disabled until the fix can be put in Added Files: ----------- /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html: TableElementCreatorTest.java Revision Data ------------- --- NEW FILE: TableElementCreatorTest.java --- /* * Copyright (c) 2002, 2003 Gargoyle Software Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The end-user documentation included with the redistribution, if any, must * include the following acknowledgment: * * "This product includes software developed by Gargoyle Software Inc. * (http://www.GargoyleSoftware.com/)." * * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. * 4. The name "Gargoyle Software" must not be used to endorse or promote * products derived from this software without prior written permission. * For written permission, please contact in...@Ga.... * 5. Products derived from this software may not be called "HtmlUnit", nor may * "HtmlUnit" appear in their name, without prior written permission of * Gargoyle Software Inc. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARGOYLE * SOFTWARE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.gargoylesoftware.htmlunit.html; import com.gargoylesoftware.htmlunit.FakeWebConnection; import com.gargoylesoftware.htmlunit.SubmitMethod; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebTestCase; import java.net.URL; import java.util.Collections; /** * Tests for TableElementCreator * * @version $Revision: 1.1 $ * @author <a href="mailto:mb...@Ga...">Mike Bowler</a> */ public class TableElementCreatorTest extends WebTestCase { /** * Create an instance * * @param name The name of the test */ public TableElementCreatorTest( final String name ) { super( name ); } /** * Regression test for asText() which would blow up inside the TableElementCreator * * @exception Exception If the test fails */ public void testGetTableCell() throws Exception { if(true) { notImplemented(); return; } final String htmlContent = "<html><head><title>test</title></head>" + "<body><table>" + "<tr><form><td>a</td></form></tr>" + "</table></body></html>"; final WebClient client = new WebClient(); final FakeWebConnection webConnection = new FakeWebConnection( client ); webConnection.setContent( htmlContent ); client.setWebConnection( webConnection ); final HtmlPage page = ( HtmlPage )client.getPage( new URL( "http://first" ), SubmitMethod.POST, Collections.EMPTY_LIST ); // Calling asText() will invoke the element creator which in turn will blow up System.out.println(page.asXml()); } } |