webwork/src/test/webwork/view/taglib/ui/table WebTableTestCase.java,1.1,1.2

[email protected] Thu, 13 Nov 2003 15:48:49 -0800
Newsgroups gmane.comp.java.open-symphony.cvs
Message-ID <[email protected]>
Update of /cvsroot/opensymphony/webwork/src/test/webwork/view/taglib/ui/table
In directory sc8-pr-cvs1:/tmp/cvs-serv19426/src/test/webwork/view/taglib/ui/table

Modified Files:
	WebTableTestCase.java 
Log Message:
Add test header sorting

Index: WebTableTestCase.java
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/test/webwork/view/taglib/ui/table/WebTableTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- WebTableTestCase.java	13 Nov 2003 23:09:10 -0000	1.1
+++ WebTableTestCase.java	13 Nov 2003 23:48:47 -0000	1.2
@@ -1,6 +1,7 @@
 package webwork.view.taglib.ui.table;
 
 import java.io.IOException;
+import java.net.MalformedURLException;
 
 import webwork.view.WebSupport;
 import com.meterware.httpunit.*;
@@ -27,5 +28,18 @@
     assertEquals("unexpected contents for cell [2][0]", "2001-02-02", contents[2][0].trim());
     assertEquals("unexpected contents for cell [2][2]", "default renderer (2)", contents[2][2].trim());
     assertEquals("unexpected contents for cell [3][4]", "weird stuff!", contents[3][4].trim());
+  }
+
+  public void testSortTable() throws SAXException, IOException
+  {
+    WebConversation conversation = new WebConversation();
+    WebRequest request = new GetMethodWebRequest(TEST_HOME + "tests/table.action");
+    WebResponse response = conversation.getResponse(request);
+    com.meterware.httpunit.WebTable table = response.getTableWithID("tabletest");
+    TableCell cell = table.getTableCell(0, 0);
+    WebLink link = cell.getLinks()[0];
+    response = link.click();
+    table = response.getTableWithID("tabletest");
+    assertEquals("unexpected contents for cell [1][0]", "2001-02-02", table.getCellAsText(1, 0).trim());
   }
 }




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/