1 8 package org.apache.avalon.excalibur.naming.memory.test; 9 10 import java.util.Hashtable ; 11 import javax.naming.Context ; 12 import org.apache.avalon.excalibur.naming.memory.MemoryInitialContextFactory; 13 import org.apache.avalon.excalibur.naming.test.AbstractContextTestCase; 14 15 21 public class MemoryContextTestCase extends AbstractContextTestCase 22 { 23 private int m_id = 0; 24 private Context m_rootContext; 25 26 public MemoryContextTestCase( String name ) 27 { 28 super( name ); 29 } 30 31 protected void setUp() 32 { 33 try 34 { 35 final MemoryInitialContextFactory factory = new MemoryInitialContextFactory(); 36 m_rootContext = factory.getInitialContext( new Hashtable () ); 37 m_context = m_rootContext.createSubcontext( "test" + m_id++ ); 38 } 39 catch (Exception e) 40 {} 41 } 42 43 protected void tearDown() 44 { 45 try 46 { 47 m_context.close(); 48 m_context = null; 49 m_rootContext.close(); 50 } 51 catch (Exception e) 52 {} 53 } 54 } 55 | Popular Tags |