mil.dod.th.ose.controller/test/mil/dod/th/ose/controller/impl/TestTerraHarvestControllerImpl.java
@Test
    public void testLoadPropertiesInvalidValues() throws Exception
    {
        m_FileInputStream = FileInputStreamMocker.mockIt(
                "id=blah \n operation.mode=invalid");
        when(m_FileService.createFileInputStream(Mockito.any(File.class))).thenReturn(m_FileInputStream);
        
        m_SUT.activate(m_Context);
        
        assertThat(m_SUT.getName(), is("<undefined>"));
        assertThat(m_SUT.getOperationMode(), is(OperationMode.TEST_MODE));
        assertThat(m_SUT.getId(), is(-1));
    }
/**
     * Make sure that invalid values in file are set to defaults and that activation doesn't fail.
     */
Make sure that invalid values in file are set to defaults and that activation doesn't fail.
Make sure that invalid values in file are set to defaults and that activation doesn ' t fail .
@Test
    public void testLoadPropertiesInvalidValues() throws Exception
    {
        m_FileInputStream = FileInputStreamMocker.mockIt(
                "id=blah \n operation.mode=invalid");
        when(m_FileService.createFileInputStream(Mockito.any(File.class))).thenReturn(m_FileInputStream);
        m_SUT.activate(m_Context);
        assertThat(m_SUT.getName(), is("<undefined>"));
        assertThat(m_SUT.getOperationMode(), is(OperationMode.TEST_MODE));
        assertThat(m_SUT.getId(), is(-1));
    }
@ Test public void testLoadPropertiesInvalidValues ( ) throws Exception { m_FileInputStream = FileInputStreamMocker . mockIt ( "id=blah \n operation.mode=invalid" ) ; when ( m_FileService . createFileInputStream ( Mockito . any ( File . class ) ) ) . thenReturn ( m_FileInputStream ) ; m_SUT . activate ( m_Context ) ; assertThat ( m_SUT . getName ( ) , is ( "<undefined>" ) ) ; assertThat ( m_SUT . getOperationMode ( ) , is ( OperationMode . TEST_MODE ) ) ; assertThat ( m_SUT . getId ( ) , is ( - 1 ) ) ; }
Make sure that invalid values in file are set to defaults and that activation doesn't fail.
Make sure that invalid values in file are set to defaults and that activation doesn ' t fail .