Author: bdelacretaz
Date: Mon Feb 21 17:06:04 2011
New Revision: 1073068

URL: http://svn.apache.org/viewvc?rev=1073068&view=rev
Log:
STANBOL-19 - ignore whatever follows semicolon in assertContentType

Modified:
    
incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java

Modified: 
incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java?rev=1073068&r1=1073067&r2=1073068&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java
 (original)
+++ 
incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java
 Mon Feb 21 17:06:04 2011
@@ -155,7 +155,15 @@ public class RequestExecutor {
         if(entity == null) {
             fail(this + ": no entity in response, cannot check content type");
         }
-        assertEquals(this + ": expecting content type " + expected, expected, 
entity.getContentType().getValue());
+        
+        // Remove whatever follows semicolon in content-type
+        String contentType = entity.getContentType().getValue();
+        if(contentType != null) {
+            contentType = contentType.split(";")[0].trim();
+        }
+        
+        // And check for match
+        assertEquals(this + ": expecting content type " + expected, expected, 
contentType);
         return this;
     }
 


Reply via email to