[Httpunit-commit] CVS: httpunit/test/com/meterware/servletunit JUnitServletTest.java,1.6,1.7
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-04-01 16:19:18
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/servletunit
In directory sc8-pr-cvs1:/tmp/cvs-serv29589/test/com/meterware/servletunit
Modified Files:
JUnitServletTest.java
Log Message:
Added support for JUnitServlet text formatting
Index: JUnitServletTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/servletunit/JUnitServletTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JUnitServletTest.java 27 Feb 2003 23:36:06 -0000 1.6
+++ JUnitServletTest.java 1 Apr 2003 16:19:14 -0000 1.7
@@ -89,6 +89,14 @@
}
+ public void testAllTestsPassTextFormat() throws Exception {
+ ServletUnitClient client = newClient();
+ WebResponse wr = client.getResponse( "http://localhost/JUnit?format=text&test=" + PassingTests.class.getName() );
+ String expectedStart = PassingTests.class.getName() + " (1 test): OK";
+ assertTrue( "Results (" + wr.getText() + ") should start with '" + expectedStart, wr.getText().startsWith( expectedStart ) );
+ }
+
+
public void testSomeFailures() throws Exception {
ServletUnitClient client = newClient();
@@ -104,6 +112,16 @@
assertEquals( "Failure index 1", "1", results[2][0] );
assertEquals( "Failure index 2", "2", results[3][0] );
assertTrue( "Test class not found", results[2][1].indexOf( '(' + FailingTests.class.getName() + ')' ) >= 0 );
+ }
+
+
+ public void testSomeFailuresTextFormat() throws Exception {
+ ServletUnitClient client = newClient();
+
+ WebResponse wr = client.getResponse( "http://localhost/JUnit?format=text&test=" + FailingTests.class.getName() );
+ String expectedStart = FailingTests.class.getName() + " (3 tests): Problems Occurred";
+ assertTrue( "Results (" + wr.getText() + ") should start with: " + expectedStart, wr.getText().startsWith( expectedStart ) );
+ assertTrue( "Results (" + wr.getText() + ") should contain: 2 failures", wr.getText().indexOf( "2 failures" ) >= 0 );
}
|