public void testStoreAndRetrieve() throws IOException { Archiver.getInstance().store("number", new Integer(7)); assertEquals(new Integer(7), Archiver.getInstance().retrieve("number")); Archiver.getInstance().store("number", new Integer(17)); assertEquals(new Integer(17), Archiver.getInstance().retrieve("number")); }
public void testStoreAndDelete() throws IOException { try { Archiver.getInstance().retrieve("number"); } catch (IOException e) { assertEquals("No such archive number", e.getMessage()); } Archiver.getInstance().store("number", new Integer(7)); assertEquals(new Integer(7), Archiver.getInstance().retrieve("number")); Archiver.getInstance().delete("number"); try { Archiver.getInstance().retrieve("number"); } catch (IOException e) { assertEquals("No such archive number", e.getMessage()); } }
public void tearDown() { try { Archiver.getInstance().delete("number"); } catch (Exception e) { } }