e.printStackTrace(); fail(e.getMessage());
fail("unexpected exception", e);
	public void testRemoveThenAdd() {		String fileName = "testRemoveThenAdd.txt";		File file1 = new File(base, fileName+".1");		File file2 = new File(base, fileName+".2");		File file3 = new File(base, fileName+".3");		manager1 = new FileManager(base, null);		// create a permanent file		try {			manager1.open(true);			manager1.add(fileName);			// create version (1)			File tmpFile = manager1.createTempFile(fileName);			writeToFile(tmpFile, "File exists");			manager1.update(new String[] {fileName}, new String[] {tmpFile.getName()});			// do it again, now version (2)			tmpFile = manager1.createTempFile(fileName);			writeToFile(tmpFile, "File exists #2");			manager1.update(new String[] {fileName}, new String[] {tmpFile.getName()});			manager1.close(); // force a cleanup			manager1 = null;			// sanity check			if (file1.exists() || !file2.exists() || file3.exists())				fail("Failed creating a file revision");						manager2 = new FileManager(base, null);			manager2.open(true);			manager2.remove(fileName);			// check lookup & getInputStream			File testFile = manager2.lookup(fileName, false);			assertNull(testFile);			manager2.add(fileName);			testFile = manager2.lookup(fileName, false);			assertNotNull(testFile);			assertTrue(testFile.getName().endsWith(".0"));			// write new file, ensure it version 3			tmpFile = manager2.createTempFile(fileName);			writeToFile(tmpFile, "File exists #3");			manager2.update(new String[] {fileName}, new String[] {tmpFile.getName()});			testFile = manager2.lookup(fileName, false);			assertNotNull(testFile);			assertTrue(testFile.getName().endsWith(".3"));			assertTrue(file3.exists());						// open a new manager, ensure that the database was updated			// by checking version is also #3			manager1 = new FileManager(base, null);			manager1.open(true);			testFile = manager1.lookup(fileName, false);			assertNotNull(testFile);			assertTrue(testFile.getName().endsWith(".3"));						manager1.close();			manager1 = null;			manager2.close();			manager2 = null;		} catch(IOException e) {			e.printStackTrace();			fail(e.getMessage());		}	}