Esempio n. 1
0
  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"));
  }
Esempio n. 2
0
  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());
    }
  }
Esempio n. 3
0
 public void tearDown() {
   try {
     Archiver.getInstance().delete("number");
   } catch (Exception e) {
   }
 }