mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/asset/TestAssetDirectoryServiceImpl.java
@SuppressWarnings({"unchecked"})
    @Test
    public void testCreateAssetException() throws AssetException, FactoryException, 
        IllegalArgumentException, FactoryObjectInformationException, ClassNotFoundException
    {
        when(m_Registry.createNewObject(eq(m_AssetFactory), Mockito.any(String.class), 
                Mockito.any(Map.class))).thenThrow(new IllegalArgumentException("test error"));
        
        try
        {
            m_SUT.createAsset(PRODUCT_TYPE);
            fail("Expected exception from createAsset");
        }
        catch (AssetException e)
        {
        }

        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
    }
/**
     * Test handling of exception when trying to create an asset.
     */
Test handling of exception when trying to create an asset.
Test handling of exception when trying to create an asset .
@SuppressWarnings({"unchecked"})
    @Test
    public void testCreateAssetException() throws AssetException, FactoryException, 
        IllegalArgumentException, FactoryObjectInformationException, ClassNotFoundException
    {
        when(m_Registry.createNewObject(eq(m_AssetFactory), Mockito.any(String.class), 
                Mockito.any(Map.class))).thenThrow(new IllegalArgumentException("test error"));
        try
        {
            m_SUT.createAsset(PRODUCT_TYPE);
            fail("Expected exception from createAsset");
        }
        catch (AssetException e)
        {
        }
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
    }
@ SuppressWarnings ( { "unchecked" } ) @ Test public void testCreateAssetException ( ) throws AssetException , FactoryException , IllegalArgumentException , FactoryObjectInformationException , ClassNotFoundException { when ( m_Registry . createNewObject ( eq ( m_AssetFactory ) , Mockito . any ( String . class ) , Mockito . any ( Map . class ) ) ) . thenThrow ( new IllegalArgumentException ( "test error" ) ) ; try { m_SUT . createAsset ( PRODUCT_TYPE ) ; fail ( "Expected exception from createAsset" ) ; } catch ( AssetException e ) { } verify ( m_WakeLock ) . activate ( ) ; verify ( m_WakeLock ) . cancel ( ) ; }
Test handling of exception when trying to create an asset.
Test handling of exception when trying to create an asset .