[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit HttpUnitTest.java,1.16,1.17 WebFormTest.
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2001-10-26 14:00:13
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv13428/test/com/meterware/httpunit
Modified Files:
HttpUnitTest.java WebFormTest.java WebFrameTest.java
WebLinkTest.java
Log Message:
Now using assertTrue for JUnit 3.7 compatibility
Index: HttpUnitTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/HttpUnitTest.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- HttpUnitTest.java 2001/10/25 17:30:03 1.16
+++ HttpUnitTest.java 2001/10/26 14:00:10 1.17
@@ -94,7 +94,7 @@
return _hostPath;
}
- public void assertTrue( String comment, boolean expression ) {
+ public static void assertTrue( String comment, boolean expression ) {
assert( comment, expression );
}
Index: WebFormTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebFormTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- WebFormTest.java 2001/08/06 20:19:41 1.12
+++ WebFormTest.java 2001/10/26 14:00:10 1.13
@@ -124,7 +124,7 @@
WebForm form = _wc.getResponse( getHostPath() + "/OneForm.html" ).getForms()[0];
WebRequest request = form.getRequest();
request.setParameter( "name", "master" );
- assert( "Should be a post request", !(request instanceof GetMethodWebRequest) );
+ assertTrue( "Should be a post request", !(request instanceof GetMethodWebRequest) );
assertEquals( getHostPath() + "/servlet/Login", request.getURL().toExternalForm() );
}
Index: WebFrameTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebFrameTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- WebFrameTest.java 2001/07/31 16:08:59 1.7
+++ WebFrameTest.java 2001/10/26 14:00:10 1.8
@@ -75,9 +75,9 @@
public void testDefaultFrameContents() throws Exception {
WebResponse response = _wc.getResponse( getHostPath() + "/Linker.html" );
- assert( "Default response not the same as default frame contents", response == _wc.getFrameContents( "_top" ) );
+ assertTrue( "Default response not the same as default frame contents", response == _wc.getFrameContents( "_top" ) );
response = _wc.getResponse( response.getLinks()[0].getRequest() );
- assert( "Second response not the same as default frame contents", response == _wc.getFrameContents( "_top" ) );
+ assertTrue( "Second response not the same as default frame contents", response == _wc.getFrameContents( "_top" ) );
}
@@ -111,7 +111,7 @@
WebResponse response = _wc.getResponse( getHostPath() + "/Frames.html" );
response = _wc.getResponse( _wc.getFrameContents( "red" ).getLinks()[0].getRequest() );
- assert( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
+ assertTrue( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
assertMatchingSet( "Frames defined for the conversation", new String[] { "_top", "red", "blue" }, _wc.getFrameNames() );
assertEquals( "URL for second request", getHostPath() + "/Target.html", response.getURL().toExternalForm() );
}
@@ -134,7 +134,7 @@
WebResponse response = _wc.getResponse( getHostPath() + "/Frames.html" );
response = _wc.getResponse( _wc.getFrameContents( "red" ).getLinks()[0].getRequest() );
- assert( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
+ assertTrue( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
assertMatchingSet( "Frames defined for the conversation", new String[] { "_top", "red", "blue" }, _wc.getFrameNames() );
assertEquals( "URL for second request", getHostPath() + "/Deeper/Target.html", response.getURL().toExternalForm() );
}
@@ -159,7 +159,7 @@
response = _wc.getResponse( linker.getLinks()[0].getRequest() );
WebResponse target = getFrameWithURL( _wc, "Target" );
- assert( "Second response not the same as source frame contents", response == target );
+ assertTrue( "Second response not the same as source frame contents", response == target );
}
@@ -187,7 +187,7 @@
_wc.getResponse( _wc.getFrameContents( "red" ).getLinks()[0].getRequest() );
response = _wc.getResponse( _wc.getFrameContents( "blue" ).getLinks()[0].getRequest() );
- assert( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
+ assertTrue( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
assertMatchingSet( "Frames defined for the conversation", new String[] { "_top", "red", "blue" }, _wc.getFrameNames() );
assertEquals( "URL for second request", getHostPath() + "/Linker.html", response.getURL().toExternalForm() );
}
@@ -198,7 +198,7 @@
response = _wc.getResponse( _wc.getFrameContents( "red" ).getLinks()[0].getRequest() );
response = _wc.getResponse( response.getLinks()[0].getRequest() );
- assert( "Second response not the same as source frame contents", response == _wc.getFrameContents( "_top" ) );
+ assertTrue( "Second response not the same as source frame contents", response == _wc.getFrameContents( "_top" ) );
assertEquals( "URL for second request", getHostPath() + "/Form.html", response.getURL().toExternalForm() );
assertMatchingSet( "Frames defined for the conversation", new String[] { "_top" }, _wc.getFrameNames() );
}
@@ -225,7 +225,7 @@
_wc.getResponse( getHostPath() + "/Frames.html" );
WebResponse response = _wc.getResponse( _wc.getFrameContents( "red" ).getLinks()[0].getRequest() );
assertMatchingSet( "Frames defined for the conversation", new String[] { "_top", "red", "blue" }, _wc.getFrameNames() );
- assert( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
+ assertTrue( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
assertEquals( "URL for second request", getHostPath() + "/Target.html", response.getURL().toExternalForm() );
}
@@ -238,7 +238,7 @@
_wc.getResponse( getHostPath() + "/Frames.html" );
WebResponse response = _wc.getResponse( _wc.getFrameContents( "red" ).getForms()[0].getRequest() );
assertMatchingSet( "Frames defined for the conversation", new String[] { "_top", "red", "blue" }, _wc.getFrameNames() );
- assert( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
+ assertTrue( "Second response not the same as source frame contents", response == _wc.getFrameContents( "red" ) );
assertEquals( "URL for second request", getHostPath() + "/Target.html", response.getURL().toExternalForm() );
}
@@ -249,7 +249,7 @@
_wc.getResponse( getHostPath() + "/Frames.html" );
assertMatchingSet( "Frames defined for the conversation", new String[] { "_top", "red", "blue" }, _wc.getFrameNames() );
- assert( "Did not redirect", _wc.getFrameContents( "red" ).getURL().toExternalForm().endsWith( "Target.html" ) );
+ assertTrue( "Did not redirect", _wc.getFrameContents( "red" ).getURL().toExternalForm().endsWith( "Target.html" ) );
}
@@ -260,7 +260,7 @@
_wc.getResponse( getHostPath() + "/Frames.html" );
WebResponse response = _wc.getResponse( _wc.getFrameContents( "red" ).getLinks()[0].getRequest() );
assertMatchingSet( "Frames defined for the conversation", new String[] { "_top" }, _wc.getFrameNames() );
- assert( "Second response not the same as source frame contents", response == _wc.getFrameContents( "_top" ) );
+ assertTrue( "Second response not the same as source frame contents", response == _wc.getFrameContents( "_top" ) );
assertEquals( "URL for second request", getHostPath() + "/Target.html", response.getURL().toExternalForm() );
}
Index: WebLinkTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebLinkTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- WebLinkTest.java 2001/10/25 14:51:05 1.11
+++ WebLinkTest.java 2001/10/26 14:00:10 1.12
@@ -88,7 +88,7 @@
public void testLinkRequest() throws Exception {
WebLink link = _simplePage.getLinks()[0];
WebRequest request = link.getRequest();
- assert( "Should be a get request", request instanceof GetMethodWebRequest );
+ assertTrue( "Should be a get request", request instanceof GetMethodWebRequest );
assertEquals( getHostPath() + "/other.html", request.getURL().toExternalForm() );
}
@@ -174,7 +174,7 @@
WebRequest request = link.getRequest();
assertEquals( "Destination for link", getHostPath() + "/alternate/Target.html", request.getURL().toExternalForm() );
WebResponse nextPage = wc.getResponse( request );
- assert( "Did not find the target", nextPage.getText().indexOf( "Found" ) >= 0 );
+ assertTrue( "Did not find the target", nextPage.getText().indexOf( "Found" ) >= 0 );
}
@@ -216,7 +216,7 @@
assertNotNull( request);
Enumeration e = request.getParameterNames();
assertNotNull( e);
- assert( !e.hasMoreElements() );
+ assertTrue( "Should not have any params", !e.hasMoreElements() );
// second link should have one parameter
request = links[1].getRequest();
|