Fixing bug in HTTP accept header processing as requested by timbl@w3.org

This commit is contained in:
bdc34 2010-05-11 13:50:33 +00:00
parent da6ac0eef1
commit a8cfc10b2e
3 changed files with 26 additions and 2 deletions

View file

@ -0,0 +1,24 @@
package edu.cornell.mannlib.vitro.webapp.controller;
import org.junit.Assert;
import org.junit.Test;
import edu.cornell.mannlib.vitro.webapp.web.ContentType;
public class EntityControllerTest {
@Test
public void testAcceptHeader(){
EntityController entityController = new EntityController();
/* Check to see if vitro would send RDF/XML to tabulator */
String tabulatorsAcceptHeader =
"text/xml,application/xml,application/xhtml+xml,text/html;q=0.5,text/plain;q=0.5," +
"image/png,*/*;q=0.1," +
"application/rdf+xml;q=1.0,text/n3;q=0.4";
ContentType result = entityController.checkForLinkedDataRequest("http://notUsedInThisTestCase.com/bogus",tabulatorsAcceptHeader);
Assert.assertTrue( result != null );
Assert.assertTrue( "application/rdf+xml".equals( result.toString()) );
}
}