mil.dod.th.ose.utils/test/mil/dod/th/ose/utils/impl/TestPropertyRetrieverImpl.java
@Test
    public void testGetPropertyFromFile() throws Exception
    {
        String fileDir = "dir";
        String fileName = "test.properties";
        File mockedFile = mock(File.class);
        FileInputStream inputStream = mock(FileInputStream.class);
        
        PowerMockito.whenNew(File.class).withArguments(fileDir, fileName).thenReturn(mockedFile);
        PowerMockito.whenNew(FileInputStream.class).withArguments(mockedFile).thenReturn(inputStream);
        
        Properties props = m_SUT.getPropertiesFromFile(fileDir, fileName);
        
        assertThat(props, is(notNullValue()));
        
        verify(inputStream).close();
    }
/**
     * Test that for a given file directory and file name a valid properties object is returned.
     */
Test that for a given file directory and file name a valid properties object is returned.
Test that for a given file directory and file name a valid properties object is returned .
@Test
    public void testGetPropertyFromFile() throws Exception
    {
        String fileDir = "dir";
        String fileName = "test.properties";
        File mockedFile = mock(File.class);
        FileInputStream inputStream = mock(FileInputStream.class);
        PowerMockito.whenNew(File.class).withArguments(fileDir, fileName).thenReturn(mockedFile);
        PowerMockito.whenNew(FileInputStream.class).withArguments(mockedFile).thenReturn(inputStream);
        Properties props = m_SUT.getPropertiesFromFile(fileDir, fileName);
        assertThat(props, is(notNullValue()));
        verify(inputStream).close();
    }
@ Test public void testGetPropertyFromFile ( ) throws Exception { String fileDir = "dir" ; String fileName = "test.properties" ; File mockedFile = mock ( File . class ) ; FileInputStream inputStream = mock ( FileInputStream . class ) ; PowerMockito . whenNew ( File . class ) . withArguments ( fileDir , fileName ) . thenReturn ( mockedFile ) ; PowerMockito . whenNew ( FileInputStream . class ) . withArguments ( mockedFile ) . thenReturn ( inputStream ) ; Properties props = m_SUT . getPropertiesFromFile ( fileDir , fileName ) ; assertThat ( props , is ( notNullValue ( ) ) ) ; verify ( inputStream ) . close ( ) ; }
Test that for a given file directory and file name a valid properties object is returned.
Test that for a given file directory and file name a valid properties object is returned .