1 20 package org.apache.cactus.sample.servlet.unit; 21 22 import org.apache.cactus.ServletTestCase; 23 import org.apache.cactus.WebResponse; 24 25 31 public class TestSetUpTearDown extends ServletTestCase 32 { 33 37 protected void setUp() 38 { 39 session.setAttribute("setUpFlag", "a setUp test flag"); 40 } 41 42 46 public void testSetUp() 47 { 48 assertEquals("a setUp test flag", session.getAttribute("setUpFlag")); 49 } 50 51 53 57 protected void tearDown() 58 { 59 response.setHeader("Teardownheader", "tear down header"); 60 } 61 62 66 public void testTearDown() 67 { 68 } 69 70 78 public void endTearDown(WebResponse theResponse) 79 { 80 assertEquals("tear down header", 81 theResponse.getConnection().getHeaderField("Teardownheader")); 82 } 83 } 84 | Popular Tags |