mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetModel.java
@Test
    public void testValidateValue()
    {
        UIComponent uic = mock(UIComponent.class);

        AssetModel model = new AssetModel(0, m_Uuid, ASSET_PID, Asset.class.getName(), 
                m_FactoryMgr, m_ConfigWrapper, m_AssetTypesMgr, m_AssetImageInterface);
        
        when(uic.getId()).thenReturn("assetLatLocation");
        validateTestMsg(model, uic, -91D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 91D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 90D);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -90D);

        when(uic.getId()).thenReturn("assetElevationLocation");
        validateTestMsg(model, uic, -91D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 91D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 90D);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -90D);

        when(uic.getId()).thenReturn("assetAltitudeLocation");
        validateTestMsg(model, uic, -10001D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 50001D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -10000);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 50000);

        when(uic.getId()).thenReturn("assetBankLocation");
        validateTestMsg(model, uic, -181D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 181D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -180);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 180);

        when(uic.getId()).thenReturn("assetLongLocation");
        validateTestMsg(model, uic, -181D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 181D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -180);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 180);

        when(uic.getId()).thenReturn("assetHeadingLocation");
        validateTestMsg(model, uic, -1D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 360D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 0);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 359);
    }
/**
     * Validate all directional measurements and their limits.
     */
Validate all directional measurements and their limits.
Validate all directional measurements and their limits .
@Test
    public void testValidateValue()
    {
        UIComponent uic = mock(UIComponent.class);
        AssetModel model = new AssetModel(0, m_Uuid, ASSET_PID, Asset.class.getName(), 
                m_FactoryMgr, m_ConfigWrapper, m_AssetTypesMgr, m_AssetImageInterface);
        when(uic.getId()).thenReturn("assetLatLocation");
        validateTestMsg(model, uic, -91D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 91D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 90D);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -90D);
        when(uic.getId()).thenReturn("assetElevationLocation");
        validateTestMsg(model, uic, -91D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 91D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 90D);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -90D);
        when(uic.getId()).thenReturn("assetAltitudeLocation");
        validateTestMsg(model, uic, -10001D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 50001D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -10000);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 50000);
        when(uic.getId()).thenReturn("assetBankLocation");
        validateTestMsg(model, uic, -181D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 181D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -180);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 180);
        when(uic.getId()).thenReturn("assetLongLocation");
        validateTestMsg(model, uic, -181D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 181D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, -180);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 180);
        when(uic.getId()).thenReturn("assetHeadingLocation");
        validateTestMsg(model, uic, -1D, ValidationEnum.LESS_THAN_MIN.toString());
        validateTestMsg(model, uic, 360D, ValidationEnum.GREATER_THAN_MAX.toString());
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 0);
        model.validateValue(m_FacesUtil.getFacesContext(), uic, 359);
    }
@ Test public void testValidateValue ( ) { UIComponent uic = mock ( UIComponent . class ) ; AssetModel model = new AssetModel ( 0 , m_Uuid , ASSET_PID , Asset . class . getName ( ) , m_FactoryMgr , m_ConfigWrapper , m_AssetTypesMgr , m_AssetImageInterface ) ; when ( uic . getId ( ) ) . thenReturn ( "assetLatLocation" ) ; validateTestMsg ( model , uic , - 91D , ValidationEnum . LESS_THAN_MIN . toString ( ) ) ; validateTestMsg ( model , uic , 91D , ValidationEnum . GREATER_THAN_MAX . toString ( ) ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , 90D ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , - 90D ) ; when ( uic . getId ( ) ) . thenReturn ( "assetElevationLocation" ) ; validateTestMsg ( model , uic , - 91D , ValidationEnum . LESS_THAN_MIN . toString ( ) ) ; validateTestMsg ( model , uic , 91D , ValidationEnum . GREATER_THAN_MAX . toString ( ) ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , 90D ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , - 90D ) ; when ( uic . getId ( ) ) . thenReturn ( "assetAltitudeLocation" ) ; validateTestMsg ( model , uic , - 10001D , ValidationEnum . LESS_THAN_MIN . toString ( ) ) ; validateTestMsg ( model , uic , 50001D , ValidationEnum . GREATER_THAN_MAX . toString ( ) ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , - 10000 ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , 50000 ) ; when ( uic . getId ( ) ) . thenReturn ( "assetBankLocation" ) ; validateTestMsg ( model , uic , - 181D , ValidationEnum . LESS_THAN_MIN . toString ( ) ) ; validateTestMsg ( model , uic , 181D , ValidationEnum . GREATER_THAN_MAX . toString ( ) ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , - 180 ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , 180 ) ; when ( uic . getId ( ) ) . thenReturn ( "assetLongLocation" ) ; validateTestMsg ( model , uic , - 181D , ValidationEnum . LESS_THAN_MIN . toString ( ) ) ; validateTestMsg ( model , uic , 181D , ValidationEnum . GREATER_THAN_MAX . toString ( ) ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , - 180 ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , 180 ) ; when ( uic . getId ( ) ) . thenReturn ( "assetHeadingLocation" ) ; validateTestMsg ( model , uic , - 1D , ValidationEnum . LESS_THAN_MIN . toString ( ) ) ; validateTestMsg ( model , uic , 360D , ValidationEnum . GREATER_THAN_MAX . toString ( ) ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , 0 ) ; model . validateValue ( m_FacesUtil . getFacesContext ( ) , uic , 359 ) ; }
Validate all directional measurements and their limits.
Validate all directional measurements and their limits .