1 17 package com.sun.syndication.fetcher.impl; 18 19 import com.sun.syndication.fetcher.impl.ResponseHandler; 20 21 import junit.framework.TestCase; 22 23 public class ResponseHandlerTest extends TestCase { 24 25 28 public ResponseHandlerTest(String arg0) { 29 super(arg0); 30 } 31 32 public void testGetCharacterEncodingString() { 33 assertEquals(ResponseHandler.defaultCharacterEncoding, ResponseHandler.getCharacterEncoding((String )null)); 34 assertEquals(ResponseHandler.defaultCharacterEncoding, ResponseHandler.getCharacterEncoding("text/xml")); 35 assertEquals(ResponseHandler.defaultCharacterEncoding, ResponseHandler.getCharacterEncoding("text/xml;")); 36 assertEquals("ISO-8859-4", ResponseHandler.getCharacterEncoding("text/xml; charset=ISO-8859-4")); 37 assertEquals("ISO-8859-4", ResponseHandler.getCharacterEncoding("text/xml;charset=ISO-8859-4")); 38 assertEquals("ISO-8859-4", ResponseHandler.getCharacterEncoding("text/xml;charset=ISO-8859-4;something")); 39 assertEquals(ResponseHandler.defaultCharacterEncoding, ResponseHandler.getCharacterEncoding("text/xml;something")); 40 } 41 42 } 43 | Popular Tags |