[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebClientTest.java,1.10,1.11 WebPageTest
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-03-16 17:22:43
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv18420/test/com/meterware/httpunit
Modified Files:
WebClientTest.java WebPageTest.java
Log Message:
Moved properties from HttpUnitOptions to ClientProperties
Index: WebClientTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebClientTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- WebClientTest.java 24 Oct 2002 13:28:55 -0000 1.10
+++ WebClientTest.java 16 Mar 2003 17:22:38 -0000 1.11
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
- * Copyright (c) 2002, Russell Gold
+ * Copyright (c) 2002-2003, 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
@@ -36,7 +36,7 @@
/**
*
- * @author <a href="mailto:rus...@ac...">Russell Gold</a>
+ * @author <a href="mailto:rus...@ht...">Russell Gold</a>
**/
public class WebClientTest extends HttpUnitTest {
@@ -90,8 +90,8 @@
defineResource( resourceName, resourceValue );
addResourceHeader( resourceName, "Set-Cookie: age=12" );
- HttpUnitOptions.setAcceptCookies( false );
WebConversation wc = new WebConversation();
+ wc.getClientProperties().setAcceptCookies( false );
WebRequest request = new GetMethodWebRequest( getHostPath() + '/' + resourceName );
WebResponse response = wc.getResponse( request );
assertEquals( "requested resource", resourceValue, response.getText().trim() );
@@ -170,9 +170,9 @@
public void testGZIPDisabled() throws Exception {
String expectedResponse = "Here is my answer";
defineResource( "Compressed.html", new CompressedPseudoServlet( expectedResponse ) );
- HttpUnitOptions.setAcceptGzip( false );
WebConversation wc = new WebConversation();
+ wc.getClientProperties().setAcceptGzip( false );
WebResponse wr = wc.getResponse( getHostPath() + "/Compressed.html" );
assertNull( "Should not have received a Content-Encoding header", wr.getHeaderField( "Content-encoding" ) );
assertEquals( "Content-Type", "text/plain", wr.getContentType() );
@@ -248,7 +248,7 @@
ArrayList messageLog = new ArrayList();
wc.addClientListener( new ListenerExample( messageLog ) );
- WebResponse response = wc.getResponse( getHostPath() + "/Frames.html" );
+ wc.getResponse( getHostPath() + "/Frames.html" );
assertEquals( "Num logged items", 6, messageLog.size() );
for (int i = 0; i < 3; i++) {
verifyRequestResponsePair( messageLog, 2 * i );
@@ -333,8 +333,8 @@
defineResource( redirectName, redirectValue, HttpURLConnection.HTTP_MOVED_PERM );
addResourceHeader( redirectName, "Location: " + getHostPath() + '/' + resourceName );
- HttpUnitOptions.setAutoRedirect( false );
WebConversation wc = new WebConversation();
+ wc.getClientProperties().setAutoRedirect( false );
WebResponse response = wc.getResponse( getHostPath() + '/' + redirectName );
assertEquals( "requested resource", redirectValue, response.getText().trim() );
assertEquals( "content type", "text/html", response.getContentType() );
Index: WebPageTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebPageTest.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- WebPageTest.java 5 Feb 2003 05:15:51 -0000 1.28
+++ WebPageTest.java 16 Mar 2003 17:22:38 -0000 1.29
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
-* Copyright (c) 2000-2001, Russell Gold
+* Copyright (c) 2000-2003, 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
@@ -40,7 +40,7 @@
**/
public class WebPageTest extends HttpUnitTest {
- public static void main(String args[]) {
+ public static void main( String args[] ) {
junit.textui.TestRunner.run( suite() );
}
@@ -58,7 +58,6 @@
public void tearDown() throws Exception {
super.tearDown();
HttpUnitOptions.resetDefaultCharacterSet();
- HttpUnitOptions.setAutoRefresh( false );
}
@@ -335,8 +334,8 @@
defineResource( "SimplePage.html", page );
defineWebPage( "NextPage", "Not much here" );
- HttpUnitOptions.setAutoRefresh( true );
WebConversation wc = new WebConversation();
+ wc.getClientProperties().setAutoRefresh( true );
WebRequest request = new GetMethodWebRequest( getHostPath() + "/SimplePage.html" );
WebResponse simplePage = wc.getResponse( request );
|