[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit FileUploadTest.java,1.7,1.8
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2001-10-19 18:26:32
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv7181/test/com/meterware/httpunit
Modified Files:
FileUploadTest.java
Log Message:
Allow file uploads in POST w/o form
Index: FileUploadTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/FileUploadTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FileUploadTest.java 2001/07/31 16:08:59 1.7
+++ FileUploadTest.java 2001/10/19 18:26:29 1.8
@@ -182,6 +182,19 @@
}
+ public void testFileUploadWithoutForm() throws Exception {
+ ByteArrayInputStream bais = new ByteArrayInputStream( "Not much text\nBut two lines\n".getBytes() );
+
+ defineResource( "ListParams", new MimeEcho() );
+ WebConversation wc = new WebConversation();
+ PostMethodWebRequest formSubmit = new PostMethodWebRequest( getHostPath() + "/ListParams" );
+ formSubmit.setMimeEncoded( true );
+ formSubmit.selectFile( "message", "temp.txt", bais, "text/plain" );
+ WebResponse encoding = wc.getResponse( formSubmit );
+ assertEqualQueries( "text/plain:message.name=temp.txt&message.lines=2", encoding.getText().trim() );
+ }
+
+
public void testFileContentType() throws Exception {
File file = new File( "temp.gif" );
FileOutputStream fos = new FileOutputStream( file );
|