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