mil.dod.th.ose.shell/test/mil/dod/th/ose/shell/TestPowerManagerCommands.java
@Test
    public void testInfoPPMNotEnabled() throws IOException
    {
        Dictionary<String, Object> dict = new Hashtable<>();
        dict.put(PlatformPowerManager.CONFIG_PROP_ENABLED, false);
        when(m_Configuration.getProperties()).thenReturn(dict);
        
        m_SUT.setPlatformPowerManager(null);
        
        when(m_PlatformPowerManager.getBatteryAmpHoursRem()).thenReturn(10);
        when(m_PlatformPowerManager.getBatteryVoltage()).thenReturn(20);
        
        m_SUT.info(m_Session);
        
        verify(m_PrintStream).format("Overall PlatformPowerManager status: %s%n%n\t"
                + "Enabled: %s%n\tPlatformPowerManager Present: %s%n%n", "Disabled", "false", "No");
        
        verify(m_PrintStream).format("Battery Remaining: %s%n%n", "N/A");
        verify(m_PrintStream).format("Battery Voltage: %s%n%n", "N/A");
    }
/**
     * Verify that the info message is correctly printed based on PPM not being present.
     */
Verify that the info message is correctly printed based on PPM not being present.
Verify that the info message is correctly printed based on PPM not being present .
@Test
    public void testInfoPPMNotEnabled() throws IOException
    {
        Dictionary<String, Object> dict = new Hashtable<>();
        dict.put(PlatformPowerManager.CONFIG_PROP_ENABLED, false);
        when(m_Configuration.getProperties()).thenReturn(dict);
        m_SUT.setPlatformPowerManager(null);
        when(m_PlatformPowerManager.getBatteryAmpHoursRem()).thenReturn(10);
        when(m_PlatformPowerManager.getBatteryVoltage()).thenReturn(20);
        m_SUT.info(m_Session);
        verify(m_PrintStream).format("Overall PlatformPowerManager status: %s%n%n\t"
                + "Enabled: %s%n\tPlatformPowerManager Present: %s%n%n", "Disabled", "false", "No");
        verify(m_PrintStream).format("Battery Remaining: %s%n%n", "N/A");
        verify(m_PrintStream).format("Battery Voltage: %s%n%n", "N/A");
    }
@ Test public void testInfoPPMNotEnabled ( ) throws IOException { Dictionary < String , Object > dict = new Hashtable < > ( ) ; dict . put ( PlatformPowerManager . CONFIG_PROP_ENABLED , false ) ; when ( m_Configuration . getProperties ( ) ) . thenReturn ( dict ) ; m_SUT . setPlatformPowerManager ( null ) ; when ( m_PlatformPowerManager . getBatteryAmpHoursRem ( ) ) . thenReturn ( 10 ) ; when ( m_PlatformPowerManager . getBatteryVoltage ( ) ) . thenReturn ( 20 ) ; m_SUT . info ( m_Session ) ; verify ( m_PrintStream ) . format ( "Overall PlatformPowerManager status: %s%n%n\t" + "Enabled: %s%n\tPlatformPowerManager Present: %s%n%n" , "Disabled" , "false" , "No" ) ; verify ( m_PrintStream ) . format ( "Battery Remaining: %s%n%n" , "N/A" ) ; verify ( m_PrintStream ) . format ( "Battery Voltage: %s%n%n" , "N/A" ) ; }
Verify that the info message is correctly printed based on PPM not being present.
Verify that the info message is correctly printed based on PPM not being present .