### Question:
RmiJournalReceiver extends UnicastRemoteObject implements RmiJournalReceiverInterface { public void openFile(String repositoryHash, String filename) throws JournalException { if (journalFile != null) { throw logAndGetException("Attempting to open file '" + filename + "' when file '" + journalFile.getName() + "' has not been closed."); } try { journalFile = new TransportOutputFile(directory, filename); writer = journalFile.open(); } catch (IOException e) { throw logAndGetException("Problem opening" + filename + "'", e); } currentRepositoryHash = repositoryHash; itemIndex = 0; logger.debug("opened file '" + filename + "', hash is '" + repositoryHash + "'"); } RmiJournalReceiver(RmiJournalReceiverArguments arguments); void exportAndBind(); void openFile(String repositoryHash, String filename); void writeText(String indexedHash, String text); void closeFile(); static void main(String[] args);  }### Answer:
@Test public void testCantCreateFile() throws RemoteException, JournalException { RmiJournalReceiver receiver = createReceiver(new String[] { journalDirectory.getAbsolutePath(), "1234", "1235", "FATAL"}); try { receiver.openFile("RepoHash", ":"); fail("Expected an exception."); } catch (JournalException e) { } }