FileDocCategorySizeDatePackage
FilePropertiesTest.javaAPI DocExample951Mon Feb 02 20:05:10 GMT 2004regress

FilePropertiesTest

public class FilePropertiesTest extends TestCase

Fields Summary
private static final String
TEST_FILE_NAME
Properties
p
File
erewhon
Constructors Summary
Methods Summary
protected voidsetUp()
Set up for junit test.

see
junit.framework.TestCase#setUp()

	       	 
	     
		super.setUp();
		erewhon.delete();
		// no such file should exist; should not throw IOException
		p = new FileProperties(TEST_FILE_NAME); 
		
	
public voidtestSet()

		System.out.println("Properties p should be empty:");
		assertEquals(p.size(), 0);
		p.list(System.out);
		p.setProperty("foo", "bar");
		((FileProperties)p).save();

		p = new FileProperties(TEST_FILE_NAME);
		System.out.println("This properties should be have foo=bar:");
		p.list(System.out);

		new File("no such file").delete();