|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
net.sf.logdistiller.LogEventTestCase
public class LogEventTestCase
Base class to write custom LogEvent junit tests more easily.
Field Summary | |
---|---|
protected LogType.Description |
description
|
protected LogEvent.Factory |
factory
|
protected LogType |
logtype
|
Constructor Summary | |
---|---|
protected |
LogEventTestCase(String logtype)
|
Method Summary | |
---|---|
void |
checkDump(LogEvent.Factory factory,
BufferedReader reader)
|
void |
checkDump(LogEvent.Factory factory,
String name)
|
static int |
dump(LogEvent.Factory factory,
File file)
Dump every LogEvent found in the factory to the given File using platform encoding. |
static int |
dump(LogEvent.Factory factory,
PrintWriter out)
Dump every LogEvent found in the factory to the given PrintWriter. |
protected URL |
getResource(String name)
get a resource from the current testcase class and check it has been found |
protected LogEvent.Factory |
newFactory(String name)
create a factory for a resource (read with platform encoding). |
static String |
readDump(BufferedReader reader)
Read the next LogEvent dump. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final LogType logtype
protected LogType.Description description
protected LogEvent.Factory factory
Constructor Detail |
---|
protected LogEventTestCase(String logtype)
Method Detail |
---|
protected URL getResource(String name)
name
- the resource to get
null
RuntimeException
- if resource not foundClass.getResource(String)
protected LogEvent.Factory newFactory(String name) throws IOException
IOException
public static int dump(LogEvent.Factory factory, PrintWriter out) throws IOException, ParseException
IOException
ParseException
public static int dump(LogEvent.Factory factory, File file) throws IOException, ParseException
IOException
ParseException
public static String readDump(BufferedReader reader) throws IOException
IOException
public void checkDump(LogEvent.Factory factory, BufferedReader reader) throws IOException, ParseException
IOException
ParseException
public void checkDump(LogEvent.Factory factory, String name) throws IOException, ParseException
IOException
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |