Package com.jitcaforwin.trackinfoanalyzer.printout.filter

Examples of com.jitcaforwin.trackinfoanalyzer.printout.filter.LogPrintoutFilter


    EasyMock.verify(filterMock1, filterMock2, filterMock3, logMock);
  }
 
  @Test
  public void testOR(){
    LogPrintoutFilter filterMock1 = EasyMock.createMock(LogPrintoutFilter.class);
    LogPrintoutFilter filterMock2 = EasyMock.createMock(LogPrintoutFilter.class);
    LogPrintoutFilter filterMock3 = EasyMock.createMock(LogPrintoutFilter.class);
    LogPrintoutFilter filter = MultiFilter.createMultiFilterOR(filterMock1, filterMock2, filterMock3);
    Log logMock = EasyMock.createMock(Log.class);
   
    EasyMock.expect(filterMock1.isPrintAllowed(EasyMock.anyObject(Log.class))).andReturn(true).times(0,1);
    EasyMock.expect(filterMock2.isPrintAllowed(EasyMock.anyObject(Log.class))).andReturn(false).times(0,1);
    EasyMock.expect(filterMock3.isPrintAllowed(EasyMock.anyObject(Log.class))).andReturn(true).times(0,1);
    EasyMock.replay(filterMock1, filterMock2, filterMock3, logMock);
   
    assertTrue(filter.isPrintAllowed(logMock));
   
    EasyMock.verify(filterMock1, filterMock2, filterMock3, logMock);
  }
View Full Code Here


    EasyMock.verify(filterMock1, filterMock2, filterMock3, logMock);
  }
 
  @Test
  public void testMultiFilterANDWithNoFilterAndOnlyErrorsFilter(){
    LogPrintoutFilter noFilter = new NoFilter();
    LogPrintoutFilter onlyErrorsFilter = new OnlyErrorsFilter();
    LogPrintoutFilter filter = MultiFilter.createMultiFilterAND(noFilter, onlyErrorsFilter);
   
    Log logMockOk = EasyMock.createMock(Log.class);
    Log logMockError = EasyMock.createMock(Log.class);
    EasyMock.expect(logMockOk.getStatus()).andReturn(new Ok()).times(1);
    EasyMock.expect(logMockError.getStatus()).andReturn(new Error()).times(1);
    EasyMock.replay(logMockOk, logMockError);
   
    assertFalse(filter.isPrintAllowed(logMockOk));
    assertTrue(filter.isPrintAllowed(logMockError));
   
    EasyMock.verify(logMockOk, logMockError);
  }
View Full Code Here

    EasyMock.verify(logMockOk, logMockError);
  }
 
  @Test
  public void testMultiFilterORWithNoFilterAndOnlyErrorsFilter(){
    LogPrintoutFilter noFilter = new NoFilter();
    LogPrintoutFilter onlyErrorsFilter = new OnlyErrorsFilter();
    LogPrintoutFilter filter = MultiFilter.createMultiFilterOR(noFilter, onlyErrorsFilter);
   
    Log logMockOk = EasyMock.createMock(Log.class);
    Log logMockError = EasyMock.createMock(Log.class);
    EasyMock.expect(logMockOk.getStatus()).andReturn(new Ok()).times(0, 1);
    EasyMock.expect(logMockError.getStatus()).andReturn(new Error()).times(0, 1);
    EasyMock.replay(logMockOk, logMockError);
   
    assertTrue(filter.isPrintAllowed(logMockOk));
    assertTrue(filter.isPrintAllowed(logMockError));
   
    EasyMock.verify(logMockOk, logMockError);
  }
View Full Code Here

public class LogPrintoutFilterFactoryTest {

  @Test
  public void testNoFilter(){
    LogPrintoutFilter filter = LogPrintoutFilterFactory.getFilterWithoutCriteria();
    assertTrue(filter instanceof NoFilter);
  }
View Full Code Here

    assertTrue(filter instanceof NoFilter);
  }

  @Test
  public void testOnlyErrorsFilter(){
    LogPrintoutFilter filter = LogPrintoutFilterFactory.getFilterForErrorMessagesOnly();
    assertTrue(filter instanceof OnlyErrorsFilter);
  }
View Full Code Here

    assertTrue(filter instanceof OnlyErrorsFilter);
  }
 
  @Test
  public void testOnlyExceptionsFilter(){
    LogPrintoutFilter filter = LogPrintoutFilterFactory.getFilterForExceptionsOnly();
    assertTrue(filter instanceof OnlyExceptionsFilter);
  }
View Full Code Here

    assertTrue(filter instanceof OnlyExceptionsFilter);
  }
 
  @Test
  public void testOnlyErrorsWithoutExceptionsFilter(){
    LogPrintoutFilter filter = LogPrintoutFilterFactory.getFilterForErrorsWithoutExceptions();
    assertTrue(filter instanceof OnlyErrorsWithoutExceptionsFilter);
  }
View Full Code Here

public class NoFilterTest {

  @Test
  public void testNullpointer(){
    LogPrintoutFilter filter = new NoFilter();
    assertTrue(filter.isPrintAllowed(null));
  }
View Full Code Here

    assertTrue(filter.isPrintAllowed(null));
  }
 
  @Test
  public void testAnyLog(){
    LogPrintoutFilter filter = new NoFilter();
    Log logToPrintMock = EasyMock.createMock(Log.class);
    EasyMock.replay(logToPrintMock);
    assertTrue(filter.isPrintAllowed(logToPrintMock));
    EasyMock.verify(logToPrintMock);
  }
View Full Code Here

import com.jitcaforwin.trackinfoanalyzer.printout.filter.LogPrintoutFilterFactory;

public class OnlyErrorsWithoutExceptionsFilterTest{
  @Test
  public void testOkLog(){
    LogPrintoutFilter filter = LogPrintoutFilterFactory.getFilterForErrorsWithoutExceptions();
    Log logMock = EasyMock.createMock(Log.class);
    EasyMock.expect(logMock.getStatus()).andReturn(new com.jitcaforwin.trackinfoanalyzer.log.status.Ok());
    EasyMock.replay(logMock);
    assertFalse(filter.isPrintAllowed(logMock));
    EasyMock.verify(logMock);
  }
View Full Code Here

TOP

Related Classes of com.jitcaforwin.trackinfoanalyzer.printout.filter.LogPrintoutFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.