This is the mail archive of the mauve-discuss@sources.redhat.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

URLTest - The world has changed


Hi,

The web pages referred to by URLTest are now served by newer http
daemons, have cooler content, etc.

* gnu/testlet/java/net/URL/URLTest.java (test_openConnection): Be less
strict in server name/version (Apache) and content type (text/html) 
(test_openStream): Be less strict in actual content (HTML).

Any objections?

Cheers,

Mark
Index: gnu/testlet/java/net/URL/URLTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/net/URL/URLTest.java,v
retrieving revision 1.3
diff -u -r1.3 URLTest.java
--- URLTest.java	2000/03/04 02:19:21	1.3
+++ URLTest.java	2002/04/05 15:04:51
@@ -128,9 +128,11 @@
 
 			URLConnection conn = url.openConnection();
 
-			harness.check (conn.getHeaderField(2), "Apache/1.3.9 (Unix)");
+			harness.check (conn.getHeaderField(2).indexOf("Apache") != -1,
+							"I want my Apache server!");
 			String conttype	= conn.getContentType();
-			harness.check (conttype, "text/html");
+			harness.check (conttype.indexOf("text/html") != -1,
+							"Content must be text/html");
 
 			Object obj = url.getContent();
 			harness.check (url.toExternalForm(),
@@ -156,11 +158,12 @@
 			URL url = new URL ( "http://sourceware.cygnus.com/mauve/testarea/index.html";);
 			java.io.InputStream conn = url.openStream();
 
-			byte b [] = new byte[6];
-			conn.read(b , 0 , 6 );
+			byte b [] = new byte[256];
+			conn.read(b , 0 , 256 );
 
 			String str = new String( b ) ;
-			harness.check (str, "<HTML>");
+			harness.check (str.indexOf("HTML") != -1,
+							"Need some HTML");
 
 		}catch ( Exception e ){
 			harness.fail(" Error in test_openStream  - 2 " + 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]