mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestAddressManagerServiceImpl.java
@Test
    public void testGetAddressDescriptiveStrings() throws IllegalArgumentException, IllegalStateException, IOException,
        ConfigurationException, FactoryException, AssetException, CCommException
    {
        // No exception thrown on empty list, and that list is empty
        List<String> emptyList  = m_SUT.getAddressDescriptiveStrings();
        assertThat(emptyList.size(), is(0));
        
        Address address1= m_SUT.getOrCreateAddress("Base:abc");
        
        // Now try and get the address
        List<String> oneElementList = m_SUT.getAddressDescriptiveStrings();
        assertThat(oneElementList.size(), is(1));
        
        // Now let's delete the address
        m_Registry.delete((FactoryObjectInternal)address1);
        List<String> alsoEmpty  = m_SUT.getAddressDescriptiveStrings();
        assertThat(alsoEmpty.size(), is(0));       
    }
/**
     * This test ensures that the behavior of getAddressDescriptiveStrings is working as intended.
     * Specifically, that means:
     * - No exception thrown, only an empty list returned, when no addresses have been registered;
     * - Added addresses are correctly returned;
     * - Removed addresses are correctly ... no longer returned.
     */
This test ensures that the behavior of getAddressDescriptiveStrings is working as intended.
Specifically, that means:
- No exception thrown, only an empty list returned, when no addresses have been registered;
- Added addresses are correctly returned;
- Removed addresses are correctly ... no longer returned.
This test ensures that the behavior of getAddressDescriptiveStrings is working as intended . Specifically that means : - No exception thrown only an empty list returned when no addresses have been registered ; - Added addresses are correctly returned ; - Removed addresses are correctly ... no longer returned .
@Test
    public void testGetAddressDescriptiveStrings() throws IllegalArgumentException, IllegalStateException, IOException,
        ConfigurationException, FactoryException, AssetException, CCommException
    {
        List<String> emptyList  = m_SUT.getAddressDescriptiveStrings();
        assertThat(emptyList.size(), is(0));
        Address address1= m_SUT.getOrCreateAddress("Base:abc");
        List<String> oneElementList = m_SUT.getAddressDescriptiveStrings();
        assertThat(oneElementList.size(), is(1));
        m_Registry.delete((FactoryObjectInternal)address1);
        List<String> alsoEmpty  = m_SUT.getAddressDescriptiveStrings();
        assertThat(alsoEmpty.size(), is(0));       
    }
@ Test public void testGetAddressDescriptiveStrings ( ) throws IllegalArgumentException , IllegalStateException , IOException , ConfigurationException , FactoryException , AssetException , CCommException { List < String > emptyList = m_SUT . getAddressDescriptiveStrings ( ) ; assertThat ( emptyList . size ( ) , is ( 0 ) ) ; Address address1 = m_SUT . getOrCreateAddress ( "Base:abc" ) ; List < String > oneElementList = m_SUT . getAddressDescriptiveStrings ( ) ; assertThat ( oneElementList . size ( ) , is ( 1 ) ) ; m_Registry . delete ( ( FactoryObjectInternal ) address1 ) ; List < String > alsoEmpty = m_SUT . getAddressDescriptiveStrings ( ) ; assertThat ( alsoEmpty . size ( ) , is ( 0 ) ) ; }
This test ensures that the behavior of getAddressDescriptiveStrings is working as intended.
This test ensures that the behavior of getAddressDescriptiveStrings is working as intended .
// No exception thrown on empty list, and that list is empty // Now try and get the address // Now let's delete the address