1 17 18 package org.apache.avalon.fortress.util.test; 19 20 import junit.framework.Assert; 21 22 28 public class TestComponent extends Assert 29 { 30 private boolean m_isCreated; 31 private boolean m_isDestroyed; 32 private boolean m_isAccessed; 33 private boolean m_isReleased; 34 35 public void create() 36 { 37 assertTrue( !m_isCreated); 38 assertTrue( !m_isAccessed ); 39 assertTrue( !m_isReleased ); 40 assertTrue( !m_isDestroyed ); 41 m_isCreated = true; 42 assertTrue(m_isCreated); 43 } 44 45 public void access() 46 { 47 assertTrue( m_isCreated ); 48 assertTrue( !m_isAccessed ); 49 assertTrue( !m_isReleased ); 50 assertTrue( !m_isDestroyed ); 51 m_isAccessed = true; 52 assertTrue( m_isAccessed ); 53 } 54 55 public void release() 56 { 57 assertTrue( m_isCreated ); 58 assertTrue( m_isAccessed ); 59 assertTrue( !m_isReleased ); 60 assertTrue( !m_isDestroyed ); 61 m_isReleased = true; 62 assertTrue( m_isReleased ); 63 } 64 65 public void destroy() 66 { 67 assertTrue( m_isCreated ); 68 assertTrue( m_isAccessed ); 69 assertTrue( m_isReleased ); 70 assertTrue( !m_isDestroyed ); 71 m_isDestroyed = true; 72 assertTrue(m_isDestroyed); 73 } 74 } 75 | Popular Tags |