mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestAddressManagerServiceImpl.java
@Test
    public void testFlush() throws Exception
    {
        // Create addresses to flush
        Address addr1 = m_SUT.getOrCreateAddress("Base:addr1");
        Address addr2 = m_SUT.getOrCreateAddress("Base:addr2");
        Address addr3 = m_SUT.getOrCreateAddress("Base:addr3");
        Address addr4 = m_SUT.getOrCreateAddress("Base:addr4");
        Address addr5 = m_SUT.getOrCreateAddress("Base:addr5");

        doThrow(new IllegalStateException()).when(addr3).delete();
        
        m_SUT.flush();
        
        verify(addr1).delete();
        verify(addr2).delete();
        verify(addr3).delete();
        verify(addr4).delete();
        verify(addr5).delete();
    }
/**
     * Verify that flush will remove all addresses (even if one throws an exception).
     */
Verify that flush will remove all addresses (even if one throws an exception).
Verify that flush will remove all addresses ( even if one throws an exception ) .
@Test
    public void testFlush() throws Exception
    {
        Address addr1 = m_SUT.getOrCreateAddress("Base:addr1");
        Address addr2 = m_SUT.getOrCreateAddress("Base:addr2");
        Address addr3 = m_SUT.getOrCreateAddress("Base:addr3");
        Address addr4 = m_SUT.getOrCreateAddress("Base:addr4");
        Address addr5 = m_SUT.getOrCreateAddress("Base:addr5");
        doThrow(new IllegalStateException()).when(addr3).delete();
        m_SUT.flush();
        verify(addr1).delete();
        verify(addr2).delete();
        verify(addr3).delete();
        verify(addr4).delete();
        verify(addr5).delete();
    }
@ Test public void testFlush ( ) throws Exception { Address addr1 = m_SUT . getOrCreateAddress ( "Base:addr1" ) ; Address addr2 = m_SUT . getOrCreateAddress ( "Base:addr2" ) ; Address addr3 = m_SUT . getOrCreateAddress ( "Base:addr3" ) ; Address addr4 = m_SUT . getOrCreateAddress ( "Base:addr4" ) ; Address addr5 = m_SUT . getOrCreateAddress ( "Base:addr5" ) ; doThrow ( new IllegalStateException ( ) ) . when ( addr3 ) . delete ( ) ; m_SUT . flush ( ) ; verify ( addr1 ) . delete ( ) ; verify ( addr2 ) . delete ( ) ; verify ( addr3 ) . delete ( ) ; verify ( addr4 ) . delete ( ) ; verify ( addr5 ) . delete ( ) ; }
Verify that flush will remove all addresses (even if one throws an exception).
Verify that flush will remove all addresses ( even if one throws an exception ) .
// Create addresses to flush