tika-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattm...@apache.org
Subject svn commit: r1306029 - /tika/trunk/tika-server/src/test/java/org/apache/tika/server/CXFTestBase.java
Date Tue, 27 Mar 2012 22:24:15 GMT
Author: mattmann
Date: Tue Mar 27 22:24:15 2012
New Revision: 1306029

URL: http://svn.apache.org/viewvc?rev=1306029&view=rev
Log:
- set Content-Type field: that's what the test is actually doing. TIKA-593

Modified:
    tika/trunk/tika-server/src/test/java/org/apache/tika/server/CXFTestBase.java

Modified: tika/trunk/tika-server/src/test/java/org/apache/tika/server/CXFTestBase.java
URL: http://svn.apache.org/viewvc/tika/trunk/tika-server/src/test/java/org/apache/tika/server/CXFTestBase.java?rev=1306029&r1=1306028&r2=1306029&view=diff
==============================================================================
--- tika/trunk/tika-server/src/test/java/org/apache/tika/server/CXFTestBase.java (original)
+++ tika/trunk/tika-server/src/test/java/org/apache/tika/server/CXFTestBase.java Tue Mar 27
22:24:15 2012
@@ -25,6 +25,8 @@ import java.io.InputStreamReader;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.ws.rs.core.HttpHeaders;
+
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.compress.archivers.ArchiveEntry;
 import org.apache.commons.compress.archivers.ArchiveInputStream;
@@ -91,11 +93,12 @@ public class CXFTestBase extends TestCas
 		putAndCheckStatus(address, null, content, expectedStatus);
 	}
 	
-	protected void putAndCheckStatus(String address, String accept, InputStream content,
+	protected void putAndCheckStatus(String address, String contentType, InputStream content,
 			int expectedStatus) throws Exception {
 		PutMethod put = new PutMethod(address);
 		put.setRequestBody(content);
-		if(accept != null) put.setRequestHeader("Accept", accept);
+		if(contentType != null) 
+			put.setRequestHeader(HttpHeaders.CONTENT_TYPE, contentType);
 		HttpClient httpClient = new HttpClient();
 		try {
 			int result = httpClient.executeMethod(put);
@@ -139,7 +142,6 @@ public class CXFTestBase extends TestCas
 			put.releaseConnection();
 		}
 
-		System.out.println("DATA: "+data);
 		return data;
 	}
 	



Mime
View raw message