Package com.jitcaforwin.trackinfoanalyzer.log

Examples of com.jitcaforwin.trackinfoanalyzer.log.InternalLog


public class LogPrinterTest {

  @Test
  public void testPrintingWithFilter() throws IOException {
    InternalLog logMock = EasyMock.createMock(InternalLog.class);
    LogPrintoutFilter filterMock = EasyMock.createMock(LogPrintoutFilter.class);
    OutputStream outputStreamMock = EasyMock.createMock(OutputStream.class);

    logMock.print(EasyMock.anyObject(BufferedLogPrinter.class), EasyMock.eq(filterMock));
    EasyMock.expectLastCall();
    outputStreamMock.close();
    EasyMock.expectLastCall();

    EasyMock.replay(logMock, filterMock, outputStreamMock);
View Full Code Here


    EasyMock.verify(logMock, filterMock, outputStreamMock);
  }

  @Test
  public void testPrintingWithEmptyFilter() throws IOException {
    InternalLog logMock = EasyMock.createMock(InternalLog.class);
    OutputStream outputStreamMock = EasyMock.createMock(OutputStream.class);

    logMock.print(EasyMock.anyObject(BufferedLogPrinter.class), EasyMock.anyObject(NoFilter.class));
    EasyMock.expectLastCall();
    outputStreamMock.close();
    EasyMock.expectLastCall();

    EasyMock.replay(logMock, outputStreamMock);
View Full Code Here

    EasyMock.verify(logMock, outputStreamMock);
  }

  @Test
  public void testPrintingWithOnlyErrorsFilter() throws IOException {
    InternalLog logMock = EasyMock.createMock(InternalLog.class);
    OutputStream outputStreamMock = EasyMock.createMock(OutputStream.class);

    logMock.print(EasyMock.anyObject(BufferedLogPrinter.class), EasyMock.anyObject(OnlyErrorsFilter.class));
    EasyMock.expectLastCall();
    outputStreamMock.close();
    EasyMock.expectLastCall();

    EasyMock.replay(logMock, outputStreamMock);
View Full Code Here

    EasyMock.verify(logMock, outputStreamMock);
  }

  @Test
  public void testPrintingWithOnlyExceptionsFilter() throws IOException {
    InternalLog logMock = EasyMock.createMock(InternalLog.class);
    OutputStream outputStreamMock = EasyMock.createMock(OutputStream.class);

    logMock.print(EasyMock.anyObject(BufferedLogPrinter.class), EasyMock.anyObject(OnlyExceptionsFilter.class));
    EasyMock.expectLastCall();
    outputStreamMock.close();
    EasyMock.expectLastCall();

    EasyMock.replay(logMock, outputStreamMock);
View Full Code Here

    EasyMock.verify(logMock, outputStreamMock);
  }
 
  @Test
  public void testPrintingWithErrorsWithoutExceptionsFilter() throws IOException {
    InternalLog logMock = EasyMock.createMock(InternalLog.class);
    OutputStream outputStreamMock = EasyMock.createMock(OutputStream.class);

    logMock.print(EasyMock.anyObject(BufferedLogPrinter.class), EasyMock.anyObject(OnlyErrorsWithoutExceptionsFilter.class));
    EasyMock.expectLastCall();
    outputStreamMock.close();
    EasyMock.expectLastCall();

    EasyMock.replay(logMock, outputStreamMock);
View Full Code Here

    EasyMock.verify(logMock, outputStreamMock);
  }

  @Test(expected = LogPrinterException.class)
  public void testPrintingWithoutOutputStream() throws IOException {
    InternalLog logMock = EasyMock.createMock(InternalLog.class);

    logMock.print(EasyMock.anyObject(BufferedLogPrinter.class), EasyMock.anyObject(NoFilter.class));
    EasyMock.expectLastCall();

    EasyMock.replay(logMock);

    LogPrinter printer = new LogPrinterImpl(logMock);
View Full Code Here

TOP

Related Classes of com.jitcaforwin.trackinfoanalyzer.log.InternalLog

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.