mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestAddressManagerServiceImpl.java
@Test
    public void testInvalidAddressDescription() throws CCommException
    {
        try
        {
            m_SUT.getOrCreateAddress(null);
            fail("Expecting exception as address is null");
        }
        catch (NullPointerException e)
        {
            verify(m_WakeLock, never()).activate();
        }
        
        try
        {
            m_SUT.getOrCreateAddress("no-colon-so-no-prefix");
            fail("Expecting exception as address is missing colon");
        }
        catch (IllegalArgumentException e)
        {
            verify(m_WakeLock, never()).activate();
        }
        
        try
        {
            m_SUT.getOrCreateAddress("prefix-only:");
            fail("Expecting exception as address is missing suffix");
        }
        catch (IllegalArgumentException e)
        {
            verify(m_WakeLock, never()).activate();
        }
    }
/**
     * Verify invalid input causes an exception.
     */
Verify invalid input causes an exception.
Verify invalid input causes an exception .
@Test
    public void testInvalidAddressDescription() throws CCommException
    {
        try
        {
            m_SUT.getOrCreateAddress(null);
            fail("Expecting exception as address is null");
        }
        catch (NullPointerException e)
        {
            verify(m_WakeLock, never()).activate();
        }
        try
        {
            m_SUT.getOrCreateAddress("no-colon-so-no-prefix");
            fail("Expecting exception as address is missing colon");
        }
        catch (IllegalArgumentException e)
        {
            verify(m_WakeLock, never()).activate();
        }
        try
        {
            m_SUT.getOrCreateAddress("prefix-only:");
            fail("Expecting exception as address is missing suffix");
        }
        catch (IllegalArgumentException e)
        {
            verify(m_WakeLock, never()).activate();
        }
    }
@ Test public void testInvalidAddressDescription ( ) throws CCommException { try { m_SUT . getOrCreateAddress ( null ) ; fail ( "Expecting exception as address is null" ) ; } catch ( NullPointerException e ) { verify ( m_WakeLock , never ( ) ) . activate ( ) ; } try { m_SUT . getOrCreateAddress ( "no-colon-so-no-prefix" ) ; fail ( "Expecting exception as address is missing colon" ) ; } catch ( IllegalArgumentException e ) { verify ( m_WakeLock , never ( ) ) . activate ( ) ; } try { m_SUT . getOrCreateAddress ( "prefix-only:" ) ; fail ( "Expecting exception as address is missing suffix" ) ; } catch ( IllegalArgumentException e ) { verify ( m_WakeLock , never ( ) ) . activate ( ) ; } }
Verify invalid input causes an exception.
Verify invalid input causes an exception .