|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
edu.rice.cs.drjava.DrJavaTestCase
edu.rice.cs.drjava.model.MultiThreadedTestCase
edu.rice.cs.util.LogTest
public class LogTest
Test cases for Log.
| Nested Class Summary | |
|---|---|
private static class |
LogTest.LogTestThread
A thread class that adds a log message after sleeping a given number of milliseconds |
| Nested classes/interfaces inherited from class junit.framework.TestCase |
|---|
junit.framework.TestCase.WrappedException |
| Field Summary | |
|---|---|
private static int |
DELAY
|
private static int |
NUM_THREADS
|
static int |
TOL
|
| Fields inherited from class edu.rice.cs.drjava.model.MultiThreadedTestCase |
|---|
_testFailed |
| Constructor Summary | |
|---|---|
LogTest()
|
|
| Method Summary | |
|---|---|
private static String |
getStringAfterDate(String s)
Returns the string after the date; returns null if there is no date. |
void |
testConcurrentWrites()
Attempts to test Log's behavior when called concurrently from several sources. |
void |
testExceptionPrinting()
Tests the Exception printing methods in the Log file by throwing two exceptions and using the two types of log methods (one with the Throwable itself and the other with the the StackTraceElement[]) |
void |
testLog()
Adds a couple of generic messages to a log, and then tests to make sure they are all correct, in the correct order, and their timestamps are within the past few seconds. |
private static boolean |
withinTolerance(Date earlier,
Date time0,
Date now)
Returns true if time0 is less than 5000 ms earlier than 'earlier', and now is less than 5000 ms earlier than time0. |
| Methods inherited from class edu.rice.cs.drjava.model.MultiThreadedTestCase |
|---|
join, listenerFail, listenerFail, setUp, tearDown, wait |
| Methods inherited from class edu.rice.cs.drjava.DrJavaTestCase |
|---|
setConfigSetting, setDocText |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TOL
private static final int NUM_THREADS
private static final int DELAY
| Constructor Detail |
|---|
public LogTest()
| Method Detail |
|---|
private static String getStringAfterDate(String s)
private static boolean withinTolerance(Date earlier,
Date time0,
Date now)
public void testLog()
throws IOException
IOException
public void testExceptionPrinting()
throws IOException
IOException
public void testConcurrentWrites()
throws IOException,
InterruptedException
IOException
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||