1 package org.displaytag.jsptests; 2 3 import org.apache.log4j.Level; 4 import org.apache.log4j.Logger; 5 import org.displaytag.tags.ColumnTag; 6 import org.displaytag.test.DisplaytagCase; 7 8 import com.meterware.httpunit.GetMethodWebRequest; 9 import com.meterware.httpunit.HttpInternalErrorException; 10 import com.meterware.httpunit.WebRequest; 11 12 13 18 public class DisabledMediaTest extends DisplaytagCase 19 { 20 21 24 public String getJspName() 25 { 26 return "disabledmedia.jsp"; 27 } 28 29 34 public void doTest(String jspName) throws Exception 35 { 36 WebRequest request = new GetMethodWebRequest(jspName); 38 39 Level previousLevel = Logger.getLogger(ColumnTag.class).getLevel(); 41 Logger.getLogger(ColumnTag.class).setLevel(Level.OFF); 42 43 try 44 { 45 runner.getResponse(request); 46 } 47 catch (HttpInternalErrorException e) 48 { 49 fail("Should not get any error also if \"foo\" media type is not defined. " + e.getMessage()); 50 } 51 finally 52 { 53 Logger.getLogger(ColumnTag.class).setLevel(previousLevel); 54 } 55 56 58 } 59 60 } | Popular Tags |