[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit FileUploadTest.java,1.2,1.3 PseudoServer
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2001-04-02 19:07:40
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv29110/test/com/meterware/httpunit
Modified Files:
FileUploadTest.java PseudoServer.java
Log Message:
Reimplement file upload w/o JavaMail
Index: FileUploadTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FileUploadTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FileUploadTest.java 2001/03/20 23:35:43 1.2
+++ FileUploadTest.java 2001/04/02 19:07:36 1.3
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
-* Copyright (c) 2000, Russell Gold
+* Copyright (c) 2000-2001, 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
@@ -212,8 +212,10 @@
if (i < numParts-1) sb.append( '&' );
}
} catch (MessagingException e) {
+ e.printStackTrace();
sb.append( "Oops: " + e );
} catch (IOException e) {
+ e.printStackTrace();
sb.append( "Oops: " + e );
}
Index: PseudoServer.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/PseudoServer.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- PseudoServer.java 2001/03/23 20:50:41 1.10
+++ PseudoServer.java 2001/04/02 19:07:36 1.11
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
-* Copyright (c) 2000, Russell Gold
+* Copyright (c) 2000-2001, 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
@@ -245,7 +245,6 @@
}
header = br.readLine();
}
-
readContent( headers, br );
return headers;
}
@@ -262,6 +261,22 @@
}
}
+
+ private void printContent( char[] content ) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < content.length; i++) {
+ if (i == 0) {
+ } else if ((i % 40) == 0) {
+ sb.append( '\n' );
+ } else if (i % 4 == 0) {
+ sb.append( ' ' );
+ }
+ sb.append( Integer.toHexString( content[i] ) );
+ }
+ System.out.println( sb.toString() );
+ }
+
+
private Dictionary getParameters( String content ) throws IOException {
Hashtable parameters = new Hashtable();
if (content == null || content.trim().length() == 0) return parameters;
|