Package com.mockobjects.io

# Class MockPrintWriter

java.lang.Object
java.io.Writer
java.io.PrintWriter
com.mockobjects.io.MockPrintWriter

All Implemented Interfaces:
  `Verifiable`, `Closeable`, `Flushable`, `Appendable`, `AutoCloseable`

public class MockPrintWriter extends PrintWriter implements Verifiable

Author:
  steve@m3p.co.uk, Francois Beausoleil (fbos@users.sourceforge.net)

## Constructor Summary

Constructors
Constructor
Description
`MockPrintWriter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`flush()`
`void`
`setExpectedCloseCalls(int calls)`
`void`
`setExpectedFlushCalls(int calls)`
`void`
`setExpectedSegment(String aString)`
`void`
`verify()`
Throw an AssertionFailedException if any expectations have not been met.
`void`
`write(String s)`

### Methods inherited from class java.io.PrintWriter

`append, append, append, checkError, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, write, write, write, write`

### Methods inherited from class java.io.Writer

`nullWriter`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MockPrintWriter

public MockPrintWriter()

## Method Details

### setExpectedCloseCalls

public void setExpectedCloseCalls(int calls)

### setExpectedSegment

public void setExpectedSegment(String aString)

### write

public void write(String s)

Overrides:
  `write` in class `PrintWriter`

### setExpectedFlushCalls

public void setExpectedFlushCalls(int calls)

### flush

public void flush()

Specified by:
  `flush` in interface `Flushable`
Overrides:
  `flush` in class `PrintWriter`

### close

public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `PrintWriter`

### verify

public void verify()
Description copied from interface: `Verifiable`
Throw an AssertionFailedException if any expectations have not been met.

Specified by:
  `verify` in interface `Verifiable`