1 16 17 package org.springframework.web.util; 18 19 import javax.servlet.jsp.PageContext ; 20 21 import junit.framework.TestCase; 22 23 26 public class TagUtilsTests extends TestCase { 27 28 public void testTagUtils() { 29 32 assertEquals(TagUtils.SCOPE_PAGE, "page"); 33 assertEquals(TagUtils.SCOPE_APPLICATION, "application"); 34 assertEquals(TagUtils.SCOPE_SESSION, "session"); 35 assertEquals(TagUtils.SCOPE_REQUEST, "request"); 36 37 assertEquals(TagUtils.getScope("page"), PageContext.PAGE_SCOPE); 38 assertEquals(TagUtils.getScope("request"), PageContext.REQUEST_SCOPE); 39 assertEquals(TagUtils.getScope("session"), PageContext.SESSION_SCOPE); 40 assertEquals(TagUtils.getScope("application"), PageContext.APPLICATION_SCOPE); 41 assertEquals(TagUtils.getScope("bla"), PageContext.PAGE_SCOPE); 42 43 try { 44 TagUtils.getScope(null); 45 fail("Null scope, no excpetion thrown!"); 46 } 47 catch (IllegalArgumentException e) { 48 } 50 } 51 52 } 53 | Popular Tags |