[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit HtmlTablesTest.java,1.14,1.15 HttpUnitTe
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-12-26 15:34:00
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory sc8-pr-cvs1:/tmp/cvs-serv21758/test/com/meterware/httpunit Modified Files: HtmlTablesTest.java HttpUnitTest.java Log Message: Expanded HTMLElement support to TableRow and TableCell Index: HtmlTablesTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/HtmlTablesTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- HtmlTablesTest.java 26 Dec 2002 04:59:35 -0000 1.14 +++ HtmlTablesTest.java 26 Dec 2002 15:33:57 -0000 1.15 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2001, Russell Gold +* Copyright (c) 2000-2002, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -19,10 +19,6 @@ * DEALINGS IN THE SOFTWARE. * *******************************************************************************************************************/ -import java.net.URL; - -import junit.framework.Test; -import junit.framework.TestCase; import junit.framework.TestSuite; @@ -39,13 +35,13 @@ } - public static Test suite() { - return new TestSuite( HtmlTablesTest.class ); + public static TestSuite suite() { + return new TestSuite( HtmlTablesTest.class ); } public HtmlTablesTest( String name ) { - super( name ); + super( name ); } @@ -269,7 +265,6 @@ /** * Get a specific cell with a given id in a WebTable - * @author <a href="mailto:bx...@bi...">Benoit Xhenseval</a> **/ public void testCellsWithID() throws Exception { defineWebPage( "Default", "<h2>Interesting data</h2>" + @@ -293,16 +288,8 @@ cell = table.getTableCellWithID("nonExistingID"); assertNull("cell id2",cell); - // check the ignore case.TRUE - HttpUnitOptions.setMatchesIgnoreCase(true); - cell = table.getTableCellWithID("iD2"); - assertNotNull("cell id2",cell); - assertEquals("Value of cell id2","value2",cell.asText()); - - // check the ignore case FALSE - HttpUnitOptions.setMatchesIgnoreCase(false); - cell = table.getTableCellWithID("iD2"); - assertNull("cell iD2",cell); + cell = (TableCell) page.getElementWithID( "id1" ); + assertEquals( "value of cell found from page", "value1", cell.asText() ); } private WebConversation _wc; Index: HttpUnitTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/HttpUnitTest.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- HttpUnitTest.java 25 Nov 2002 22:41:07 -0000 1.24 +++ HttpUnitTest.java 26 Dec 2002 15:33:57 -0000 1.25 @@ -30,6 +30,7 @@ public class HttpUnitTest extends HttpUserAgentTest { private boolean _showTestName; + private long _startTime; public HttpUnitTest( String name ) { @@ -46,8 +47,21 @@ public void setUp() throws Exception { super.setUp(); HttpUnitOptions.reset(); - if (_showTestName) System.out.println( "----------------------- " + getName() + " ------------------------"); + if (_showTestName) { + System.out.println( "----------------------- " + getName() + " ------------------------"); + _startTime = System.currentTimeMillis(); + } } + + + public void tearDown() throws Exception { + super.tearDown(); + if (_showTestName) { + long duration = System.currentTimeMillis() - _startTime; + System.out.println( "... took " + duration + " msec"); + } + } + static { new WebConversation(); |