mil.dod.th.ose.logging/test/mil/dod/th/ose/logging/TestLogWriter.java
private LogFilter createFilter(final String symName, final int severity)
    {
        LogFilter filter =  mock(LogFilter.class);
        final String m_SymName = symName;
        when(filter.getSeverity()).thenReturn(severity);
        when(filter.matches(Mockito.any(Bundle.class))).thenAnswer(new Answer<Boolean>()
        {
            @Override
            public Boolean answer(InvocationOnMock invocation) throws Throwable
            {
                final Bundle bundle = (Bundle)invocation.getArguments()[0];
                return bundle.getSymbolicName().matches(m_SymName);
            }
        });
        return filter;
    }
/**
     * Create a Log Filter with the given sym name and severity.
     */
Create a Log Filter with the given sym name and severity.
Create a Log Filter with the given sym name and severity .
private LogFilter createFilter(final String symName, final int severity)
    {
        LogFilter filter =  mock(LogFilter.class);
        final String m_SymName = symName;
        when(filter.getSeverity()).thenReturn(severity);
        when(filter.matches(Mockito.any(Bundle.class))).thenAnswer(new Answer<Boolean>()
        {
            @Override
            public Boolean answer(InvocationOnMock invocation) throws Throwable
            {
                final Bundle bundle = (Bundle)invocation.getArguments()[0];
                return bundle.getSymbolicName().matches(m_SymName);
            }
        });
        return filter;
    }
private LogFilter createFilter ( final String symName , final int severity ) { LogFilter filter = mock ( LogFilter . class ) ; final String m_SymName = symName ; when ( filter . getSeverity ( ) ) . thenReturn ( severity ) ; when ( filter . matches ( Mockito . any ( Bundle . class ) ) ) . thenAnswer ( new Answer < Boolean > ( ) { @ Override public Boolean answer ( InvocationOnMock invocation ) throws Throwable { final Bundle bundle = ( Bundle ) invocation . getArguments ( ) [ 0 ] ; return bundle . getSymbolicName ( ) . matches ( m_SymName ) ; } } ) ; return filter ; }
Create a Log Filter with the given sym name and severity.
Create a Log Filter with the given sym name and severity .