mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/asset/TestAssetImpl.java
@Test
    public void testActivateAssetFail() throws Exception
    {
        doThrow(new AssetException("failed")).when(m_Proxy).onActivate();

        EventAdminSyncer failedActivationSync = new EventAdminSyncer(m_EventAdmin, Asset.TOPIC_ACTIVATION_FAILED);

        m_SUT.activateAsync();

        failedActivationSync.waitFor(5, TimeUnit.SECONDS);
        // make sure properties are set as well
        EventAdminVerifier.assertEventByTopicAsset(m_EventAdmin, Asset.TOPIC_ACTIVATION_FAILED, m_SUT);

        assertThat(m_SUT.getActiveStatus(), is(AssetActiveStatus.DEACTIVATED));
    }
/**
     * Verify exception handled from proxy when activating. Verify event if activation fails.
     */
Verify exception handled from proxy when activating. Verify event if activation fails.
Verify exception handled from proxy when activating . Verify event if activation fails .
@Test
    public void testActivateAssetFail() throws Exception
    {
        doThrow(new AssetException("failed")).when(m_Proxy).onActivate();
        EventAdminSyncer failedActivationSync = new EventAdminSyncer(m_EventAdmin, Asset.TOPIC_ACTIVATION_FAILED);
        m_SUT.activateAsync();
        failedActivationSync.waitFor(5, TimeUnit.SECONDS);
        EventAdminVerifier.assertEventByTopicAsset(m_EventAdmin, Asset.TOPIC_ACTIVATION_FAILED, m_SUT);
        assertThat(m_SUT.getActiveStatus(), is(AssetActiveStatus.DEACTIVATED));
    }
@ Test public void testActivateAssetFail ( ) throws Exception { doThrow ( new AssetException ( "failed" ) ) . when ( m_Proxy ) . onActivate ( ) ; EventAdminSyncer failedActivationSync = new EventAdminSyncer ( m_EventAdmin , Asset . TOPIC_ACTIVATION_FAILED ) ; m_SUT . activateAsync ( ) ; failedActivationSync . waitFor ( 5 , TimeUnit . SECONDS ) ; EventAdminVerifier . assertEventByTopicAsset ( m_EventAdmin , Asset . TOPIC_ACTIVATION_FAILED , m_SUT ) ; assertThat ( m_SUT . getActiveStatus ( ) , is ( AssetActiveStatus . DEACTIVATED ) ) ; }
Verify exception handled from proxy when activating.
Verify exception handled from proxy when activating .
// make sure properties are set as well