mil.dod.th.ose.archiver.vlc/test/mil/dod/th/ose/archiver/vlc/TestVlcArchiver.java
@Test
    public void testStopMultipleProcess() throws ArchiverException
    {
        m_SUT.activate();
        assertThat(m_SUT.getActiveProcessIds(), is(Matchers.<String>empty()));
        
        m_SUT.start(m_ProcessId1, m_SourceStream, m_OutFilePath);
        m_SUT.start(m_ProcessId2, m_SourceStream, m_OutFilePath);
        
        verify(m_MediaPlayer, times(2)).addMediaPlayerEventListener(Mockito.any(MediaPlayerEventListener.class));
        verify(m_MediaPlayer, times(2)).playMedia(anyString(), (String)anyVararg());
        assertThat(m_SUT.getActiveProcessIds(), hasItems(m_ProcessId1, m_ProcessId2));
        
        //Stop the archiver process
        m_SUT.stop(m_ProcessId1);

        verify(m_WakeLock, never()).cancel();
        assertThat(m_SUT.getActiveProcessIds(), not(hasItem(m_ProcessId1)));

        //Stop the archiver process
        m_SUT.stop(m_ProcessId2);

        verify(m_WakeLock).cancel();
        assertThat(m_SUT.getActiveProcessIds(), not(hasItem(m_ProcessId2)));
    }
/**
     * Verify that multiple archiving processes can be started and subsequently stopped.
     * 
     * @throws ArchiverException
     *      if the archiver instance produces an error
     */
Verify that multiple archiving processes can be started and subsequently stopped.

@throws ArchiverException
if the archiver instance produces an error
Verify that multiple archiving processes can be started and subsequently stopped . @throws ArchiverException if the archiver instance produces an error
@Test
    public void testStopMultipleProcess() throws ArchiverException
    {
        m_SUT.activate();
        assertThat(m_SUT.getActiveProcessIds(), is(Matchers.<String>empty()));
        m_SUT.start(m_ProcessId1, m_SourceStream, m_OutFilePath);
        m_SUT.start(m_ProcessId2, m_SourceStream, m_OutFilePath);
        verify(m_MediaPlayer, times(2)).addMediaPlayerEventListener(Mockito.any(MediaPlayerEventListener.class));
        verify(m_MediaPlayer, times(2)).playMedia(anyString(), (String)anyVararg());
        assertThat(m_SUT.getActiveProcessIds(), hasItems(m_ProcessId1, m_ProcessId2));
        m_SUT.stop(m_ProcessId1);
        verify(m_WakeLock, never()).cancel();
        assertThat(m_SUT.getActiveProcessIds(), not(hasItem(m_ProcessId1)));
        m_SUT.stop(m_ProcessId2);
        verify(m_WakeLock).cancel();
        assertThat(m_SUT.getActiveProcessIds(), not(hasItem(m_ProcessId2)));
    }
@ Test public void testStopMultipleProcess ( ) throws ArchiverException { m_SUT . activate ( ) ; assertThat ( m_SUT . getActiveProcessIds ( ) , is ( Matchers . < String > empty ( ) ) ) ; m_SUT . start ( m_ProcessId1 , m_SourceStream , m_OutFilePath ) ; m_SUT . start ( m_ProcessId2 , m_SourceStream , m_OutFilePath ) ; verify ( m_MediaPlayer , times ( 2 ) ) . addMediaPlayerEventListener ( Mockito . any ( MediaPlayerEventListener . class ) ) ; verify ( m_MediaPlayer , times ( 2 ) ) . playMedia ( anyString ( ) , ( String ) anyVararg ( ) ) ; assertThat ( m_SUT . getActiveProcessIds ( ) , hasItems ( m_ProcessId1 , m_ProcessId2 ) ) ; m_SUT . stop ( m_ProcessId1 ) ; verify ( m_WakeLock , never ( ) ) . cancel ( ) ; assertThat ( m_SUT . getActiveProcessIds ( ) , not ( hasItem ( m_ProcessId1 ) ) ) ; m_SUT . stop ( m_ProcessId2 ) ; verify ( m_WakeLock ) . cancel ( ) ; assertThat ( m_SUT . getActiveProcessIds ( ) , not ( hasItem ( m_ProcessId2 ) ) ) ; }
Verify that multiple archiving processes can be started and subsequently stopped.
Verify that multiple archiving processes can be started and subsequently stopped .
//Stop the archiver process //Stop the archiver process