mil.dod.th.ose.shell/test/mil/dod/th/ose/shell/TestThoseCommands.java
@Test
    public void testFactories() throws InvalidSyntaxException
    {
        CommandSession testSession = mock(CommandSession.class);
        PrintStream testStream = mock(PrintStream.class);
        when(testSession.getConsole()).thenReturn(testStream);

        when(m_Context.getServiceReferences(FactoryDescriptor.class.getName(), null)).thenReturn(null);

        m_SUT.factories(testSession, false, false);
        verify(testStream, atLeastOnce()).println(anyString());
        m_SUT.factories(testSession, true, false);
        verify(testStream, atLeastOnce()).println(anyString());
        m_SUT.factories(testSession, false, true);
        verify(testStream, atLeastOnce()).println(anyString());
        m_SUT.factories(testSession, false, false);
        verify(testStream, atLeastOnce()).println(anyString());
    }
/**
     * Verify that the 'factories' command will list factories known to the system.
     */
Verify that the 'factories' command will list factories known to the system.
Verify that the ' factories ' command will list factories known to the system .
@Test
    public void testFactories() throws InvalidSyntaxException
    {
        CommandSession testSession = mock(CommandSession.class);
        PrintStream testStream = mock(PrintStream.class);
        when(testSession.getConsole()).thenReturn(testStream);
        when(m_Context.getServiceReferences(FactoryDescriptor.class.getName(), null)).thenReturn(null);
        m_SUT.factories(testSession, false, false);
        verify(testStream, atLeastOnce()).println(anyString());
        m_SUT.factories(testSession, true, false);
        verify(testStream, atLeastOnce()).println(anyString());
        m_SUT.factories(testSession, false, true);
        verify(testStream, atLeastOnce()).println(anyString());
        m_SUT.factories(testSession, false, false);
        verify(testStream, atLeastOnce()).println(anyString());
    }
@ Test public void testFactories ( ) throws InvalidSyntaxException { CommandSession testSession = mock ( CommandSession . class ) ; PrintStream testStream = mock ( PrintStream . class ) ; when ( testSession . getConsole ( ) ) . thenReturn ( testStream ) ; when ( m_Context . getServiceReferences ( FactoryDescriptor . class . getName ( ) , null ) ) . thenReturn ( null ) ; m_SUT . factories ( testSession , false , false ) ; verify ( testStream , atLeastOnce ( ) ) . println ( anyString ( ) ) ; m_SUT . factories ( testSession , true , false ) ; verify ( testStream , atLeastOnce ( ) ) . println ( anyString ( ) ) ; m_SUT . factories ( testSession , false , true ) ; verify ( testStream , atLeastOnce ( ) ) . println ( anyString ( ) ) ; m_SUT . factories ( testSession , false , false ) ; verify ( testStream , atLeastOnce ( ) ) . println ( anyString ( ) ) ; }
Verify that the 'factories' command will list factories known to the system.
Verify that the ' factories ' command will list factories known to the system .