mil.dod.th.ose.shell/test/mil/dod/th/ose/shell/TestPowerManagerCommands.java
@Test
    public void testGetWakeLock()
    {
        Set<WakeLock> locks = getMockedWakeLocks(WakeLockState.Any);
        when(m_PowerManager.getWakeLocks(ActiveContextClass.class, WakeLockState.Any)).thenReturn(locks);
        Set<WakeLock> returnedLocks = m_SUT.getWakeLocksByContext(m_Session,
                ActiveContextClass.class.getName(), "activeLock1");
        verify(m_PowerManager).getWakeLocks(ActiveContextClass.class, WakeLockState.Any);
        
        assertThat(returnedLocks, notNullValue());
        assertThat(returnedLocks.size(), is(1));
        
        Object[] array = returnedLocks.toArray();
        WakeLock lock = (WakeLock)array[0];
        assertThat(lock.getId(), is("activeLock1"));
        verify(m_PrintStream, never()).format(anyString(), anyVararg());
    }
/**
     * Verify that the correct wake lock is returned.
     */
Verify that the correct wake lock is returned.
Verify that the correct wake lock is returned .
@Test
    public void testGetWakeLock()
    {
        Set<WakeLock> locks = getMockedWakeLocks(WakeLockState.Any);
        when(m_PowerManager.getWakeLocks(ActiveContextClass.class, WakeLockState.Any)).thenReturn(locks);
        Set<WakeLock> returnedLocks = m_SUT.getWakeLocksByContext(m_Session,
                ActiveContextClass.class.getName(), "activeLock1");
        verify(m_PowerManager).getWakeLocks(ActiveContextClass.class, WakeLockState.Any);
        assertThat(returnedLocks, notNullValue());
        assertThat(returnedLocks.size(), is(1));
        Object[] array = returnedLocks.toArray();
        WakeLock lock = (WakeLock)array[0];
        assertThat(lock.getId(), is("activeLock1"));
        verify(m_PrintStream, never()).format(anyString(), anyVararg());
    }
@ Test public void testGetWakeLock ( ) { Set < WakeLock > locks = getMockedWakeLocks ( WakeLockState . Any ) ; when ( m_PowerManager . getWakeLocks ( ActiveContextClass . class , WakeLockState . Any ) ) . thenReturn ( locks ) ; Set < WakeLock > returnedLocks = m_SUT . getWakeLocksByContext ( m_Session , ActiveContextClass . class . getName ( ) , "activeLock1" ) ; verify ( m_PowerManager ) . getWakeLocks ( ActiveContextClass . class , WakeLockState . Any ) ; assertThat ( returnedLocks , notNullValue ( ) ) ; assertThat ( returnedLocks . size ( ) , is ( 1 ) ) ; Object [ ] array = returnedLocks . toArray ( ) ; WakeLock lock = ( WakeLock ) array [ 0 ] ; assertThat ( lock . getId ( ) , is ( "activeLock1" ) ) ; verify ( m_PrintStream , never ( ) ) . format ( anyString ( ) , anyVararg ( ) ) ; }
Verify that the correct wake lock is returned.
Verify that the correct wake lock is returned .