mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetTypesMgrImpl.java
@Test
    public void testGetAssetTypes()
    {
        //Verify that there is no data initially returned for systemId1. Later verify a message was sent to retrieve
        //the asset types from the controller.
        assertThat(m_SUT.getAssetFactoriesForControllerAsync(systemId1).size(), is(0));
        
        //load assets for system id
        Event getTypes = mockMessageGetAssetTypesResponse(systemId1);
        
        //this should render two asset types for the system id
        m_AssetHelper.handleEvent(getTypes);

        //verify
        assertThat(m_SUT.getAssetFactoriesForControllerAsync(systemId1).size(), is(2));
        
        //collect all the names
        Set<String> types = new HashSet<String>();
        for (AssetFactoryModel model : m_SUT.getAssetFactoriesForControllerAsync(systemId1))
        {
            types.add(model.getFullyQualifiedAssetType());
        }
        //verify the FQCNs were found
        assertThat(types, hasItem("super.awesome.OutOfThisWorld"));
        assertThat(types, hasItem("sometimes.youfeellikeanut.SometimesYouDont"));
        
        //Verify that a message was sent out retrieve asset types.
        verify(m_MessageFactory).createAssetDirectoryServiceMessage(
                AssetDirectoryServiceMessageType.GetAssetTypesRequest, null);
        verify(m_MessageWrapper).queue(systemId1, null);
    }
/**
     * Test the handling of the get asset types.
     * Verify that the product types are correctly added.
     */
Test the handling of the get asset types.
Verify that the product types are correctly added.
Test the handling of the get asset types . Verify that the product types are correctly added .
@Test
    public void testGetAssetTypes()
    {
        assertThat(m_SUT.getAssetFactoriesForControllerAsync(systemId1).size(), is(0));
        Event getTypes = mockMessageGetAssetTypesResponse(systemId1);
        m_AssetHelper.handleEvent(getTypes);
        assertThat(m_SUT.getAssetFactoriesForControllerAsync(systemId1).size(), is(2));
        Set<String> types = new HashSet<String>();
        for (AssetFactoryModel model : m_SUT.getAssetFactoriesForControllerAsync(systemId1))
        {
            types.add(model.getFullyQualifiedAssetType());
        }
         the FQCNs were found
        assertThat(types, hasItem("super.awesome.OutOfThisWorld"));
        assertThat(types, hasItem("sometimes.youfeellikeanut.SometimesYouDont"));
        verify(m_MessageFactory).createAssetDirectoryServiceMessage(
                AssetDirectoryServiceMessageType.GetAssetTypesRequest, null);
        verify(m_MessageWrapper).queue(systemId1, null);
    }
@ Test public void testGetAssetTypes ( ) { assertThat ( m_SUT . getAssetFactoriesForControllerAsync ( systemId1 ) . size ( ) , is ( 0 ) ) ; Event getTypes = mockMessageGetAssetTypesResponse ( systemId1 ) ; m_AssetHelper . handleEvent ( getTypes ) ; assertThat ( m_SUT . getAssetFactoriesForControllerAsync ( systemId1 ) . size ( ) , is ( 2 ) ) ; Set < String > types = new HashSet < String > ( ) ; for ( AssetFactoryModel model : m_SUT . getAssetFactoriesForControllerAsync ( systemId1 ) ) { types . add ( model . getFullyQualifiedAssetType ( ) ) ; } assertThat ( types , hasItem ( "super.awesome.OutOfThisWorld" ) ) ; assertThat ( types , hasItem ( "sometimes.youfeellikeanut.SometimesYouDont" ) ) ; verify ( m_MessageFactory ) . createAssetDirectoryServiceMessage ( AssetDirectoryServiceMessageType . GetAssetTypesRequest , null ) ; verify ( m_MessageWrapper ) . queue ( systemId1 , null ) ; }
Test the handling of the get asset types.
Test the handling of the get asset types .
//Verify that there is no data initially returned for systemId1. Later verify a message was sent to retrieve //the asset types from the controller. //load assets for system id //this should render two asset types for the system id //verify //collect all the names //verify the FQCNs were found //Verify that a message was sent out retrieve asset types.