mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestAddCommsDialogHelperImpl.java
@Test
    public void testValidateValue()
    {
        FacesContext context = mock(FacesContext.class);
        UIComponent component = mock(UIComponent.class);        
        Object value = -8675309;
        
        try
        {            
            m_SUT.validatePositiveTimeout(context, component, value);
            fail("Validation exception should be thrown.");
        }
        catch (ValidatorException exception)
        {
            assertThat(exception.getFacesMessage().getDetail(), is("Timeout value must be a positive integer."));
        }
        
        try
        {    
            value = 555;
            m_SUT.validatePositiveTimeout(context, component, value);   
        }
        catch (ValidatorException exception)
        {
            fail("Validation exception should not have been thrown.");
        }
    }
/**
     * Test the validate value method.
     * Verify that method takes the appropriate action depending on whether value is valid or not.
     */
Test the validate value method.
Verify that method takes the appropriate action depending on whether value is valid or not.
Test the validate value method . Verify that method takes the appropriate action depending on whether value is valid or not .
@Test
    public void testValidateValue()
    {
        FacesContext context = mock(FacesContext.class);
        UIComponent component = mock(UIComponent.class);        
        Object value = -8675309;
        try
        {            
            m_SUT.validatePositiveTimeout(context, component, value);
            fail("Validation exception should be thrown.");
        }
        catch (ValidatorException exception)
        {
            assertThat(exception.getFacesMessage().getDetail(), is("Timeout value must be a positive integer."));
        }
        try
        {    
            value = 555;
            m_SUT.validatePositiveTimeout(context, component, value);   
        }
        catch (ValidatorException exception)
        {
            fail("Validation exception should not have been thrown.");
        }
    }
@ Test public void testValidateValue ( ) { FacesContext context = mock ( FacesContext . class ) ; UIComponent component = mock ( UIComponent . class ) ; Object value = - 8675309 ; try { m_SUT . validatePositiveTimeout ( context , component , value ) ; fail ( "Validation exception should be thrown." ) ; } catch ( ValidatorException exception ) { assertThat ( exception . getFacesMessage ( ) . getDetail ( ) , is ( "Timeout value must be a positive integer." ) ) ; } try { value = 555 ; m_SUT . validatePositiveTimeout ( context , component , value ) ; } catch ( ValidatorException exception ) { fail ( "Validation exception should not have been thrown." ) ; } }
Test the validate value method.
Test the validate value method .