org.apache.qpid.util
Class LogMonitorTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.qpid.util.LogMonitorTest
All Implemented Interfaces:
junit.framework.Test

public class LogMonitorTest
extends junit.framework.TestCase


Constructor Summary
LogMonitorTest()
           
 
Method Summary
 void setUp()
           
 void testFindMatches_Match()
          Test that Log file matches logged messages.
 void testFindMatches_NoMatch()
          Test that Log file does not match a message not logged.
 void testMonitor()
          Test that a new file is created when attempting to set up a monitor with the default constructor.
 void testMonitorNonExistentFile()
          Test that a new file is created when attempting to set up a monitor on a non existing file.
 void testMonitorNormalFile()
          Test that creation of a monitor on an existing file is possible This also tests taht getMonitoredFile works
 void testMonitorNullFile()
          Test that a new file is created when attempting to set up a monitor on a null input value.
 void testRead()
           
 void testReset()
           
 void testWaitForMessage_Timeout()
           
protected  void validateLogContainsMessage(LogMonitor log, String message)
          Validate that the LogMonitor can match the given string in the log
protected  void validateLogDoesNotContainsMessage(LogMonitor log, String message)
          Validate that the LogMonitor does not match the given string in the log
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogMonitorTest

public LogMonitorTest()
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

testMonitor

public void testMonitor()
Test that a new file is created when attempting to set up a monitor with the default constructor.


testMonitorNormalFile

public void testMonitorNormalFile()
                           throws IOException
Test that creation of a monitor on an existing file is possible This also tests taht getMonitoredFile works

Throws:
IOException - if there is a problem creating the temporary file

testMonitorNullFile

public void testMonitorNullFile()
Test that a new file is created when attempting to set up a monitor on a null input value.


testMonitorNonExistentFile

public void testMonitorNonExistentFile()
                                throws IOException
Test that a new file is created when attempting to set up a monitor on a non existing file.

Throws:
IOException - if there is a problem setting up the nonexistent file

testFindMatches_Match

public void testFindMatches_Match()
                           throws IOException
Test that Log file matches logged messages.

Throws:
IOException - if there is a problem creating LogMontior

testFindMatches_NoMatch

public void testFindMatches_NoMatch()
                             throws IOException
Test that Log file does not match a message not logged.

Throws:
IOException - if there is a problem creating LogMontior

testWaitForMessage_Timeout

public void testWaitForMessage_Timeout()
                                throws IOException
Throws:
IOException

testReset

public void testReset()
               throws IOException
Throws:
IOException

testRead

public void testRead()
              throws IOException
Throws:
IOException

validateLogDoesNotContainsMessage

protected void validateLogDoesNotContainsMessage(LogMonitor log,
                                                 String message)
                                          throws IOException
Validate that the LogMonitor does not match the given string in the log

Parameters:
log - The LogMonitor to check
message - The message to check for
Throws:
IOException - if a problems occurs

validateLogContainsMessage

protected void validateLogContainsMessage(LogMonitor log,
                                          String message)
                                   throws IOException
Validate that the LogMonitor can match the given string in the log

Parameters:
log - The LogMonitor to check
message - The message to check for
Throws:
IOException - if a problems occurs


Licensed to the Apache Software Foundation