edu.rice.cs.drjava.ui
Class RecentFileManagerTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--edu.rice.cs.drjava.ui.RecentFileManagerTest
All Implemented Interfaces:
Test

public class RecentFileManagerTest
extends TestCase

Test functions of RecentFileManager.

Version:
$Id: RecentFileManagerTest.java,v 1.2 2002/09/04 21:02:20 csreis Exp $

Field Summary
private  JMenu _menu
           
private  DefaultGlobalModel _model
           
private  RecentFileManager _rfm
           
protected  File _tempDir
           
protected static String BAR_TEXT
           
protected static String FOO_TEXT
           
 
Fields inherited from class junit.framework.TestCase
fName
 
Constructor Summary
RecentFileManagerTest(String name)
          Constructor.
 
Method Summary
 void setUp()
          Setup method for each JUnit test case.
static Test suite()
          Creates a test suite for JUnit to run.
protected  File tempFile()
          Create a new temporary file in _tempDir.
 void testAddMoreThanMaxSize()
          Tests that the size of the recent files list doesn't get bigger than the maximum size.
 void testShrinksToMaxSize()
          Tests that the size of the recent files list is reduced in response to a decrease in max size.
protected  File writeToNewTempFile(String text)
          Creates a new temporary file and writes the given text to it.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

FOO_TEXT

protected static final String FOO_TEXT

BAR_TEXT

protected static final String BAR_TEXT

_rfm

private RecentFileManager _rfm

_menu

private JMenu _menu

_model

private DefaultGlobalModel _model

_tempDir

protected File _tempDir
Constructor Detail

RecentFileManagerTest

public RecentFileManagerTest(String name)
Constructor.
Parameters:
String - name
Method Detail

suite

public static Test suite()
Creates a test suite for JUnit to run.
Returns:
a test suite based on the methods in this class

setUp

public void setUp()
           throws IOException
Setup method for each JUnit test case.
Overrides:
setUp in class TestCase

tempFile

protected File tempFile()
                 throws IOException
Create a new temporary file in _tempDir. Calls with the same int will return the same filename, while calls with different ints will return different filenames.

writeToNewTempFile

protected File writeToNewTempFile(String text)
                           throws IOException
Creates a new temporary file and writes the given text to it. The File object for the new file is returned.

testAddMoreThanMaxSize

public void testAddMoreThanMaxSize()
                            throws IOException,
                                   AlreadyOpenException,
                                   OperationCanceledException
Tests that the size of the recent files list doesn't get bigger than the maximum size.

testShrinksToMaxSize

public void testShrinksToMaxSize()
                          throws IOException,
                                 AlreadyOpenException,
                                 OperationCanceledException
Tests that the size of the recent files list is reduced in response to a decrease in max size.