[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebClient.java,1.10,1.11 WebForm.java,1.3
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2001-11-12 19:48:38
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv31024/src/com/meterware/httpunit
Modified Files:
WebClient.java WebForm.java WebRequest.java
Log Message:
General code cleanup
Index: WebClient.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- WebClient.java 2001/11/08 22:07:52 1.10
+++ WebClient.java 2001/11/12 19:48:35 1.11
@@ -254,13 +254,14 @@
private void validateHeaders( WebResponse response ) throws HttpException, IOException {
if (response.getHeaderField( "WWW-Authenticate" ) != null) {
throw new AuthorizationRequiredException( response.getHeaderField( "WWW-Authenticate" ) );
- } else if (!HttpUnitOptions.getExceptionsThrownOnErrorStatus()) {
- } else if (response.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
- throw new HttpInternalErrorException( response.getURL() );
- } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
- throw new HttpNotFoundException( response.getURL() );
- } else if (response.getResponseCode() >= HttpURLConnection.HTTP_BAD_REQUEST) {
- throw new HttpException( response.getResponseCode(), response.getResponseMessage(), response.getURL() );
+ } else if (HttpUnitOptions.getExceptionsThrownOnErrorStatus()) {
+ if (response.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
+ throw new HttpInternalErrorException( response.getURL() );
+ } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
+ throw new HttpNotFoundException( response.getURL() );
+ } else if (response.getResponseCode() >= HttpURLConnection.HTTP_BAD_REQUEST) {
+ throw new HttpException( response.getResponseCode(), response.getResponseMessage(), response.getURL() );
+ }
}
}
Index: WebForm.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- WebForm.java 2001/11/08 22:07:52 1.30
+++ WebForm.java 2001/11/12 19:48:35 1.31
@@ -21,9 +21,14 @@
*******************************************************************************************************************/
import java.net.URL;
-import java.util.*;
+import java.util.Hashtable;
+import java.util.Vector;
-import org.w3c.dom.*;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
/**
* This class represents a form in an HTML page. Users of this class may examine the parameters
Index: WebRequest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequest.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- WebRequest.java 2001/11/09 18:35:14 1.28
+++ WebRequest.java 2001/11/12 19:48:35 1.29
@@ -19,13 +19,25 @@
* DEALINGS IN THE SOFTWARE.
*
*******************************************************************************************************************/
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.IOException;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.reflect.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
import java.security.Provider;
import java.security.Security;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Hashtable;
/**
* A request sent to a web server.
|